]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoExtend r358907 to explicitly remove stale lib32 dependency
Ed Maste [Thu, 12 Mar 2020 13:42:08 +0000 (13:42 +0000)]
Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved.  A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation

4 years agoEnable ixl device on PowerPC64
Leandro Lupori [Thu, 12 Mar 2020 12:47:10 +0000 (12:47 +0000)]
Enable ixl device on PowerPC64

The ixl driver now works on PowerPC64 and may be compiled in-kernel and
as a module.

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

4 years agoAllow -DNO_CLEAN build across r358851.
Dimitry Andric [Thu, 12 Mar 2020 11:39:04 +0000 (11:39 +0000)]
Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly.  Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agotest if port does exist via using scratch register
Toomas Soome [Thu, 12 Mar 2020 06:45:08 +0000 (06:45 +0000)]
test if port does exist via using scratch register

The SCR, scratch register was not present on the 8250 and 8250B UART, so we
can use to test if we actually do have serial port.

We need this test because some systems will get long delays while attempting
to write to non-existing port and this will slow down the console IO
to extreme.

MFC after: 1 week

4 years agostyle(9): Fix space after #define.
Pedro F. Giffuni [Thu, 12 Mar 2020 03:56:54 +0000 (03:56 +0000)]
style(9): Fix space after #define.

No functional change.

4 years agoFix r358688 -- Remember to actually save r3 before processing.
Brandon Bergren [Wed, 11 Mar 2020 23:34:44 +0000 (23:34 +0000)]
Fix r358688 -- Remember to actually save r3 before processing.

Crash was noticed by pkubaj building gcc9.

Apparently non dword-aligned char pointers are somewhat rare in the wild.

Reported by: pkubaj
Sponsored by: Tag1 Consulting, Inc.

4 years agoCheck for busy or wired in vm_page_relookup(). Some callers will only keep
Jeff Roberson [Wed, 11 Mar 2020 22:25:45 +0000 (22:25 +0000)]
Check for busy or wired in vm_page_relookup().  Some callers will only keep
a page wired and expect it to still be present.

Reported by: delphij@FreeBSD.org
Reviewed by: kib

4 years agoWhen mounting a UFS filesystem, return EINTEGRITY rather than EIO
Kirk McKusick [Wed, 11 Mar 2020 21:00:40 +0000 (21:00 +0000)]
When mounting a UFS filesystem, return EINTEGRITY rather than EIO
when a superblock check-hash error is detected. This change clarifies
a mount that failed due to media hardware failures (EIO) from a mount
that failed due to media errors (EINTEGRITY) that can be corrected by
running fsck(8).

Sponsored by: Netflix

4 years agoarch.7: remove extraneous markup from header table sizing
Ed Maste [Wed, 11 Mar 2020 20:40:24 +0000 (20:40 +0000)]
arch.7: remove extraneous markup from header table sizing

Reported by: 0mp (in response to r358891)

4 years agoCorrectly spell TUNABLES.
Bjoern A. Zeeb [Wed, 11 Mar 2020 20:23:36 +0000 (20:23 +0000)]
Correctly spell TUNABLES.

4 years agowmt(4): Reapply r358872 (by hselasky) modified to use
Vladimir Kondratyev [Wed, 11 Mar 2020 20:05:49 +0000 (20:05 +0000)]
wmt(4): Reapply r358872 (by hselasky) modified to use
maximal input report size instead of wMaxPacketSize.

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 maximal input report size as buffer size instead.

PR: 244718
Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf
MFC after: 3 days
Discussed with: hselasky

4 years agoRemove extra Sy from table header
Ed Maste [Wed, 11 Mar 2020 20:05:06 +0000 (20:05 +0000)]
Remove extra Sy from table header

Reported by: 0mp

4 years agowmt(4): revert r358872 (by hselasky)
Vladimir Kondratyev [Wed, 11 Mar 2020 19:57:43 +0000 (19:57 +0000)]
wmt(4): revert r358872 (by hselasky)

Limiting frame size to maximum packet size breaks devices which have input
report size larger than wMaxPacketSize. Maximal input report size should be
used instead.
Revert the commit as it have not been MFC-ed yet.

Discussed with: hselasky

4 years agoelf.5: start documenting ELF note sections
Ed Maste [Wed, 11 Mar 2020 18:15:18 +0000 (18:15 +0000)]
elf.5: start documenting ELF note sections

I intend to document FreeBSD's ELF notes (see review D23982), but start
with a section documenting the format of the note section itself.

Sponsored by: The FreeBSD Foundation

4 years agoRemove redundantly repetitive static __inline forward function
Warner Losh [Wed, 11 Mar 2020 15:12:31 +0000 (15:12 +0000)]
Remove redundantly repetitive static __inline forward function
declarations.

We typically don't use them elsewhere in the kernel, and they aren't
needed here: the actual functions are a few lines away and aren't
mutually recursive.

4 years agoelfctl: remove memory leak
Ed Maste [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
Li-Wen Hsu [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
Li-Wen Hsu [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
Hans Petter Selasky [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.
Alexander V. Chernikov [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
Alan Somers [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()
Warner Losh [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.
Warner Losh [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
Warner Losh [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Navdeep Parhar [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
Navdeep Parhar [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().
Alexander V. Chernikov [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
Dimitry Andric [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.
Konstantin Belousov [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.
Konstantin Belousov [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.
Dimitry Andric [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.
Alexander V. Chernikov [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
Li-Wen Hsu [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
Dimitry Andric [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.
Dimitry Andric [Tue, 10 Mar 2020 17:49:09 +0000 (17:49 +0000)]
Merge ^/head r358832 through r358848.

4 years agoUntangle TPR shadowing and APIC virtualization.
Michael Reifenberger [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.
Hans Petter Selasky [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
Hans Petter Selasky [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
Ed Maste [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.
Dimitry Andric [Tue, 10 Mar 2020 07:05:04 +0000 (07:05 +0000)]
Set tentative dates.

4 years agoMerge ^/head r358731 through r358831.
Dimitry Andric [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.
Dimitry Andric [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
Kristof Provost [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
Kristof Provost [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
Justin Hibbits [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.
Konstantin Belousov [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.
Konstantin Belousov [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.
Konstantin Belousov [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
Vladimir Kondratyev [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
Ed Maste [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
Ed Maste [Mon, 9 Mar 2020 20:49:06 +0000 (20:49 +0000)]
Remove WITH_AMD option, missed in r358821

4 years agoretire amd(8)
Ed Maste [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
Vladimir Kondratyev [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.
Vladimir Kondratyev [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
Vladimir Kondratyev [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.
Konstantin Belousov [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
Toomas Soome [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
Leandro Lupori [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
Simon J. Gerraty [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.
Chuck Silvers [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
Simon J. Gerraty [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
Andrew 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.
Michal Meloun [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 Paeps [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.
Emmanuel Vadot [Mon, 9 Mar 2020 03:34:16 +0000 (03:34 +0000)]
cpufreq: Unbreak build.

4 years agocpufreq_dt: Fix r358555
Emmanuel Vadot [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
Alan Somers [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
Alan Somers [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
Ed Maste [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
Ed Maste [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
Simon J. Gerraty [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
Simon J. Gerraty [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
Hans Petter Selasky [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
Mateusz Guzik [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
Mateusz Guzik [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.
Mark Johnston [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.
Dimitry Andric [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.
Hiroki Sato [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
Justin Hibbits [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.
Mark Johnston [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
Warner Losh [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 Davis [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
Andreas Tobler [Fri, 6 Mar 2020 23:01:49 +0000 (23:01 +0000)]
Revert

4 years agoDrop 'All rights reserved'
Andreas Tobler [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'
Andreas Tobler [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'
Andreas Tobler [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'
Andreas Tobler [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'
Andreas Tobler [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.
Konstantin Belousov [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().
Mark Johnston [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.
Navdeep Parhar [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.
Mark Johnston [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().
Mark Johnston [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
Chuck Silvers [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
Ed Maste [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.
Dimitry Andric [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):
Dimitry Andric [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 Turner [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