]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoarm64: Fix COMPAT_FREEBSD32.
Olivier Houchard [Wed, 10 Mar 2021 18:01:41 +0000 (19:01 +0100)]
arm64: Fix COMPAT_FREEBSD32.

The ENTRY() macro was modified by commit
28d945204ea1014d7de6906af8470ed8b3311335 to add an optional NOP instruction
at the beginning of the function. It is of course an arm64 instruction, so
unsuitable for the 32bits sigcode. So just use EENTRY() instead for
aarch32_sigcode. This should fix receiving signals when running 32bits
binaries on FreeBSD/arm64.

MFC After: 1 week

(cherry picked from commit c328f64d81079bad5064c8a387883df50ab5aaed)

2 years agoacpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.
Alexander Motin [Mon, 27 Dec 2021 00:37:08 +0000 (19:37 -0500)]
acpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.

MFC after: 2 weeks

(cherry picked from commit 6237a1cc2d2e3280b16cdc2d0d322fb8eedf1345)

2 years agokern: Remove CTLFLAG_NEEDGIANT from some more sysctls.
Alexander Motin [Mon, 27 Dec 2021 04:07:33 +0000 (23:07 -0500)]
kern: Remove CTLFLAG_NEEDGIANT from some more sysctls.

MFC after: 2 weeks

(cherry picked from commit c6c52d8e39b2dbee573bc80f32b5b7019cef1973)

2 years agonetgraph: Remove CTLFLAG_NEEDGIANT from sysctl.
Alexander Motin [Mon, 27 Dec 2021 00:42:53 +0000 (19:42 -0500)]
netgraph: Remove CTLFLAG_NEEDGIANT from sysctl.

MFC after: 2 weeks

(cherry picked from commit 2f1a46d12b035084cf2836043f8c1f3f23ede9c5)

2 years agosound: Remove CTLFLAG_NEEDGIANT from some sysctls.
Alexander Motin [Mon, 27 Dec 2021 01:37:55 +0000 (20:37 -0500)]
sound: Remove CTLFLAG_NEEDGIANT from some sysctls.

While there, remove some dead code.

MFC after: 2 weeks

(cherry picked from commit 3b4c5433229ac912929b77edee0b4dc001d70fe5)

2 years agoacpica: Remove CTLFLAG_NEEDGIANT from most sysctls.
Alexander Motin [Mon, 27 Dec 2021 00:17:52 +0000 (19:17 -0500)]
acpica: Remove CTLFLAG_NEEDGIANT from most sysctls.

MFC after: 2 weeks

(cherry picked from commit 3e68d2c52b4e4b0aafce2c7f6bcb8f063c6a8d55)

2 years agoBuild libclang also if LLDB is enabled
Ed Maste [Fri, 7 Jan 2022 15:34:08 +0000 (10:34 -0500)]
Build libclang also if LLDB is enabled

LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR: 260993
Reported by: eugen
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit adc88b9c01b5d7a51c896091b291afbdae42b02a)

2 years agoFix fragmented UDP packets handling since rev.360967.
Maxim Sobolev [Thu, 7 Oct 2021 20:41:40 +0000 (13:41 -0700)]
Fix fragmented UDP packets handling since rev.360967.

Consider IP_MF flag when checking length of the UDP packet to
match the declared value.

Sponsored by: Sippy Software, Inc.
Differential Revision: https://reviews.freebsd.org/D32363
MFC after: 2 weeks

(cherry picked from commit 461e6f23db3b9794e6af88b381b066a2c0463d1c)

2 years agoiwlwifi: clarifying man page update
Bjoern A. Zeeb [Sat, 1 Jan 2022 18:08:31 +0000 (18:08 +0000)]
iwlwifi: clarifying man page update

Based on some feedback clarify the man page for
- how to load the driver currently
- status of the driver with respect to iwm(4)
and leave a comment to (automatically) add a full list of chipsets
to the man page.

Sponsored by: The FreeBSD Foundation
Reviewed by: debdrup
Differential Revision: https://reviews.freebsd.org/D33713

(cherry picked from commit e9016c0be83f9b1d9cf7c2460ee3b041967bb75f)

2 years agobhyve: passthru: enable BARs before possibly mmap(2)ing them
Bjoern A. Zeeb [Thu, 23 Dec 2021 14:59:49 +0000 (14:59 +0000)]
bhyve: passthru: enable BARs before possibly mmap(2)ing them

The first time we start bhyve with a passthru device everything is fine
as on boot we do enable BARs.  If a driver (unload) inside bhyve disables
the BAR(s) as some Linux drivers do, we need to make sure we re-enable
them on next bhyve start.

If we are trying to mmap a disabled BAR for MSI-X (PCIOCBARMMAP)
the kernel will give us an EBUSY.
While we were re-enabling the BAR(s) in the current code loop
cfginit() was writing the changes out too late to the real hardware.

Move the call to init_msix_table() after the register on the real
hardware was updated.  That way the kernel will be happy and the
mmap will succeed and bhyve will start.
Also simplify the code given the last argument to init_msix_table()
is unused we do not need to do checks for each bar. [1]

Some passthru devices only support MSI instead of MSI-X. For those
devices the initialization of MSI-X table will fail. Re-add (or in
the MFC case keep) the check erroneously removed in the initial commit. [2]

PR: 260148
Pointed out by: markj [1]
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D33628
Submitted by: (C.Koehne beckhoff.com) [2]
Reviewed by: manu, bz
Differential Revision: https://reviews.freebsd.org/D33728

(cherry picked from commit f1442847c9404d4bc5f5524a0c3362dd39cb14f9)
(cherry picked from commit 338a1be836308f6d807f8bfe9b335463d537abc4)

2 years agoLinuxKPI: 802.11 fix queue wait
Bjoern A. Zeeb [Fri, 31 Dec 2021 11:47:14 +0000 (11:47 +0000)]
LinuxKPI: 802.11 fix queue wait

We are using a bandaid to wait for queues after station creation
looping and pausing.
The abort condition was looping in the wrong direction so we were
potentially waiting forever if queues never became ready.
From initial user test data we also found that the wait time was
too low in some cases so increase the length.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 500be2e803377e6fe3aa1600e6d55326bbbb4ae4)

2 years agoiwlwifi: import correct firmware versions for select Intel iwlwifi/mvm
Bjoern A. Zeeb [Fri, 31 Dec 2021 11:51:18 +0000 (11:51 +0000)]
iwlwifi: import correct firmware versions for select Intel iwlwifi/mvm

The firmware files for 3160, 7260, and 7265 imported contain old versions
no longer supported by the driver.
Replace with latest versions from linux-firmware to possibly also
support these chip revisions.

Reported by: FreeBSD User (freebsd walstatt-de.de) on wireless (2021-12-30)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 58101517cb3be0c47dba3696327e15f627765f02)

2 years agopccbb: Remove Giant mention in comments.
Alexander Motin [Sun, 26 Dec 2021 02:51:48 +0000 (21:51 -0500)]
pccbb: Remove Giant mention in comments.

MFC after: 2 weeks

(cherry picked from commit 22405bb2e45e1168d547b9238bf026b66f2d7543)

2 years agokern: Remove CTLFLAG_NEEDGIANT from some sysctls.
Alexander Motin [Sun, 26 Dec 2021 17:02:28 +0000 (12:02 -0500)]
kern: Remove CTLFLAG_NEEDGIANT from some sysctls.

MFC after: 2 weeks

(cherry picked from commit fe27f1db5f0b67ad2681a35253f7c1a4dc9874f8)

2 years agoamdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.
Alexander Motin [Sun, 26 Dec 2021 02:03:54 +0000 (21:03 -0500)]
amdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.

It seems to be needed only to serialize very old K8 registers access.
Introduce separate lock for that and remove Giant dependency.

MFC after: 2 weeks

(cherry picked from commit 6c101ed7a3f7cb47d6ac5c9e5fd33580ac8fa699)

2 years agox86: Remove CTLFLAG_NEEDGIANT from sysctls.
Alexander Motin [Sun, 26 Dec 2021 03:24:20 +0000 (22:24 -0500)]
x86: Remove CTLFLAG_NEEDGIANT from sysctls.

MFC after: 2 weeks

(cherry picked from commit 1d6fb900ed90d1fd6547e2d79da9d0259f450c2c)

2 years agouart: Remove CTLFLAG_NEEDGIANT from sysctl.
Alexander Motin [Sun, 26 Dec 2021 02:30:02 +0000 (21:30 -0500)]
uart: Remove CTLFLAG_NEEDGIANT from sysctl.

MFC after: 2 weeks

(cherry picked from commit c214c2c0049444f5ba22bc9f93546153f4a2f1d8)

2 years agohwpmc: Remove CTLFLAG_NEEDGIANT from sysctl.
Alexander Motin [Sun, 26 Dec 2021 02:40:14 +0000 (21:40 -0500)]
hwpmc: Remove CTLFLAG_NEEDGIANT from sysctl.

MFC after: 2 weeks

(cherry picked from commit 1886cef69bf270bbbe7e9a0fd2a212fc17b76204)

2 years agomountmsdosfs(): some style
Konstantin Belousov [Thu, 30 Dec 2021 19:33:41 +0000 (21:33 +0200)]
mountmsdosfs(): some style

(cherry picked from commit 04fd468da0d0baea535da418b92df74101a9659d)

2 years agoSilent some warnings for i386 kernel build
Konstantin Belousov [Thu, 6 Jan 2022 04:45:49 +0000 (06:45 +0200)]
Silent some warnings for i386 kernel build

(cherry picked from commit 3c94280825c78c0ed00e1dcc704fac8a04f933e3)

2 years agoipfilter: Make LARGE_NAT a tunable.
Cy Schubert [Tue, 16 Feb 2021 15:44:07 +0000 (07:44 -0800)]
ipfilter: Make LARGE_NAT a tunable.

LARGE_NAT is a C macro that increases
NAT_SIZE from 127 to 2047,
RDR_SIZE from 127 to 2047,
HOSTMAP_SIZE from 2047 to 8191,
NAT_TABLE_MAX from 30000 to 180000, and
NAT_TABLE_SZ from 2047 to 16383.

These values can be altered at runtime using the ipf -T command however
some adminstrators of large firewalls rebuild the kernel to enable
LARGE_NAT at boot. This revision adds the tunable net.inet.ipf.large_nat
which allows an administrator to set this option at boot instead of build
time. Setting the LARGE_NAT macro to 1 is unaffected allowing build-time
users to continue using the old way.

(cherry picked from commit a805ffbcbce85872e71d825fd405a4a30e2ab4bc)

2 years agobhyve: Map the right BAR in init_msix_table()
Mark Johnston [Tue, 4 Jan 2022 19:02:55 +0000 (14:02 -0500)]
bhyve: Map the right BAR in init_msix_table()

The PBA and MSI-X table can reside in different BARs.

Reported by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: jhb
Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 76b45e688ae84a701f52039c4d0abf8e21a3f59c)

2 years agobhyve: Correct unmapping of the MSI-X table BAR
Mark Johnston [Wed, 5 Jan 2022 15:08:13 +0000 (10:08 -0500)]
bhyve: Correct unmapping of the MSI-X table BAR

The starting address passed to mprotect was wrong, so in the case where
the last page containing the table is not the last page of the BAR, the
wrong region would be unmapped.

Reported by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: jhb
Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4558c11f1b4dfd7fd505d70b79467eb7f1193f07)

2 years agoCirrus-CI: build with LLVM 13 package
Ed Maste [Wed, 17 Nov 2021 02:42:51 +0000 (21:42 -0500)]
Cirrus-CI: build with LLVM 13 package

As of 28a41182c08e the base system uses Clang/LLVM 13.  Follow along in
Cirrus-CI (which uses a packaged toolchain for speed).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 63f44132810d2b15178503cb738866f6e8533aee)

2 years agoCirrus-CI: switch to Clang/LLVM 12
Ed Maste [Tue, 4 May 2021 19:22:25 +0000 (15:22 -0400)]
Cirrus-CI: switch to Clang/LLVM 12

dim@ is preparing to import Clang/LLVM 12 into the base system as the
system compiler / toolchain.  Apply the same change to the Cirrus-CI
config.

Reviewed by: imp, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30109

(cherry picked from commit 15c0aaf51703cc102940aa647d623ec8ffbe9259)

2 years agoCirrus-CI: report pkg version
Ed Maste [Mon, 26 Jul 2021 17:27:16 +0000 (13:27 -0400)]
Cirrus-CI: report pkg version

PR: 257422
(cherry picked from commit a077a4e3b41bb676be1237fb0af78d6814393fe7)

2 years agoctfconvert: Handle arrays of empty structs
Mark Johnston [Fri, 31 Dec 2021 17:55:01 +0000 (12:55 -0500)]
ctfconvert: Handle arrays of empty structs

Members with such a type will legitimately have a size of zero, so don't
emit a warning.

PR: 260818
Reviewed by: bz
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 963f5dc7a30624e95d72fb7f87b8892651164e46)

2 years agomips: Implement suword16
Hans Petter Selasky [Fri, 7 Jan 2022 13:30:18 +0000 (14:30 +0100)]
mips: Implement suword16

(cherry picked from commit ac672e747ff15e24ffa99f11c11f27ae305e988f)

2 years agoImplement suword16() for the 32-bit ARMv6/v7 architecture.
Hans Petter Selasky [Sun, 19 Dec 2021 11:12:58 +0000 (12:12 +0100)]
Implement suword16() for the 32-bit ARMv6/v7 architecture.

Sponsored by: NVIDIA Networking

(cherry picked from commit 516df155820471dd333a9cbc35bca3680d7b0051)
(cherry picked from commit 48014c6679024f5f1b8217508915fbcd69c2041b)

2 years agoImplement suword16() for the 32/64-bit PowerPC architecture.
Hans Petter Selasky [Sun, 19 Dec 2021 11:19:53 +0000 (12:19 +0100)]
Implement suword16() for the 32/64-bit PowerPC architecture.

Sponsored by: NVIDIA Networking

(cherry picked from commit e98efdd973560e66557f3ab46ca10376acb3c583)
(cherry picked from commit eb771bf6f496538d2f621780702200f5390ff435)

2 years agosnd_uaudio(4): Loosen up the USB MIDI permissions.
Hans Petter Selasky [Fri, 17 Dec 2021 10:52:00 +0000 (11:52 +0100)]
snd_uaudio(4): Loosen up the USB MIDI permissions.

This makes USB MIDI more userfriendly for desktop users.

PR: 260489
Sponsored by: NVIDIA Networking

(cherry picked from commit 2fcd7d380ba103060d43d6d01c1af6bb95819504)

2 years agong_ubt(4): Introduce net.bluetooth.usb_isoc_enable loader tunable to disable
Hans Petter Selasky [Tue, 7 Dec 2021 10:28:21 +0000 (11:28 +0100)]
ng_ubt(4): Introduce net.bluetooth.usb_isoc_enable loader tunable to disable
isochronous transfers.

If users want to disable isochronous transfers, which cause high
frequency periodic interrupts from the USB host controller, then
net.bluetooth.usb_isoc_enable can be set to zero, either as a
sysctl(8) or as a loader.conf(5) tunable.

Differential Revision: https://reviews.freebsd.org/D33282
Submitted by: naito.yuichiro@gmail.com
PR: 238235
Sponsored by: NVIDIA Networking

(cherry picked from commit 67cbbf19595da4565d3c8603030fdb8d33ed571e)
(cherry picked from commit 03f0393477db4c11f8dc4166fadc2628b2c15ae9)
(cherry picked from commit 8fa952937bbe44a0fdd17348adfbbfd44aef6004)

2 years agokldstat(8): style(9) fixes.
Hans Petter Selasky [Tue, 9 Nov 2021 21:09:59 +0000 (22:09 +0100)]
kldstat(8): style(9) fixes.

No functional change intended.

Differential revision:  https://reviews.freebsd.org/D32506
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 83237efcdbc183e14a27a93579e53bb571756d6a)

2 years agokldstat(8): Fix indentation, whitespace to tabs.
Hans Petter Selasky [Tue, 9 Nov 2021 21:09:54 +0000 (22:09 +0100)]
kldstat(8): Fix indentation, whitespace to tabs.

No functional change intended.

Differential revision:  https://reviews.freebsd.org/D32502
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 337c814316ef11437649cb43027468693555a5dd)

2 years agoservice(8): Fix typo in man page.
Hans Petter Selasky [Tue, 9 Nov 2021 21:09:57 +0000 (22:09 +0100)]
service(8): Fix typo in man page.

Differential revision:  https://reviews.freebsd.org/D32582
Submitted by:   christos@
Sponsored by:   NVIDIA Networking

(cherry picked from commit 66d795ec191b994f317b0ad812bb6e7943347c1f)
(cherry picked from commit 808108da324eee5d777134317c3492058d0fe964)

2 years agoecho(1): Replace errexit() with err(3)
Hans Petter Selasky [Tue, 9 Nov 2021 21:09:46 +0000 (22:09 +0100)]
echo(1): Replace errexit() with err(3)

Differential revision: https://reviews.freebsd.org/D32501
Submitted by: christos@
Sponsored by: NVIDIA Networking

(cherry picked from commit 4c537df51a16ce004b184010d306e550716f49ea)

2 years agoifconfig(8): Don't set network interface capabilities when there is no change.
Hans Petter Selasky [Tue, 9 Nov 2021 21:07:43 +0000 (22:07 +0100)]
ifconfig(8): Don't set network interface capabilities when there is no change.

A quick grep through the kernel code shows network drivers compute the
changed bits of network capabilities after a SIOCSIFCAP IOCTL(2) by
using the bitwise exclusive or operation. When the set capabilities
are equal to the already read capabilities, no action will be taken.

Let ifconfig(8) predict this case and skip the SIOCSIFCAP IOCTL(2)
system call.

Discussed with: kib@ (revert change in case of issues)
Sponsored by: NVIDIA Networking

(cherry picked from commit ad8f078f66e51212cdccd91fe8b22fb81235018e)

2 years agoRemove dead code.
Hans Petter Selasky [Mon, 20 Dec 2021 16:21:49 +0000 (17:21 +0100)]
Remove dead code.

The variable orig_resid is always set to zero right after the while loop
where it is cleared.

Reviewed by: gallatin@ and glebius@
Differential Revision: https://reviews.freebsd.org/D33589
Sponsored by: NVIDIA Networking

(cherry picked from commit f9978339d13c077975c8dce405c574ae88cbc148)

2 years agoCAM: List few missed opcodes.
Alexander Motin [Fri, 31 Dec 2021 16:46:58 +0000 (11:46 -0500)]
CAM: List few missed opcodes.

MFC after: 1 weeks

(cherry picked from commit 757089f01e3f5386d134443047fae363a8da9809)

2 years agoFix "set but not used" warnings in the mpr driver. This fixes a minor
Scott Long [Thu, 25 Nov 2021 03:28:29 +0000 (03:28 +0000)]
Fix "set but not used" warnings in the mpr driver.  This fixes a minor
bug in error handling.

(cherry picked from commit 61f17c5fd6cfaaf4fa9f543965997022488a29d5)

2 years agompr: Minor formatting changes to match mps.
Warner Losh [Tue, 16 Nov 2021 03:35:58 +0000 (20:35 -0700)]
mpr: Minor formatting changes to match mps.

Minor reformatting nits to make mprsas_scsiio_timeout match
mpssas_scsiio_timeout more closely. The differences aren't necessary and
are distracting when comparing the routines. No functional changes.

Sponsored by: Netflix

(cherry picked from commit 2bbaed4d7fcace17c619536f4119b89058ed4392)

2 years agomps(4): Fix unmatched devq release.
Warner Losh [Thu, 2 Dec 2021 20:53:44 +0000 (13:53 -0700)]
mps(4): Fix unmatched devq release.

Port 9781c28c6d63 and a8837c77efd0 to the mps driver.  Before this
change devq was frozen only if some command was sent to the target after
reset started, but release was called always.  This change freezes the
devq immediately, leaving mprsas_action_scsiio() check only to cover
race condition due to different lock devq use.

This should also avoid unnecessary requeue of the commands, creating
additional log noise and confusing some broken apps. It also avoids a
'busy' requeue of I/Os failing when we're doing recovery that takes
longer than the normal busy timeout. These I/Os failing can lead to
filesystems being unmounted in the force unmount case for I/O errors.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D33228

(cherry picked from commit a10253cffea84c0c980a36ba6776b00ed96c3e3b)

2 years agoFix "set but not used" warnings in the mps driver.
Scott Long [Thu, 25 Nov 2021 03:23:02 +0000 (03:23 +0000)]
Fix "set but not used" warnings in the mps driver.

(cherry picked from commit bcce9c5bedfafd6f0f76c022c8a1e45fa8e9fd0a)

2 years agomps: Fix debugging line
Warner Losh [Tue, 16 Nov 2021 03:31:48 +0000 (20:31 -0700)]
mps: Fix debugging line

Print cm instead of sc here, as is done in mpr. We can get the sc from
cm, but not vice versa.

Sponsored by: Netflix

(cherry picked from commit b086bc0bf1dd78b161e3ba7a5732fc49ea3c1b82)

2 years agox86: Fix up the MFC of 08161fd3b207105847bdd1dd8729ea4cbda6e537
Mark Johnston [Thu, 6 Jan 2022 14:07:45 +0000 (09:07 -0500)]
x86: Fix up the MFC of 08161fd3b207105847bdd1dd8729ea4cbda6e537

This is a direct commit to stable/13.

2 years agox86: Skip late calibration if our reference timer has low quality
Mark Johnston [Mon, 3 Jan 2022 15:14:41 +0000 (10:14 -0500)]
x86: Skip late calibration if our reference timer has low quality

Some AMD Geode-based systems end up using the 8254 PIT to calibrate the
TSC during late calibration, which doesn't work because that
timecounter's mask (65535) is much smaller than its frequency (1193182).
Moreover, early calibration is done against the 8254 timer anyway.

Work around the problem by simply using early calibration results if no
high-quality timecounters exist.

PR: 260868
Fixes: 22875f88799e ("x86: Implement deferred TSC calibration")
Reported and tested by: mike@sentex.net, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
Reviewed by: imp, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0e494a9e3fd86ef54899dcbe0268866629096c1e)

2 years agobhyve smbios type 3 structure is incorrect
Toomas Soome [Sun, 26 Dec 2021 09:01:16 +0000 (11:01 +0200)]
bhyve smbios type 3 structure is incorrect

If you look at the SMBIOS specification, we'll find something is
missing. In particular at offset 0Dh is supposed to be the OEM-defined
field. This should go between security and height. It is not legal to
actually skip this and will lead to other folks not properly
interpreting later parts of the table.

https://www.illumos.org/issues/14312

Reviewed by: jhb
Submitted by: Robert Mustacchi <rm@fingolfin.org>
Obtained from: ilumos
Differential Revision: https://reviews.freebsd.org/D33682

(cherry picked from 04f55b5b0e8f561aac100083f07df3f570880d69)

2 years agonet: iflib: sync isc_capenable to if_capenable
Vincenzo Maffione [Tue, 28 Dec 2021 10:47:13 +0000 (10:47 +0000)]
net: iflib: sync isc_capenable to if_capenable

On SIOCSIFCAP, some bits in ifp->if_capenable may be toggled.
When this happens, apply the same change to isc_capenable, which
is the iflib private copy of if_capenable (for a subset of the
IFCAP_* bits). In this way the iflib drivers can check the bits
using isc_capenable rather than if_capenable. This is convenient
because the latter access requires an additional indirection
through the ifp, and it is also less likely to be in cache.

PR: 260068
Reviewed by: kbowling, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33156

(cherry picked from commit 4561c4f0ca59da5b704238074bd488ff907b4b50)

2 years agopkgbase: Add a FreeBSD-pkg-bootstrap package
Emmanuel Vadot [Wed, 15 Dec 2021 14:19:46 +0000 (15:19 +0100)]
pkgbase: Add a FreeBSD-pkg-bootstrap package

And put pkg and its keys in it.
It's easier for small image to depend on this package rather than the
larger utilities one.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33458

(cherry picked from commit ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)

2 years agopkgbase: Create a FreeBSD-fetch package
Emmanuel Vadot [Wed, 15 Dec 2021 11:00:47 +0000 (12:00 +0100)]
pkgbase: Create a FreeBSD-fetch package

It's useful for small image to fetch some data but we don't want to
install utilities nor bloat runtime.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33463

(cherry picked from commit 13ef8134efd1c0a39c2dab0197b5c4558101253e)

2 years agopkgbase: Put certctl in the FreeBSD-caroot package
Emmanuel Vadot [Wed, 15 Dec 2021 10:38:18 +0000 (11:38 +0100)]
pkgbase: Put certctl in the FreeBSD-caroot package

There is no reason that this shouldn't be there.
Change the dependency of caroot from utilities to openssl as it's
the only command that it uses not in runtime.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33458

(cherry picked from commit 380073af3aa3048e3e19abe57e64bff4481d829f)

2 years agopkgbase: Create a FreeBSD-newsyslog package
Emmanuel Vadot [Wed, 15 Dec 2021 09:46:00 +0000 (10:46 +0100)]
pkgbase: Create a FreeBSD-newsyslog package

This allow one to install it without having to install FreeBSD-utilities.
While here put some newsyslog.d file in their own package.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33456

(cherry picked from commit 26ea904caae7e6be8394eb8ca94f282d99f63c8c)

2 years agopkgbase: Create a FreeBSD-syslogd package
Emmanuel Vadot [Wed, 15 Dec 2021 09:34:00 +0000 (10:34 +0100)]
pkgbase: Create a FreeBSD-syslogd package

This allow one to not install syslogd and use syslog-ng or any other
syslog daemon.
While here put some syslog.d file in their own package.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33455

(cherry picked from commit 25367c806be5b321b6c7b2fd6bee264b99f240da)

2 years agopkgbase: Create a FreeBSD-periodic package
Emmanuel Vadot [Wed, 15 Dec 2021 09:08:20 +0000 (10:08 +0100)]
pkgbase: Create a FreeBSD-periodic package

While here put the periodic files for some utilities in their own
packages.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33454

(cherry picked from commit b3d14eaccc5f606690d99b1998bfdf32a22404f6)

2 years agopkgbase: Create a FreeBSD-ftpd package
Emmanuel Vadot [Wed, 15 Dec 2021 08:53:54 +0000 (09:53 +0100)]
pkgbase: Create a FreeBSD-ftpd package

And put ftpd into it.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33453

(cherry picked from commit 20cd6e315e05a76ee0b745a029ebfd4a79d98e55)

2 years agopkgbase: Create a FreeBSD-mtree package
Emmanuel Vadot [Tue, 14 Dec 2021 16:19:30 +0000 (17:19 +0100)]
pkgbase: Create a FreeBSD-mtree package

And put the mtree binary and files in it.
Useful to create small mfsroot using /etc/rc.d/var without
having to install FreeBSD-utilities.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33442

(cherry picked from commit dcf9d46a3fb8176651abd64afe17ad323fc318ea)

2 years agopkgbase: Create a FreeBSD-tcpd package
Emmanuel Vadot [Tue, 14 Dec 2021 15:42:46 +0000 (16:42 +0100)]
pkgbase: Create a FreeBSD-tcpd package

And put the tcp-wrapper utilities in it.

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33439

(cherry picked from commit 078b764da3a12c354b331764c6b86886f2464960)

2 years agopkgbase: Remove vital flags for FreeBSD-utilities
Emmanuel Vadot [Wed, 29 Sep 2021 16:07:06 +0000 (18:07 +0200)]
pkgbase: Remove vital flags for FreeBSD-utilities

Per the pkg-descr: "Non-vital programs and librairies"

Reviewed by: emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33436

(cherry picked from commit 3ea43eff0554aad3f1c973d9078549e625168908)

2 years agopkgbase: Put more binaries/lib in runtime
Emmanuel Vadot [Tue, 14 Dec 2021 14:31:30 +0000 (15:31 +0100)]
pkgbase: Put more binaries/lib in runtime

Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33435

(cherry picked from commit 93c43690960274dd3bb67b1ee0f1dd3ca4d13def)

2 years agopkgbase: Put autofs config files in the FreeBSD-autofs package
Emmanuel Vadot [Wed, 29 Sep 2021 06:42:09 +0000 (08:42 +0200)]
pkgbase: Put autofs config files in the FreeBSD-autofs package

Reviewed by: emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33434

(cherry picked from commit eb14f050a39f7f71110535ad260fb8df5eef068c)

2 years agopkgbase: Put yellow pages programs to its own package
Emmanuel Vadot [Tue, 28 Sep 2021 09:49:50 +0000 (11:49 +0200)]
pkgbase: Put yellow pages programs to its own package

YP is less and less used, split them to users have the choice to not
install them.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1ff471b45ac4f49ace2b79cc57d7c3c)

2 years agopkgbase: Put sconfig in FreeBSD-utilities
Emmanuel Vadot [Tue, 21 Dec 2021 09:16:08 +0000 (10:16 +0100)]
pkgbase: Put sconfig in FreeBSD-utilities

There is no need to have it in runtime as it's not essential.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 0855e37c72c7904600967ff4268ef69505eb4f4e)

2 years agopkgbase: Move back mlxcontrol in the default package
Emmanuel Vadot [Thu, 9 Sep 2021 06:14:53 +0000 (08:14 +0200)]
pkgbase: Move back mlxcontrol in the default package

mlxcontrol(8) is a tool for mlx(4) raid card and isn't related to
Mellanox card.

Reported by: jhb

(cherry picked from commit 06cce53d5623c1106a54caee28791ed3994df23f)

2 years agopkgbase: Create a FreeBSD-ftp package
Emmanuel Vadot [Thu, 2 Sep 2021 15:14:20 +0000 (17:14 +0200)]
pkgbase: Create a FreeBSD-ftp package

ftp tools aren't that useful nowadays but some might want them.
Create a FreeBSD-ftp package so users have a choice to have
them or not.

Differential Revision: https://reviews.freebsd.org/D31794

(cherry picked from commit b5be5c35dbaf38caaa9c70a83025f3535abbfd4f)

2 years agopkgbase: Create a FreeBSD-hyperv package
Emmanuel Vadot [Thu, 2 Sep 2021 15:13:45 +0000 (17:13 +0200)]
pkgbase: Create a FreeBSD-hyperv package

Put all hyperv utilities in it.

Differential Revision:  https://reviews.freebsd.org/D31805

(cherry picked from commit db953e8b97756df2d6907408388952bcc301c762)

2 years agopkgbase: Remove libefivar package and add a efi-tools one
Emmanuel Vadot [Thu, 2 Sep 2021 15:12:51 +0000 (17:12 +0200)]
pkgbase: Remove libefivar package and add a efi-tools one

Put all the efi related tools into FreeBSD-efi-tools.

Differential Revision: https://reviews.freebsd.org/D31803

(cherry picked from commit d8d41d3b842980e7b76c8f3081ed8b571af97e0c)

2 years agopkgbase: Create a FreeBSD-kerberos package
Emmanuel Vadot [Thu, 2 Sep 2021 04:09:15 +0000 (06:09 +0200)]
pkgbase: Create a FreeBSD-kerberos package

This allows users to install or not kerberos related utilities
and libs.

Differential Revision: https://reviews.freebsd.org/D31801

(cherry picked from commit a30235a4c360c06bb57be1f10ae6866a71fb5622)

2 years agopkgbase: Put libbsdxml in FreeBSD-runtime
Emmanuel Vadot [Wed, 1 Sep 2021 18:25:50 +0000 (20:25 +0200)]
pkgbase: Put libbsdxml in FreeBSD-runtime

libbsdxml is used by a lot of programs so just put it in FreeBSD-runtime.

Differential Revision: https://reviews.freebsd.org/D31800
Reviewed by: emaste

(cherry picked from commit 30975efbaff0a021545e81bd9fa09d848edfaafa)

2 years agopkgbase: Create a FreeBSD-rdma package
Emmanuel Vadot [Wed, 1 Sep 2021 18:23:56 +0000 (20:23 +0200)]
pkgbase: Create a FreeBSD-rdma package

Put all the rdma related tools into this package.

Differential Revision:  https://reviews.freebsd.org/D31799

(cherry picked from commit cab6a39d7b343596a5823e65c0f7b426551ec22d)

2 years agopkgbase: Create a syscons-data package
Emmanuel Vadot [Wed, 1 Sep 2021 17:58:27 +0000 (19:58 +0200)]
pkgbase: Create a syscons-data package

syscons is mostly deprecated and all it's files aren't needed for most
users so create a separate package for them.

Differential Revision:    https://reviews.freebsd.org/D31798
Reviewed by: emaste

(cherry picked from commit 27a7ae0ce00fbd6ab6e76e6dd3c51eadefff6f12)

2 years agopkgbase: Create a vt-data package
Emmanuel Vadot [Wed, 1 Sep 2021 17:56:55 +0000 (19:56 +0200)]
pkgbase: Create a vt-data package

vt files for either keyboards and fonts are totally optional
so create a separate package for them.

Differential Revision:      https://reviews.freebsd.org/D31797

(cherry picked from commit 88ba5e8955518c1e032eafbce27d548eaf5a59ea)

2 years agopkgbase: Create a FreeBSD-dwatch package
Emmanuel Vadot [Wed, 1 Sep 2021 17:38:40 +0000 (19:38 +0200)]
pkgbase: Create a FreeBSD-dwatch package

While dwatch is useful some users might not want it by default.
Create a package for it.

Differential Revision: https://reviews.freebsd.org/D31796

(cherry picked from commit a3266ba2697a383d2ede56803320d941866c7e76)

2 years agopkgbase: Create a mlx-tools package
Emmanuel Vadot [Wed, 1 Sep 2021 17:12:09 +0000 (19:12 +0200)]
pkgbase: Create a mlx-tools package

mlx* are only useful for users who have a Mellanox card.
Create a package for it so users that don't have this card can
avoid having this program.

Differential Revision: https://reviews.freebsd.org/D31795

(cherry picked from commit 80645e1ce5574ce4d63f0a1cad287949440384da)

2 years agopkgbase: Create a cxgbe-tools package
Emmanuel Vadot [Wed, 1 Sep 2021 17:08:49 +0000 (19:08 +0200)]
pkgbase: Create a cxgbe-tools package

cxgbetool is only useful for users who have a Chelsio card.
Create a package for it so users that don't have this card can
avoid having this program.

Differential Revision: https://reviews.freebsd.org/D31793

(cherry picked from commit b8876cac2d230098b902e7f927ef170312a06c03)

2 years agopkgbase: Move spppcontrol to FreeBSD-ppp
Emmanuel Vadot [Wed, 1 Sep 2021 17:03:38 +0000 (19:03 +0200)]
pkgbase: Move spppcontrol to FreeBSD-ppp

This program belong with the other ppp-related programs.

Differential Revision:  https://reviews.freebsd.org/D31792
Reviewed by: emaste

(cherry picked from commit 0818f499bc28835c7db6df80d9aa5cc3dc99b2d9)

2 years agopkgbase: Create a FreeBSD-telnet package
Emmanuel Vadot [Wed, 1 Sep 2021 17:02:00 +0000 (19:02 +0200)]
pkgbase: Create a FreeBSD-telnet package

both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision: https://reviews.freebsd.org/D31791
Reviewed by: emaste

(cherry picked from commit c7fd29f0f29ae3eb9d86cc019f6c1bab35634548)

2 years agopkgbase: Remove FreeBSD-libregex package
Emmanuel Vadot [Thu, 2 Sep 2021 06:14:56 +0000 (08:14 +0200)]
pkgbase: Remove FreeBSD-libregex package

The only user of libregex is grep (and its variation), no need for a
dedicated package.
This moves libregex to the default package (FreeBSD-utilities).

Differential Revision: https://reviews.freebsd.org/D31802

(cherry picked from commit dfa9131d709121b2e502a82ff66cf3e376654942)

2 years agopkgbase: Create a FreeBSD-ggate package
Emmanuel Vadot [Wed, 1 Sep 2021 15:16:07 +0000 (17:16 +0200)]
pkgbase: Create a FreeBSD-ggate package

Move ggate* to it.

Differential Revision: https://reviews.freebsd.org/D31790

(cherry picked from commit d22072a7d5e671ca0883b93165e374d5f396e0f9)

2 years agopkgbase: Remove package name mangling in generate-ucl.sh
Mark Johnston [Mon, 26 Apr 2021 19:15:31 +0000 (15:15 -0400)]
pkgbase: Remove package name mangling in generate-ucl.sh

The mangling was present in the initial revision of the script, but its
purpose is not clear.  It may have been to avoid defining make(1)
variables with a dash in the name, but this is permitted.  Furthermore,
it results in invalid dependency information if a dependency's name
contains an underscore, causing e.g., libcompiler_rt-dev to depend on
libcompiler-rt, and resulting in warnings when installing base system
packages.  Remove the mangling.

Reviewed by: manu
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29883

(cherry picked from commit 09d83a060f37ba17b29c0e90f3a0e9aa9c735592)

2 years agolibrtld_db: Handle shlibs with discontiguous mappings.
Chuck Silvers [Fri, 3 Dec 2021 19:03:32 +0000 (11:03 -0800)]
librtld_db: Handle shlibs with discontiguous mappings.

Some shared libraries specify mappings that leave a gap (actually a
MAP_GUARD mapping) in between the file mappings (libcrypto.so was
the one I found), and this would cause rd_loadobj_iter() to report
the mapping info incorrectly, leaving out rdl_path and misreporting
rdl_offset for file mappings after the gap.  Fix rd_loadobj_iter()
to handle this situation.

Reviewed by: markj
Sponsored by: Netflix

(cherry picked from commit dfd00261c95a9839ba528f7e052d9bcac19f2b14)

2 years agotcp_bbr(4): Fix a few typos in sysctl descriptions
Gordon Bergling [Sun, 2 Jan 2022 17:03:10 +0000 (18:03 +0100)]
tcp_bbr(4): Fix a few typos in sysctl descriptions

- s/measurment/measurement/

(cherry picked from commit 1b90dfa5d2b01549b51d9829206acac39a432bbb)

2 years agoreadelf: add Go Build ID ELF note support
Ed Maste [Fri, 10 Dec 2021 20:11:45 +0000 (15:11 -0500)]
readelf: add Go Build ID ELF note support

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33379

(cherry picked from commit ca457394fccfc7d712cd9cc6a66e574767a0a32b)

2 years agoar: deprecate -T option
Ed Maste [Wed, 29 Dec 2021 19:59:06 +0000 (14:59 -0500)]
ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR: 260523 [exp-run]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit edadbb46065d9ee9559140b2522197fcdba57064)

2 years agoCheck cpu_softc is not NULL before dereferencing
Andrew Turner [Mon, 27 Sep 2021 11:22:15 +0000 (12:22 +0100)]
Check cpu_softc is not NULL before dereferencing

In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g.
on arm64 when booting from FDT. Check it is not NULL at the start of
the function so we don't try to dereference a NULL pointer.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4e50efb1944bffe6ae648c8c81bd0814c18474b9)

2 years agoamdtemp: Revert related part of "Make CPU children" commit.
Alexander Motin [Wed, 1 Dec 2021 18:00:17 +0000 (13:00 -0500)]
amdtemp: Revert related part of "Make CPU children" commit.

While it still looks like previous code worked by coincidence, this
change broke things even more instead of fixing.

Reported by: avg@
MFC after: 1 week

(cherry picked from commit 94a72c5ac4285b2940e5d2c7e53d21c84023defc)

2 years agoacpi_cpu: Fix panic if some CPU devices are disabled.
Alexander Motin [Sat, 25 Sep 2021 20:54:28 +0000 (16:54 -0400)]
acpi_cpu: Fix panic if some CPU devices are disabled.

While there, remove couple unneeded global variables.

(cherry picked from commit 695323ae88c71776e131940ed7dedd25365e932f)

2 years agoMake CPU children explicitly share parent unit numbers.
Alexander Motin [Sat, 25 Sep 2021 03:25:46 +0000 (23:25 -0400)]
Make CPU children explicitly share parent unit numbers.

Before this device unit number match was coincidental and broke if I
disabled some CPU device(s).  Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.

(cherry picked from commit d3a8f98acbf51e728411f10c5f179a30b9ca683c)

2 years agoacpi_cpu: Make device unit numbers match OS CPU IDs.
Alexander Motin [Sat, 25 Sep 2021 01:03:02 +0000 (21:03 -0400)]
acpi_cpu: Make device unit numbers match OS CPU IDs.

There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).

(cherry picked from commit c8077ccd70cfcbcccb752e89b848f098abcb9309)

2 years agobus: Cleanup device_probe_child()
Alexander Motin [Sat, 25 Sep 2021 00:27:10 +0000 (20:27 -0400)]
bus: Cleanup device_probe_child()

When device driver probe method returns 0, i.e. absolute priority, do
not remove its class from the device just to set it back few lines
later, that may change the device unit number, etc. and after which
we'd better call the probe again.

If during search we found some driver with absolute priority, we do
not need to set device driver and class since we haven't removed them
before.

It should not happen, but if second probe method call failed, remove
the driver and possibly the class from the device as it was when we
started.

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D32125

(cherry picked from commit f73c2bbf811ba77b2fe91b5bc0cbe19e9f7eb6c4)

2 years agobus: Fix LINT / BUS_DEBUG build
Warner Losh [Fri, 24 Sep 2021 20:03:10 +0000 (14:03 -0600)]
bus: Fix LINT / BUS_DEBUG build

Fix 0389e9be63c5e for LINT built. Removed an arg only from code
under BUS_DEBUG w/o rebuilding LINT...

Sponsored by: Netflix
Fixes: 0389e9be63c5e24ecedbb366c5682ddc2ff4de60
(cherry picked from commit 67a9e76da6e69ceee94a3b9c0fd490ed2f781938)

2 years agobus: retire DF_REBID
Warner Losh [Fri, 24 Sep 2021 18:10:18 +0000 (12:10 -0600)]
bus: retire DF_REBID

I did DF_REBID to allow for 'hoover' drivers that would attach to
otherwise unattached devices in the tree. This notion didn't catch on as
it was tricky to make work well and it was easier to just publish a /dev
node of some flavor by the parent device. It's been nothing but dead
weight for a long time.

Reviewed by: mav
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32056

(cherry picked from commit 0389e9be63c5e24ecedbb366c5682ddc2ff4de60)

2 years agoAllow ddb and dtrace use the DMAP region on arm64
Andrew Turner [Tue, 21 Sep 2021 17:10:57 +0000 (17:10 +0000)]
Allow ddb and dtrace use the DMAP region on arm64

When writing to memory on arm64 we may be trying to be accessing a
read-only page. In this case try to access via the DMAP region to
get a writable location.

While here simplify writing data in DDB and stop trashing the size as
it is passed into the cache handling functions.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32053

(cherry picked from commit 3d2533f5c29fbf6e63c5e408ba13c2294a7612fd)

2 years agoAdd atomic_testandset_acq_* on arm64
Andrew Turner [Mon, 20 Dec 2021 13:49:59 +0000 (13:49 +0000)]
Add atomic_testandset_acq_* on arm64

We only need to include sys/_atomic_subword.h on arm64 to provide
atomic_testandset_acq_long. Add an implementation in the arm64 atomic.h
based on the existing atomic_testandset macro.

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

(cherry picked from commit 02c16e2174baa756997600a8139f19f218da0a8f)

2 years agoAdd an loader command on arm64 to sync the cache
Andrew Turner [Mon, 20 Dec 2021 13:42:15 +0000 (13:42 +0000)]
Add an loader command on arm64 to sync the cache

On boot we don't need to perform any CPU cache management when the IDC
and DIC fields in the ctr_el0 register are set. Add a command to tell
loader to ignore these fields. This could be useful, for example, if the
hardware is misreporting the values and we are missing a quirk to enable
it.

It is not expected this will be needed, but is only intended as a
workaround to ensure the kernel can still boot.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c399283c71e310e1573e8d27f9cb9d27a4ea3376)

2 years agoDon't sync the I/D caches when they are coherent
Andrew Turner [Fri, 17 Dec 2021 09:33:57 +0000 (09:33 +0000)]
Don't sync the I/D caches when they are coherent

In the arm64 loader we need to syncronise the I and D caches. On some
newer CPUs the I and D caches are coherent so we don't need to perform
these operations.

While here remove the arguments to cpu_inval_icache as they are unneeded.

Reported by: cperciva
Tested by: cperciva
Sponsored by: Innovate UK

(cherry picked from commit c1381f07f61a66979f1569995f37f2a0413c0413)

2 years agoocs_fc: Add lancer G7 to the supported hardware in the man page.
Ram Kishore Vegesna [Fri, 24 Dec 2021 07:24:27 +0000 (12:54 +0530)]
ocs_fc: Add lancer G7 to the supported hardware in the man page.

Reviewed by: mav
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33668

(cherry picked from commit f5e24f24c7cc217dbe328c1181b568b893da5dd1)

ocs_fc: Updated man page date.

MFC after: 3 days

(cherry picked from commit 99948907e3cbe58c2e3e27b19c79793db9b21ca0)

2 years agowpa: Import wpa_supplicant/hostapd commit 14ab4a816
Cy Schubert [Thu, 2 Dec 2021 23:00:32 +0000 (15:00 -0800)]
wpa: Import wpa_supplicant/hostapd commit 14ab4a816

This is the November update to vendor/wpa committed upstream 2021-11-26.

(cherry picked from commit 4b72b91a7132df1f77bbae194e1071ac621f1edb)

2 years agontp: Revert "Disable stack gap for ntpd during build."
Cy Schubert [Mon, 16 Aug 2021 14:46:31 +0000 (07:46 -0700)]
ntp: Revert "Disable stack gap for ntpd during build."

This reverts commit af949c590bd8a00a5973b5875d7e0fa6832ea64a because
889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 fixes the underlying problem.

(cherry picked from commit 733a832fb515ef9ebf9d584896962fd28e714d0b)

2 years agontp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV."
Cy Schubert [Mon, 16 Aug 2021 15:05:50 +0000 (08:05 -0700)]
ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV."

This reverts commit 55263180628a386ad38b4b6621919220b137f770 because the
underlying problem was fixed by 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021.

(cherry picked from commit fc393054398ea50fb0cee52704e9385afe888b48)

2 years agotests/libalias: Portrange
Lutz Donnerhacke [Sat, 3 Jul 2021 22:28:20 +0000 (00:28 +0200)]
tests/libalias: Portrange

Test ranges of allowed ports for aliasing.
 - Explicit default like ipfw(8) is doing
 - Regular range
 - Exhausting a very small range
 - Recovery

Includes a fix of an utility macro, which was not used before.

Differential Revision: https://reviews.freebsd.org/D31012

(cherry picked from commit 2c733b50c5a99cbe4f6eef437e1e3efd720ba306)