]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoelfctl: remove memory leak
emaste [Wed, 11 Mar 2020 13:51:01 +0000 (13:51 +0000)]
elfctl: remove memory leak

CID: 1420356
Reported by: Coverity Scan
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip 2 failing tests after llvm10 import
lwhsu [Wed, 11 Mar 2020 12:43:54 +0000 (12:43 +0000)]
Temporarily skip 2 failing tests after llvm10 import

PR: 244732
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip sys.geom.class.gate.ggate_test.ggated in CI
lwhsu [Wed, 11 Mar 2020 10:42:05 +0000 (10:42 +0000)]
Temporarily skip sys.geom.class.gate.ggate_test.ggated in CI

PR: 244737
Sponsored by: The FreeBSD Foundation

4 years agoIf the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
hselasky [Wed, 11 Mar 2020 08:16:13 +0000 (08:16 +0000)]
If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximum maximum packet size as buffer size instead.

Submitted by: Oskar Holmlund <oskar.holmlund@ohdata.se>
PR: 244718
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoRevert r358858 as it breaks some ipfw(8) setups.
melifaro [Wed, 11 Mar 2020 08:08:53 +0000 (08:08 +0000)]
Revert r358858 as it breaks some ipfw(8) setups.

Reported by: O. Hartmann <o.hartmann@walstatt.org>

4 years agofusefs: avoid cache corruption with buggy fuse servers
asomers [Wed, 11 Mar 2020 04:29:45 +0000 (04:29 +0000)]
fusefs: avoid cache corruption with buggy fuse servers

The FUSE protocol allows the client (kernel) to cache a file's size, if the
server (userspace daemon) allows it. A well-behaved daemon obviously should
not change a file's size while a client has it cached. But a buggy daemon
might. If the kernel ever detects that that has happened, then it should
invalidate the entire cache for that file. Previously, we would not only
cache stale data, but in the case of a file extension while we had the size
cached, we accidentally extended the cache with zeros.

PR: 244178
Reported by: Ben RUBSON <ben.rubson@gmx.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24012

4 years agoEliminate camq_alloc() and camq_free()
imp [Wed, 11 Mar 2020 00:00:03 +0000 (00:00 +0000)]
Eliminate camq_alloc() and camq_free()

These are no longer needed now that it's embedded in cam_ccbq. They are also
unused.

Reviewed by: ken, chuck
Differential Revision: https://reviews.freebsd.org/D24008

4 years agoEliminate xpt_copy_path.
imp [Tue, 10 Mar 2020 23:59:58 +0000 (23:59 +0000)]
Eliminate xpt_copy_path.

It's used in exactly one place. In that place it's used so we can hold the lock
on the device associated with the path (since we do a xpt_path_lock and unlock
pair around the callback). Instead, inline taking and dropping the reference to
the device so we can ensure we can unlock the mutex after the callback finishes
if the path in the ccb that's queued to be processed by xpt_scanner_thread is
destroyed while being processed. We don't actually need the path itself for
anything other than dereferencing it to get the device to do the lock and
unlock.

This also makes the locking / use model for cam_path a little cleaner by
eliminating a case where we needlessly copy the object.

Reviewed by: chuck, chs, ken
Differential Revision: https://reviews.freebsd.org/D24008

4 years agoRemove unused cam ccb flags
imp [Tue, 10 Mar 2020 23:58:41 +0000 (23:58 +0000)]
Remove unused cam ccb flags

These flags have been unused for some time. Some of them were in the
CAM2 specification, but CAM has moved on a bit from that. Some were
used in the old Pluto VideoSpace (and AirSpace) systems which had the
video playback I/O scheduler in userspace, but have been unused since
then.

Reviewed by: chuck, ken
Differential Revision:  https://reviews.freebsd.org/D24008

4 years agoAdd "tigerlake" CPUTYPE for x86 to catch up with Clang 10.0.
jkim [Tue, 10 Mar 2020 23:12:55 +0000 (23:12 +0000)]
Add "tigerlake" CPUTYPE for x86 to catch up with Clang 10.0.

4 years ago- Remove CPUTYPE examples for sparc64. It is not supported since r358345.
jkim [Tue, 10 Mar 2020 22:59:01 +0000 (22:59 +0000)]
- Remove CPUTYPE examples for sparc64.  It is not supported since r358345.
- Clean up CPUTYPE examples for x86.  GCC 4.2.1 was removed by r358454.

4 years agocxgbe/t4_tom: The MSS in a FLOWC work request must not be 0.
np [Tue, 10 Mar 2020 21:49:56 +0000 (21:49 +0000)]
cxgbe/t4_tom: The MSS in a FLOWC work request must not be 0.

Submitted by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agocxgbe(4): Do not try to use 0 as an rx buffer address when the driver is
np [Tue, 10 Mar 2020 21:44:20 +0000 (21:44 +0000)]
cxgbe(4): Do not try to use 0 as an rx buffer address when the driver is
already allocating from the safe zone and the allocation fails.

This bug was introduced in r357481.

MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agoDon't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().
melifaro [Tue, 10 Mar 2020 20:30:21 +0000 (20:30 +0000)]
Don't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().

Submitted by: Neel Chauhan <neel AT neelc DOT org>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21812

4 years agoMove another file in libllvm from sources required for world, to sources
dim [Tue, 10 Mar 2020 20:25:36 +0000 (20:25 +0000)]
Move another file in libllvm from sources required for world, to sources
required for bootstrap, as the PowerPC builds need this.

Reported by: bdragon
PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoFix signal delivery might be on sigfastblock clearing.
kib [Tue, 10 Mar 2020 20:25:03 +0000 (20:25 +0000)]
Fix signal delivery might be on sigfastblock clearing.

When clearing sigfastblock, either by sigfastblock(UNSETPTR) call or
implicitly on execve(2), kernel must check for pending signals and
reschedule them if needed.

E.g. on execve, all other threads are terminated, and current thread
fast block pointer is cleaned.  If any signal was left pending, it can
now be delivered to the current thread, and we should prepare for
ast() on return to userspace to notice the signals.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation

4 years agoReturn reschedule_signals() to being static again.
kib [Tue, 10 Mar 2020 20:04:38 +0000 (20:04 +0000)]
Return reschedule_signals() to being static again.

It was used after sigfastblock_setpend() call in in ast() when current
thread fast-blocks signals.  Add a flag to sigfastblock_setpend() to
request reschedule, and remove the direct use of the function from
subr_trap.c

Tested by: pho
Sponsored by: The FreeBSD Foundation

4 years agoAdd one additional file to libllvmminimal, to help the ppc64 bootstrap.
dim [Tue, 10 Mar 2020 20:01:52 +0000 (20:01 +0000)]
Add one additional file to libllvmminimal, to help the ppc64 bootstrap.

Reported by: bdragon
PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoAdd basic IPv4/IPv6 forwarding tests.
melifaro [Tue, 10 Mar 2020 19:52:19 +0000 (19:52 +0000)]
Add basic IPv4/IPv6 forwarding tests.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24002

4 years agoSkip sys.netpfil.pf.nat.exhaust on amd64 in CI as it sometimes panics kernel
lwhsu [Tue, 10 Mar 2020 19:18:24 +0000 (19:18 +0000)]
Skip sys.netpfil.pf.nat.exhaust on amd64 in CI as it sometimes panics kernel

PR: 244703
Sponsored by: The FreeBSD Foundation

4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Tue, 10 Mar 2020 18:17:17 +0000 (18:17 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
10.0.0-rc3 c290cb61fdc.

Release notes for llvm, clang, lld and libc++ 10.0.0 will become
available here:

https://releases.llvm.org/10.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/projects/libcxx/docs/ReleaseNotes.html

PR: 244251
MFC after: 6 weeks

4 years agoMerge ^/head r358832 through r358848.
dim [Tue, 10 Mar 2020 17:49:09 +0000 (17:49 +0000)]
Merge ^/head r358832 through r358848.

4 years agoUntangle TPR shadowing and APIC virtualization.
mr [Tue, 10 Mar 2020 16:53:49 +0000 (16:53 +0000)]
Untangle TPR shadowing and APIC virtualization.
This speeds up Windows guests tremendously.

The patch does:
Add a new tuneable 'hw.vmm.vmx.use_tpr_shadowing' to disable TLP shadowing.
Also add 'hw.vmm.vmx.cap.tpr_shadowing' to be able to query if TPR shadowing is used.

Detach the initialization of TPR shadowing from the initialization of APIC virtualization.
APIC virtualization still needs TPR shadowing, but not vice versa.
Any CPU that supports APIC virtualization should also support TPR shadowing.

When TPR shadowing is used, the APIC page of each vCPU is written to the VMCS_VIRTUAL_APIC field of the VMCS
so that the CPU can write directly to the page without intercept.

On vm exit, vlapic_update_ppr() is called to update the PPR.

Submitted by: Yamagi Burmeister
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22942

4 years agoFix for building libusb under Linux.
hselasky [Tue, 10 Mar 2020 15:59:20 +0000 (15:59 +0000)]
Fix for building libusb under Linux.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoAdd support for the device statistics IOCTL, needed by the coming
hselasky [Tue, 10 Mar 2020 15:56:49 +0000 (15:56 +0000)]
Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoBump __FreeBSD_version after amd(8) removal, r358821
emaste [Tue, 10 Mar 2020 13:39:05 +0000 (13:39 +0000)]
Bump __FreeBSD_version after amd(8) removal, r358821

Reported by: cy

4 years agoSet tentative dates.
dim [Tue, 10 Mar 2020 07:05:04 +0000 (07:05 +0000)]
Set tentative dates.

4 years agoMerge ^/head r358731 through r358831.
dim [Tue, 10 Mar 2020 07:04:05 +0000 (07:04 +0000)]
Merge ^/head r358731 through r358831.

4 years agoRemove -mlong-calls vhen building arm libraries and llvm.
dim [Tue, 10 Mar 2020 06:49:43 +0000 (06:49 +0000)]
Remove -mlong-calls vhen building arm libraries and llvm.

Clang from 9.0.0 onwards already has the necessary relocation range
extenders, so this workaround is no longer needed (it produces longer
and slower code). Tested on real hardware, and in cross-compile
environment.

Submitted by: mmel

4 years agobridge test: adding and removing static addresses
kp [Tue, 10 Mar 2020 06:29:59 +0000 (06:29 +0000)]
bridge test: adding and removing static addresses

Reviewed by: philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23960

4 years agobridge test: spanning tree
kp [Tue, 10 Mar 2020 06:28:45 +0000 (06:28 +0000)]
bridge test: spanning tree

Basic test case where we create a bridge loop, verify that we really are
looping and then enable spanning tree to resolve the loop.

Reviewed by: philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23959

4 years agopowerpc/booke: Split out 32- and 64- bit pmap details from main body
jhibbits [Tue, 10 Mar 2020 03:30:11 +0000 (03:30 +0000)]
powerpc/booke: Split out 32- and 64- bit pmap details from main body

Summary:
This is largely a straight-forward cleave of the 32-bit and 64-bit page
table specifics, along with the mmu_booke_*() functions that are wholely
different between the two implementations.

The ultimate goal of this is to make it easier to reason about and
update a specific implementation without wading through the other
implementation details.  This is in support of further changes to the 64-bit
pmap.

Reviewed by: bdragon
Differential Revision: https://reviews.freebsd.org/D23983

4 years agopipe: explain why not deallocating inode number is fine.
kib [Mon, 9 Mar 2020 23:40:25 +0000 (23:40 +0000)]
pipe: explain why not deallocating inode number is fine.

Suggested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24009

4 years agoposixshmcontrol: add an undocumented alias 'list' for the 'ls' command.
kib [Mon, 9 Mar 2020 23:08:24 +0000 (23:08 +0000)]
posixshmcontrol: add an undocumented alias 'list' for the 'ls' command.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoPreallocate pipe buffers on pipe creation.
kib [Mon, 9 Mar 2020 21:55:26 +0000 (21:55 +0000)]
Preallocate pipe buffers on pipe creation.

Return ENOMEM if one of the buffer cannot be created even with the
minimal size.  This should avoid subsequent spurious ENOMEM errors
from write(2) when buffer cannot be allocated on the fly, after we
reported that the pipe was create succesfully.

Reported by: Keno Fischer <keno@juliacomputing.com>
Reviewed by: markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23993

4 years agowmt(4): Fix Synaptics Touch Digitizer V04 attachment
wulf [Mon, 9 Mar 2020 21:01:22 +0000 (21:01 +0000)]
wmt(4): Fix Synaptics Touch Digitizer V04 attachment

Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage
as constant. That was not supported by descriptor parser.

PR: 232040
Reported by: Sergei Akhmatdinov <sakhmatd@darkn.space>
MFC after: 1 week

4 years agoregen src.conf.5 after r358821, AMD option removal
emaste [Mon, 9 Mar 2020 20:49:59 +0000 (20:49 +0000)]
regen src.conf.5 after r358821, AMD option removal

Also pick up LOADER_VERIEXEC_VECTX change.

4 years agoRemove WITH_AMD option, missed in r358821
emaste [Mon, 9 Mar 2020 20:49:06 +0000 (20:49 +0000)]
Remove WITH_AMD option, missed in r358821

4 years agoretire amd(8)
emaste [Mon, 9 Mar 2020 20:46:43 +0000 (20:46 +0000)]
retire amd(8)

autofs was introduced with FreeBSD 10.1 and is the supported method for
automounting filesystems.  As of r296194 the amd man page claimed that it
is deprecated.  Remove it from base now; the sysutils/am-utils port is
still available if necessary.

Discussed with: cy
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

4 years agoiicbus(4): Add support for ACPI-based children enumeration
wulf [Mon, 9 Mar 2020 20:31:38 +0000 (20:31 +0000)]
iicbus(4): Add support for ACPI-based children enumeration

When iicbus is attached as child of Designware I2C controller it scans all
ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described
in section 19.6.57 of ACPI specs.
If such a descriptor is found, I2C child is added to iicbus, it's I2C
address, IRQ resource and ACPI handle are added to ivars. Existing
ACPI bus-hosted child is deleted afterwards.

The driver also installs so called "I2C address space handler" which is
disabled by default as nontested.
Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22901

4 years agoacpi: Export functions required by upcoming acpi_iicbus driver.
wulf [Mon, 9 Mar 2020 20:28:45 +0000 (20:28 +0000)]
acpi: Export functions required by upcoming acpi_iicbus driver.

4 years agoacpi: Fix stalled value returned by acpi_get_device() after device deletion
wulf [Mon, 9 Mar 2020 20:27:25 +0000 (20:27 +0000)]
acpi: Fix stalled value returned by acpi_get_device() after device deletion

Newbus device reference attached to ACPI handle is not cleared when newbus
device is deleted with devctl(8) delete command. Fix that with calling of
AcpiDetachData() from "child_deleted" bus method like acpi_pci driver does.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22902

4 years agoStyle.
kib [Mon, 9 Mar 2020 19:46:28 +0000 (19:46 +0000)]
Style.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23993

4 years agogallant is 12x22, not 8x16
tsoome [Mon, 9 Mar 2020 19:43:28 +0000 (19:43 +0000)]
gallant is 12x22, not 8x16

INDEX.fonts does list gallant with wrong size.

4 years ago[aacraid] Handle both AIF and SYNC interrupts
luporl [Mon, 9 Mar 2020 19:01:17 +0000 (19:01 +0000)]
[aacraid] Handle both AIF and SYNC interrupts

Without this change, if an AIF interrupt comes at the same time a SYNC
command is finished, the SYNC interrupt will be lost. This happens because
all interrupt bits (bellbits) are cleared, but only one of them is handled.

Debugging shows that, (at least) when !sc->msi_enabled and (sc->flags &
AAC_FLAGS_SYNC_MODE) is true (sync mode), both bits may be set at the same
time.

PR: 237463
Reviewed by: scottl
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23859

4 years agoveloader use vectx API for kernel and modules
sjg [Mon, 9 Mar 2020 16:02:54 +0000 (16:02 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827

4 years agoUse the devfs vnode rather than the mntfs vnode for permissions checks.
chs [Mon, 9 Mar 2020 15:55:13 +0000 (15:55 +0000)]
Use the devfs vnode rather than the mntfs vnode for permissions checks.
I missed this one in r358714.

Reported by: pho
Reviewed by: mckusick
Approved by: imp (mentor)
Sponsored by: Netflix

4 years agoveloader use vectx API for kernel and modules
sjg [Mon, 9 Mar 2020 15:48:53 +0000 (15:48 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827

4 years agomake lacp's use_numa hashing aware of send tags
gallatin [Mon, 9 Mar 2020 13:44:51 +0000 (13:44 +0000)]
make lacp's use_numa hashing aware of send tags

When I did the use_numa support, I missed the fact that there is
a separate hash function for send tag nic selection. So when
use_numa is enabled, ktls offload does not work properly, as it
does not reliably allocate a send tag on the proper egress nic
since different egress nics are selected for send-tag allocation
and packet transmit. To fix this, this change:

- refectors lacp_select_tx_port_by_hash() and
     lacp_select_tx_port() to make lacp_select_tx_port_by_hash()
     always called by lacp_select_tx_port()

-   pre-shifts flowids to convert them to hashes when calling lacp_select_tx_port_by_hash()

-   adds a numa_domain field to if_snd_tag_alloc_params

-   plumbs the numa domain into places where we allocate send tags

In testing with NIC TLS setup on a NUMA machine, I see thousands
of output errors before the change when enabling
kern.ipc.tls.ifnet.permitted=1. After the change, I see no
errors, and I see the NIC sysctl counters showing active TLS
offload sessions.

Reviewed by: rrs, hselasky, jhb
Sponsored by: Netflix

4 years agoAdd the missing brackets to the logical expression.
mmel [Mon, 9 Mar 2020 13:36:45 +0000 (13:36 +0000)]
Add the missing brackets to the logical expression.

Reported by: clang10 via dim
MFC with: r355755

4 years agofuspi: silence build warning, plug resource leak
philip [Mon, 9 Mar 2020 04:09:36 +0000 (04:09 +0000)]
fuspi: silence build warning, plug resource leak

This silences an "unused label" warning as well as fixes the attach fail
path that wasn't releasing resources.

Submitted by:   Nicholas O'Brien <nickisobrien_gmail.com>
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D24004

4 years agocpufreq: Unbreak build.
manu [Mon, 9 Mar 2020 03:34:16 +0000 (03:34 +0000)]
cpufreq: Unbreak build.

4 years agocpufreq_dt: Fix r358555
manu [Mon, 9 Mar 2020 02:30:16 +0000 (02:30 +0000)]
cpufreq_dt: Fix r358555

Before skipping the current cpu when trying to find the ones that
have the same opp, record that this one have this opp.

Reported by: mmel
MFC after: 2 weeks
X-MFC-With: r358555

4 years agofusefs: fix fsync for files with multiple open handles
asomers [Mon, 9 Mar 2020 01:57:21 +0000 (01:57 +0000)]
fusefs: fix fsync for files with multiple open handles

We were reusing a structure for multiple operations, but failing to
reinitialize one member.  The result is that a server that cares about FUSE
file handle IDs would see one correct FUSE_FSYNC operation, and one with the
FHID unset.

PR: 244431
Reported by: Agata <chogata@gmail.com>
MFC after: 2 weeks

4 years ago[skip ci] fix typo in comment in the fusefs tests
asomers [Mon, 9 Mar 2020 00:14:09 +0000 (00:14 +0000)]
[skip ci] fix typo in comment in the fusefs tests

MFC after: 2 weeks

4 years agoarch.7: remove note about GCC 4.2.1 removal date
emaste [Sun, 8 Mar 2020 21:30:55 +0000 (21:30 +0000)]
arch.7: remove note about GCC 4.2.1 removal date

GCC 4.2.1 was removed in r358454.

Sponsored by: The FreeBSD Foundation

4 years agoarch.7: remove sparc64 references
emaste [Sun, 8 Mar 2020 21:25:36 +0000 (21:25 +0000)]
arch.7: remove sparc64 references

sparc64 was removed from the tree, so remove references here (except
for the supported release table).

Sponsored by: The FreeBSD Foundation

4 years agoveloader use vectx API for kernel and modules
sjg [Sun, 8 Mar 2020 18:48:01 +0000 (18:48 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827

4 years agoveloader use vectx API for kernel and modules
sjg [Sun, 8 Mar 2020 17:42:42 +0000 (17:42 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827

4 years agoRemove the power bit from the super speed root hub port status register
hselasky [Sun, 8 Mar 2020 13:24:34 +0000 (13:24 +0000)]
Remove the power bit from the super speed root hub port status register
because it clobbers the super speed link status when a device is in super
speed mode. Currently the power bit is not needed for anything in the USB
hub driver.

This fixes USB warm reset for super speed devices.

Tested by: Shichun.Ma@dell.com
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agofd: use smr for managing struct pwd
mjg [Sun, 8 Mar 2020 00:23:36 +0000 (00:23 +0000)]
fd: use smr for managing struct pwd

This has a side effect of eliminating filedesc slock/sunlock during path
lookup, which in turn removes contention vs concurrent modifications to the fd
table.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D23889

4 years agoseqc: tidy up
mjg [Sun, 8 Mar 2020 00:22:32 +0000 (00:22 +0000)]
seqc: tidy up

- avoid hand-rolled read
- match begin/end in terms of fence style

4 years agoClean up uma_int.h a bit.
markj [Sat, 7 Mar 2020 15:37:23 +0000 (15:37 +0000)]
Clean up uma_int.h a bit.

This makes it easier to write libkvm programs that access UMA data
structures.

- Remove a couple of unused slab functions and make others local to
  uma_core.c.  Similarly move SLAB_BITSETS, which affects the layout of
  slab structures, to uma_core.c.
- Stop defining the slab structures under _KERNEL.  There's no real
  reason they can't be visible to userspace like the rest of UMA's
  structures are.
- Group KEG_ASSERT_COLD with other keg macros.
- Convert an assertion about MAXMEMDOM to use _Static_assert.

No functional change intended.

Discussed with: jeff
Reviewed by: rlibby
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23980

4 years agoMerge ^/head r358712 through r358730.
dim [Sat, 7 Mar 2020 15:09:45 +0000 (15:09 +0000)]
Merge ^/head r358712 through r358730.

4 years agoFix an issue of net.inet.igmp.stats handler.
hrs [Sat, 7 Mar 2020 08:41:10 +0000 (08:41 +0000)]
Fix an issue of net.inet.igmp.stats handler.
The header of (struct igmpstat) could be cleared by sysctl(3).
This can be reproduced by "netstat -s -z -p igmp".

PR: 244584
MFC after: 1 week

4 years agocompat: Allow explicit overriding of COMPAT_ARCH and COMPAT_CPUTYPE
jhibbits [Sat, 7 Mar 2020 03:58:58 +0000 (03:58 +0000)]
compat: Allow explicit overriding of COMPAT_ARCH and COMPAT_CPUTYPE

Summary:
Allow src.conf to override the inferred COMPAT_ARCH and COMPAT_CPUTYPE
variables, such that a different CPU target can be specified explicitly
for the general target vs the compat target.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D23992

4 years agoMove SMR pointer type definition and access macros to smr_types.h.
markj [Sat, 7 Mar 2020 00:55:46 +0000 (00:55 +0000)]
Move SMR pointer type definition and access macros to smr_types.h.

The intent is to provide a header that can be included by other headers
without introducing too much pollution.  smr.h depends on various
headers and will likely grow over time, but is less likely to be
required by system headers.

Rename SMR_TYPE_DECLARE() to SMR_POINTER():
- One might use SMR to protect more than just pointers; it
  could be used for resizeable arrays, for example, so TYPE seems too
  generic.
- It is useful to be able to define anonymous SMR-protected pointer
  types and the _DECLARE suffix makes that look wrong.

Reviewed by: jeff, mjg, rlibby
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23988

4 years agoReword a comment to describe what's actually going on. We can call invalidate
imp [Sat, 7 Mar 2020 00:29:12 +0000 (00:29 +0000)]
Reword a comment to describe what's actually going on. We can call invalidate
several times potentially. We just don't do anything on the second and
subsequent calls.

4 years agoRemove an apparently incorrect assertion.
brooks [Fri, 6 Mar 2020 23:31:09 +0000 (23:31 +0000)]
Remove an apparently incorrect assertion.

Without this change mips64 fails to boot.

Discussed with: markj
Sponsored by: DARPA

4 years agoRevert
andreast [Fri, 6 Mar 2020 23:01:49 +0000 (23:01 +0000)]
Revert

4 years agoDrop 'All rights reserved'
andreast [Fri, 6 Mar 2020 21:51:28 +0000 (21:51 +0000)]
Drop 'All rights reserved'
Replace hardcoded sizes by nitems and sizeof
Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE, I run this driver since a few
years with CTLFLAG_MPSAFE w/o issues.

4 years agoDrop 'All rights reserved'
andreast [Fri, 6 Mar 2020 21:32:42 +0000 (21:32 +0000)]
Drop 'All rights reserved'
Replace hardcoded sizes by nitems and sizeof
Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE, I run this driver since a few
years with CTLFLAG_MPSAFE w/o issues.
Add a HACK to handle a special case for a sensor location.

4 years agoDrop 'All rights reserved'
andreast [Fri, 6 Mar 2020 21:26:35 +0000 (21:26 +0000)]
Drop 'All rights reserved'
Replace hardcoded size by nitems

4 years agoDrop 'All rights reserved'
andreast [Fri, 6 Mar 2020 21:24:09 +0000 (21:24 +0000)]
Drop 'All rights reserved'
Replace hardcoded sizes by nitems and sizeof

4 years ago- Drop 'All rights reserved'
andreast [Fri, 6 Mar 2020 21:21:01 +0000 (21:21 +0000)]
- Drop 'All rights reserved'
- Replace hardcoded size by nitems

4 years agozfs dmu_read: loosen the assertion.
kib [Fri, 6 Mar 2020 21:15:25 +0000 (21:15 +0000)]
zfs dmu_read: loosen the assertion.

Since switch to the lockless grab, shared busy for ahead/behind pages
allows other threads to validate and map the pages readonly.

Reviewed by: avg, jeff, markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D23986

4 years agoRemove dead code from the powerpc uma_small_alloc().
markj [Fri, 6 Mar 2020 20:44:22 +0000 (20:44 +0000)]
Remove dead code from the powerpc uma_small_alloc().

32-bit Book-E doesn't set UMA_MD_SMALL_ALLOC, and 32-bit OEA platforms
have a 32-bit vm_paddr_t.  Moreover, this code was wrong in that it
leaked the page if the check failed.

Reviewed by: jhibbits
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23991

4 years agocxgbe/t4_tom: Do not uninitialize a toepcb that has not been initialized.
np [Fri, 6 Mar 2020 19:56:12 +0000 (19:56 +0000)]
cxgbe/t4_tom: Do not uninitialize a toepcb that has not been initialized.

This fixes the following panic:
--- trap 0xc, rip = 0xffffffff80c00411, rsp = 0xfffffe0025192840, rbp = 0xfffffe0025192860 ---
vmem_xfree() at vmem_xfree+0xd1/frame 0xfffffe0025192860
tls_uninit_toep() at tls_uninit_toep+0x78/frame 0xfffffe0025192880
free_toepcb() at free_toepcb+0x32/frame 0xfffffe00251928a0
t4_connect() at t4_connect+0x3be/frame 0xfffffe0025192950
tcp_offload_connect() at tcp_offload_connect+0xa4/frame 0xfffffe0025192990
tcp_usr_connect() at tcp_usr_connect+0xec/frame 0xfffffe00251929f0
soconnect() at soconnect+0xae/frame 0xfffffe0025192a30
kern_connectat() at kern_connectat+0xe2/frame 0xfffffe0025192a90
sys_connect() at sys_connect+0x75/frame 0xfffffe0025192ad0
amd64_syscall() at amd64_syscall+0x137/frame 0xfffffe0025192bf0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0025192bf0
--- syscall (98, FreeBSD ELF64, sys_connect), rip = 0x8008e9d8a, rsp = 0x7fffffffc0f8, rbp = 0x7fffffffc130 ---

Reviewed by: jhb@
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D23989

4 years agoUse COUNTER_U64_DEFINE_EARLY() in places where it simplifies things.
markj [Fri, 6 Mar 2020 19:10:00 +0000 (19:10 +0000)]
Use COUNTER_U64_DEFINE_EARLY() in places where it simplifies things.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23978

4 years agoAdd COUNTER_U64_SYSINIT() and COUNTER_U64_DEFINE_EARLY().
markj [Fri, 6 Mar 2020 19:09:01 +0000 (19:09 +0000)]
Add COUNTER_U64_SYSINIT() and COUNTER_U64_DEFINE_EARLY().

The aim is to reduce the boilerplate needed today to define and
initialize global counters.  Also add SI_SUB_COUNTER to the sysinit
ordering.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23977

4 years agoAdd a new "mntfs" pseudo file system which provides private device vnodes for
chs [Fri, 6 Mar 2020 18:41:37 +0000 (18:41 +0000)]
Add a new "mntfs" pseudo file system which provides private device vnodes for
file systems to safely access their disk devices, and adapt FFS to use it.
Also add a new BO_NOBUFS flag to allow enforcing that file systems using
mntfs vnodes do not accidentally use the original devfs vnode to create buffers.

Reviewed by: kib, mckusick
Approved by: imp (mentor)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23787

4 years agoreadelf: print GNU Build-ID
emaste [Fri, 6 Mar 2020 17:24:51 +0000 (17:24 +0000)]
readelf: print GNU Build-ID

Sponsored by: The FreeBSD Foundation

4 years agoMerge ^/head r358678 through r358711.
dim [Fri, 6 Mar 2020 17:11:29 +0000 (17:11 +0000)]
Merge ^/head r358678 through r358711.

4 years agoMerge commit f75939599 from llvm git (by Erich Keane):
dim [Fri, 6 Mar 2020 17:02:14 +0000 (17:02 +0000)]
Merge commit f75939599 from llvm git (by Erich Keane):

  Reland r374450 with Richard Smith's comments and test fixed.

  The behavior from the original patch has changed, since we're no
  longer allowing LLVM to just ignore the alignment.  Instead, we're
  just assuming the maximum possible alignment.

  Differential Revision: https://reviews.llvm.org/D68824

  llvm-svn: 374562

This fixes 'Assertion failed: (Alignment != 0 && "Invalid Alignment"),
function CreateAlignmentAssumption', when building recent versions of
v8, which invoke __builtin_assume_aligned() with its alignment argument
set to 4GiB or more.

Clang will now report a warning, and show the maximum possible alignment
instead, e.g.:

huge-align.cpp:1:27: warning: requested alignment must be 536870912 bytes or smaller; maximum alignment assumed [-Wbuiltin-assume-aligned-alignment]
void *f(void *g) { return __builtin_assume_aligned(g, 4294967296); }
                          ^                           ~~~~~~~~~~

Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=43839
Reported by: cem
MFC after: 3 days

4 years agoAdd more are64 special register fields
andrew [Fri, 6 Mar 2020 16:00:35 +0000 (16:00 +0000)]
Add more are64 special register fields

Obtained from: https://github.com/FreeBSD-UPB/freebsd

4 years agoreadelf: decode and print Xen ELF note strings
emaste [Fri, 6 Mar 2020 15:58:52 +0000 (15:58 +0000)]
readelf: decode and print Xen ELF note strings

Sponsored by: The FreeBSD Foundation

4 years agoreadelf: add XEN_ELFNOTE_PHYS32_ENTRY note
emaste [Fri, 6 Mar 2020 15:26:15 +0000 (15:26 +0000)]
readelf: add XEN_ELFNOTE_PHYS32_ENTRY note

See r336469 for details.

Sponsored by: The FreeBSD Foundation

4 years agoUpdate the hypervisor registers
andrew [Fri, 6 Mar 2020 14:46:50 +0000 (14:46 +0000)]
Update the hypervisor registers

 - Add more registers needed by bhyve [1]
 - Move EL2 registers from armreg.h to hypervisor.h
 - Add the register name to hypervisor.h

Obtained from: https://github.com/FreeBSD-UPB/freebsd [1]

4 years agoixl: Add missing conversions from/to LE16
luporl [Fri, 6 Mar 2020 12:37:04 +0000 (12:37 +0000)]
ixl: Add missing conversions from/to LE16

This fixes some errors on PPC64, during attach and when trying to assign an IP
to an interface.  With this change, basic operation of X710 NICs is now
possible.

This also fixes builds with IXL_DEBUG enabled

Reviewed by: erj
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23975

4 years agoDefine more subsystem orders.
hselasky [Fri, 6 Mar 2020 11:26:16 +0000 (11:26 +0000)]
Define more subsystem orders.
Intended for use with module_init_order() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix some whitespace issues in ipoib.
hselasky [Fri, 6 Mar 2020 09:59:07 +0000 (09:59 +0000)]
Fix some whitespace issues in ipoib.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd Gigabit Ethernet support for RT3883 and RT2880 Ralink/Mediatek SoCs
sgalabov [Fri, 6 Mar 2020 08:50:18 +0000 (08:50 +0000)]
Add Gigabit Ethernet support for RT3883 and RT2880 Ralink/Mediatek SoCs

Submitted by: yamori813@yahoo.co.jp
Reported by: yamori813@yahoo.co.jp
Reviewed by: sgalabov, ray
Obtained from: yamori813@yahoo.co.jp
Differential Revision: https://reviews.freebsd.org/D22618

4 years agopowerpc/memcpy: Don't predict the src and dst will be misaligned
jhibbits [Fri, 6 Mar 2020 03:46:48 +0000 (03:46 +0000)]
powerpc/memcpy: Don't predict the src and dst will be misaligned

Predicting misalignment will pessimize the expected common case.  Don't
predict true or false in thise case.

4 years agoFinish revert of r358672, missed in r358688.
jhibbits [Fri, 6 Mar 2020 02:30:04 +0000 (02:30 +0000)]
Finish revert of r358672, missed in r358688.

Manual reverts never succeed correctly.

Reported by: luporl

4 years agoFix a mistaken conditional in mfi_tbolt_send_frame()
jhibbits [Fri, 6 Mar 2020 01:50:15 +0000 (01:50 +0000)]
Fix a mistaken conditional in mfi_tbolt_send_frame()

As written, the condition of (cdb[0] != 0x28 || cdb[0] != 0x2A) will always
be true, since if it's one, it's obviously not the other.  Reading the code,
the intent appears to be that it should only perform the operation if it's
neither, otherwise the conditional can be elided.

Found by clang 10.

4 years agopowerpc/powerpc64: Enforce natural alignment in memcpy
jhibbits [Fri, 6 Mar 2020 01:45:03 +0000 (01:45 +0000)]
powerpc/powerpc64: Enforce natural alignment in memcpy

Summary:
POWER architecture CPUs (Book-S) require natural alignment for
cache-inhibited storage accesses.  Since we can't know the caching model
for a page ahead of time, always enforce natural alignment in memcpy.
This fixes a SIGBUS in X with acceleration enabled on POWER9.

As part of this, revert r358672, it's no longer necessary with this fix.

Regression tested by alfredo.

Reviewed by: alfredo
Differential Revision: https://reviews.freebsd.org/D23969

4 years agotftpd: tests: raise targeted cstd to c11
kevans [Thu, 5 Mar 2020 22:45:16 +0000 (22:45 +0000)]
tftpd: tests: raise targeted cstd to c11

r358556 added alignas() use to the functional tests, which isn't defined
until C11. Raise the -std to C11 to fix the build under freebsd-gcc{6,9}.

Reported by: mhorne, Jenkins/CI

4 years agoAlign the buffer to the alignment of the structure we expect.
glebius [Thu, 5 Mar 2020 21:01:47 +0000 (21:01 +0000)]
Align the buffer to the alignment of the structure we expect.

Submitted by: Slawa Olhovchenkov <slw zxy.spb.ru>

4 years agolibelf: rationalize error handling in ELF note conversion
emaste [Thu, 5 Mar 2020 20:53:43 +0000 (20:53 +0000)]
libelf: rationalize error handling in ELF note conversion

Previously _libelf_cvt_NOTE_tom (to host) returned false if a note's
namesz + descsz exceeded the buffer size, while _libelf_cvt_NOTE_tof
(to file) silently truncated.  Return false in the latter case too.

Sponsored by: The FreeBSD Foundation

4 years ago[aacraid] Port driver to big-endian
luporl [Thu, 5 Mar 2020 20:04:41 +0000 (20:04 +0000)]
[aacraid] Port driver to big-endian

Port aacraid driver to big-endian (BE) hosts.

The immediate goal of this change is to make it possible to use the
aacraid driver on PowerPC64 machines that have Adaptec Series 8 SAS
controllers.

Adapters supported by this driver expect FIB contents in little-endian
(LE) byte order. All FIBs have a fixed header part as well as a data
part that depends on the command being issued to the controller.

In this way, on BE hosts, the FIB header and all FIB data structures
used in aacraid.c and aacraid_cam.c need to be converted to LE before
being sent to the adapter and converted to BE when coming from it.

The functions to convert each struct are on aacraid_endian.c.
For little-endian (LE) targets, they are macros that expand
to nothing.
In some cases, when only a few fields of a large structure are used,
the fields are converted inline, by the code using them.

PR: 237463
Reviewed by: jhibbits
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23887