FreeBSD git weekly: 2026-06-15 to 2026-06-21

Introduction

This is a display of mostly-automatically-classified git commits from 2026-06-15 to 2026-06-21.

Table of contents and commits per category:

(3) Highlighted commits (these are copies, not in stats)
0 0.0% Userland programs
10 5.0% Documentation
70 35.2% Hardware support
10 5.0% Networking
15 7.5% System administration
8 4.0% Libraries
5 2.5% Filesystems
59 29.6% Kernel
5 2.5% Build system
1 0.5% Internal organizational stuff
7 3.5% Testing
5 2.5% Style, typos, and comments
2 1.0% Contrib code
2 1.0% Reverted commits
0 0.0% Unclassified commits
199 100% total
Technical notes about this page

Highlighted commits

For extra visibility, these are copies of commits found in other sections. Most (if not all) come from the commit message containing "Relnotes:", or commits modifying UPDATING.

sound: Create all device nodes with GID_AUDIO
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Christos Margiolis 2026-05-21 18:03:31
powerpc64le: switch long double to IEEE binary128
Change powerpc64le's long double from 64-bit double to IEEE 754
binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64.

Gated on FreeBSD 16 and powerpc64le only.

Differential Revision: https://reviews.freebsd.org/D57388
Reviewed by:    adrian
Relnotes:       yes
255538cd906045095d0c2113ae6c4731ce36c0cf Piotr Kubaj 2026-06-15 15:37:26
Source upgrade doc: etcupdate no longer needs -B
Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
704db3fe9840ee3e51b080b7c35defd1a74c0c2d Alexander Ziaee 2026-06-21 17:54:12

Userland programs

Commits about commands found in man section 1 (other than networking).

-- no commits in this category this week --

Documentation

Man pages, release notes, etc.

groups.7: Document audio group
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
7f2d790824692b16ab2bf64a9b1e176f192cf319 Christos Margiolis 2026-05-21 18:42:25
symlink.7: Clean up markup and tag SPDX
Also unwind some parentheticals.

MFC after:      3 days
e821152cc71dbd09f5bd28be86499165c553f3ae Alexander Ziaee 2026-06-12 15:47:54
loader.efi.8: hw.uart.console is explained in uart
a641aa1c80f80e44cd9212b95e6584db9533712c Caleb Harper 2026-06-15 22:51:05
Commit group #0: sh: Improve function documentation
sh: Improve function documentation

* Mention that the function body can be in parentheses.  It is already
  implied since the function body can be any valid statement, but it may
  not be obvious to a reader who has only ever seen functions that used
  curly brackets and assumes that they are part of the function syntax.

* Remove the incorrect claim that a local statement may only occur at
  the top of a function.

* Show that a value may be assigned to a variable in a local statement.

* While here, replace unpaired double quotes with \(dq to avoid
  confusing syntax highlighters.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296050
MFC after:      1 week
Reviewed by:    ziaee, jilles
Differential Revision:  https://reviews.freebsd.org/D57596
556e793d803e12e9ad9361c6c53ed0433151f41e Dag-Erling Smørgrav 2026-06-16 20:23:18

sh: Belatedly bump manual page date

Fixes:          https://cgit.freebsd.org/src/commit/?id=556e793d803e ("sh: Improve function documentation")
09bb0b0d13968163c7394e9168491b16607fc2e7 Dag-Erling Smørgrav 2026-06-20 19:01:24
daemon(3): Note about environment after calling daemon()
While here, fix missing comma typo.

Reviewed by:    0mp, ziaee
Approved by:    0mp, ziaee
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57384
bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 Aymeric Wibo 2026-06-17 19:51:39
rmdir.1: Document non-POSIX -v option
MFC after:            3 days
Reviewed by:            ziaee
Differential Revision:  https://reviews.freebsd.org/D57675
b3dfd5d59c4a776abfa9b48babf08fb56e986dd7 Artem Bunichev 2026-06-19 19:57:19
thunderbolt.4: Explain what driver does in manpage
Reviewed by:  ziaee, ngie
Approved by:    ziaee
Fixes:  https://cgit.freebsd.org/src/commit/?id=2f7a796b590e ("thunderbolt.4: Initial manual for HW Relnotes")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57668
9fd0c7c520a4427e1de5a8b733851deca561b79c Aymeric Wibo 2026-06-19 18:48:38
adjtime(2): document that delta can be NULL
The current verbiage somewhat indicates that always adjusts the time,
which hasn't been true as far back as I had the energy to `git blame`.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57676
8ed580b1d3811e73e25db3d8a9fd235156c65387 Kyle Evans 2026-06-20 13:55:26
mem*.3: stop refering to strings
POSIX and the C standard now refer to objects and sequences rather
than confusingly revering to strings.

Also update bcopy(3) and bzero(3).

Reviewed by:    emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57680
015b890e28b87f182212230de35c9b061ff71258 Brooks Davis 2026-06-21 16:43:48

Hardware support

Hardware drivers and architecture-specific code.

mwl: return ENOMEM when rx buffer allocation fails
The malloc() failure path returned error, which is 0 at this point,
so callers would treat the allocation failure as success.
Return ENOMEM instead to correctly propagate the out-of-memory condition.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D42282
fa75c1cc242665d123ef5bf2f4ced2e076b35450 Kevin Lo 2026-06-15 01:43:57
Commit group #1: if_bnxt/bnxt_re: add support for driver snapdump
if_bnxt/bnxt_re: add support for driver snapdump

Add a logging module which helps to log and collect the driver`s
various events and state of device data structures.
APIs help modules like l2, RoCE etc. to register and
add logs into thg buffers. A segment header is added to the
data available in buffers.

The final log messages are arranged in following fashion

|SegHeader0|Data0|SegHeader1|Data1|
Logging module provides two different kinds of buffers:
a) A large contiguous memory chunk is used to form circular buffers.

Module need to provide a number of buffers while registering to
the logging module.Please note that, since memory for the
buffers remains with the module as long as it is registered, memory
footprints of the driver could be higher so the modules should
allocate an appropriate number of buffers. Also, due to limited
space, modules should only log important events/messages into
the buffer.
Modules  must use bnxt_log_add_mssg() to add the message into the
list.
b) Live buffer - They are allocated during coredump retrieval and

freed after the coredump data is returned to the user. This helps
to collect live data from the driver. Modules must use the
bnxt_log_live() function to add the log messages.
When coredump is retrieved all the messages available in above buffers are
copied into the coredump buffer.

Test Plan:
Generate the coredump using below niccli command
./niccli.freebsd -i 1 debug --coredump

and then verify the coredump contents using the Broadcom's Coredump decoder.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56682
f85e66e655c9293ea049814e21ed67ab246a7305 Sreekanth Reddy 2026-06-15 09:40:30

if_bnxt: Add Firmware crashdump collection support

This patch adds support for DDR-based firmware coredump memory handling.
It detects firmware coredump capability, allocates host DDR (DMA) memory
for crash dumps, and programs the firmware with the allocated memory during
attach. The allocated memory is released during driver detach.

Also, This patch adds functions to retrieve crash dump data from host DDR
memory. The implementation handles data copying from page tables and
checks dump availability. Main function bnxt_get_coredump() copies
stored crash dump data from DDR memory to the application buffer.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56684
03839879a2dd2505eab80b99211b0637ebdc9d32 Sreekanth Reddy 2026-06-15 09:46:51

if_bnxt: add bnxt logger module files to sys/conf/files for built-in kernel builds

The bnxt snapdump and coredump support patches added bnxt_log/{_data}.c. and listed it in
sys/modules/bnxt/bnxt_en/Makefile, but missed to add these files in sys/conf/files.

Fix up the issue by adding bnxt_log/{_data}.c in sys/conf/files.

Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
03676cafa882c471a29436aae76c8751d451dd07 Sumit Saxena 2026-06-15 12:22:25

if_bnxt: add few source files to version control

Commits- f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
and 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
missed to add few files under version control, those files are
added now:

sys/dev/bnxt/bnxt_en/bnxt_log.c
sys/dev/bnxt/bnxt_en/bnxt_log.h
sys/dev/bnxt/bnxt_en/bnxt_log_data.c
sys/dev/bnxt/bnxt_en/bnxt_log_data.h
sys/dev/bnxt/bnxt_en/bnxt_coredump.c
sys/dev/bnxt/bnxt_en/bnxt_coredump.h

bnxt_coredump.c entry is added in sys/conf/files as well.

Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
Fixes: https://cgit.freebsd.org/src/commit/?id=03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
9931dc5bf3831146c08a381c42ecbfcedb8ac7f1 Sumit Saxena 2026-06-15 14:30:26
if_bnxt/bnxt_re: Update hsi headers
Update hsi headers

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56683
308784bebe796cbdaccf7ef259caf7d87f874d02 Sreekanth Reddy 2026-06-15 09:43:01
Commit group #2: if_bnxt
if_bnxt: Fix the Unknown command 0x80000000 ioctl command error

With the latest niccli version, user will observe below
Unknown command command error when try to list the devices.

if_bnxt: Unknown command 0x80000000

Here, niccli is issuing command opcode as 0x80000000 but
driver is expecting 0x20000000 command opcode.

So, replaced _IOW(0,0,0) with the _IOC(IOC_IN,0,0,0).

Fixes: https://cgit.freebsd.org/src/commit/?id=d53d7b4 ("bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN")

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56685
3987058a3a943c461c27dbebf10dad555b1bb2fa Sreekanth Reddy 2026-06-15 09:48:34

if_bnxt: Add support for HWRM passthrough with multiple DMA buffers

Added support for HWRM passthrough commands with multiple DMA buffers.

Also, changed the mgmt_lock to sleepable exclusive lock.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56686
9d87ca8b9f60bdec0bbc1733920df250a08beb0c Sreekanth Reddy 2026-06-15 09:49:40
Commit group #3: ntsync(9)
ntsync(9): properly handle timeouts

Reported by:    Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
96759ab67a42226679675e24e35549aea2aa49e0 Konstantin Belousov 2026-06-15 00:59:46

ntsync(9): free wait state on error from copyin of the object's array

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
281e350942b26b054ba5bc820c6aae4ae0e03a38 Konstantin Belousov 2026-06-15 04:31:03

ntsync(9): do not double-free obj when finstall() failed

Reported by:    Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
1491ab351b45b1c727eeed40027f7b5074b19ff5 Konstantin Belousov 2026-06-15 04:41:53
if_tsec: Free entire mbuf chain on failure
Reviewed by:  bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57478
39e2fe23238f4d49cd6f2c3ce9d0d9c1c3bcbedd Ed Maste 2026-06-05 21:05:34
sound: Create all device nodes with GID_AUDIO
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Christos Margiolis 2026-05-21 18:03:31
Commit group #4: uvideo
uvideo: import uvideo(4) driver from OpenBSD

Port the uvideo(4) driver from OpenBSD. This provides
native USB Video Class (UVC) support for webcams and video capture
devices.

The main changes are adaptation for:
- USB transfer callback model
- isoc data extraction via usbd_copy_out(),
- V4L2 struct alignment for ABI compatibility with v4l_compat.

Note that this implementation can coexist with webcamd.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56960
b711ef9c75ba71d6258d028aaf7b119ccfffaa0a Baptiste Daroussin 2026-05-05 20:29:47

uvideo: add kqueue support

Add EVFILT_READ kqueue filter so applications using kqueue/kevent
can efficiently wait for video frames instead of polling.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56961
54df18cbb400e6394edad8abab0e5cb3a97e4df3 Baptiste Daroussin 2026-05-06 16:22:07

uvideo: add Camera Terminal controls

Implement UVC Camera Terminal (CT) controls per UVC 1.5 specification
Table A-12. This adds support for camera-specific controls that are
separate from the Processing Unit controls already supported.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56962
d0450cbec7e66ee56fd48c6482fd3bd9fb6549dc Baptiste Daroussin 2026-05-06 16:28:27

uvideo: add missing formats to be in par with webcamd's uvcvideo
8bc06ffbbd80533eda0784d2a6f5a1476f9d550c Baptiste Daroussin 2026-05-18 20:17:34

uvideo: increase isochronous transfer depth for throughput

Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep
more packets in flight on the USB bus.  This brings throughput from
~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd
provided ~20MB/s.

The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX)

Tested by:      manu
3b6f833c95eb65b29a9f506928467236a11d5169 Baptiste Daroussin 2026-05-18 21:44:27

uvideo.4: Initial manual page

Fixes:                  https://cgit.freebsd.org/src/commit/?id=b711ef9c75ba (import uvideo)
Reviewed by:            0mp, bapt, kevans
Differential Revision:  https://reviews.freebsd.org/D57622
fd1ee28bd01429aa8c38199d5fc069e8b0b75442 Alexander Ziaee 2026-06-18 13:48:09
rge: fix VLAN hardware tagging
Set the correct value in the TX descriptor for the vlan header.

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295175
76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 John 2026-06-16 13:06:40
wtap: Remove bogus NULL check in wtap_transmit
The node pointer is guaranteed to be non-NULL by the net80211 stack.

The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54547
9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 EN-WEU WU 2026-06-16 14:34:39
wtap(4): Implement STA/HostAP mode and support WPA/WPA2
Below is the commit message:
```
Wtap originally only supported mesh/ad-hoc mode, and cannot be combined
with wpa_supplicant(8) and hostapd(8) since it's unaware of encryption/decryption.
This commit adds support for hostap and sta mode with WPA/WPA2, thus wtap(4)
can now be used with hostapd(8) and wpa_supplicant(8).
```

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D36243
d4de0a69a92e560c77df83d7b342566ce353792c EN-WEU WU 2026-06-16 14:35:20
wtap(4): implement monitor mode and handle radiotap
Implement monitor mode by simply adding IEEE80211_C_MONITOR to ic->ic_cap.

To get additional informations when capturing 802.11 frames, radiotap is
 inserted by wtap_tx_tap() when TX and wtap_rx_tap() when RX.

There are some type faults in struct wtap_rx_radiotap_header which are
 mainly mistakenly store unsigned values into signed integers.
I have fixed them (wtap(4)) by complying with the types defined
 in https://www.radiotap.org/fields/defined.

Becuase the struct wtap_rx_radiotap_header comes from ath(4),
there may be another patch to fix the type faults in ath(4).

Differential Review: https://reviews.freebsd.org/D36469
93c6906e36a4e60e59279b6b6e18403ea23d56e1 EN-WEU WU 2026-06-16 14:54:05
GENERIC: enable extended error strings on all archs
This follows commit 3296fda0c309c873ae37a0a4e25ded3ae04b421c.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289236
Reviewed by:    kib
MFC after:      3 days
f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 Siva Mahadevan 2025-07-15 16:45:24
acpi: Fix panic when reading 'hw.acpi.suspend_state' knob on S1/S2
The 'hw.acpi.suspend_state' sysctl knob was re-introduced with a bug.
Its handler, acpi_suspend_state_sysctl(), expects the ACPI softc in
'arg1', but the knob was registered with NULL there.  This causes
a panic (NULL dereference) when reading the knob if the suspend state
has been set to S1 or S2 or equivalently the suspend sleep type to
STANDBY.

Fix it by passing the ACPI softc as 'arg1' when registering the knob.

Reviewed by:    obiwac
Fixes:          https://cgit.freebsd.org/src/commit/?id=9e1e29bd5ec6 ("acpi: Add back `hw.acpi.suspend_state` sysctl")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57412
6a2c4f0c0d9a9b93b26a1ad76f3a3fcbc590140c Olivier Certner 2026-06-03 08:43:27
acpi: Move supported states arrays into the softc
This is done in preparation of having some machine-dependent code access
these arrays through the softc.

Before this change, these arrays were static.  We chose to make them
part of the softc, instead of just exporting them ('acpi_quirks' remains
a known offender; some better way forward is to declare the whole ACPI
softc as static).

Some sysctl handlers now need to be passed the softc to access the
arrays, and some already needed to be passed a pointer to a field in the
softc.  As sysctl handlers are provided with a single pointer (arg1) and
a single integer (arg2), and now that the softc has to be passed into
the pointer argument (arg1), point indirectly to the wanted softc's
field by passing its offset in the integer argument (arg2).

To preserve the statically sized array in the signature of
power_pm_register(), and consequently avoid constructing such a dummy
array in early initialization (after this change, we can't pass
acpi_supported_stypes[] anymore as there is no existing ACPI softc at
this point), just remove the early ACPI registration via
power_pm_register().  This existed in the past as a hack to ensure ACPI
would be registered in priority, but for a long time now ACPI has been
the only subsystem that registers itself to the generic power
infrastructure, so this early registration has not been needed.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57413
ea44698a74ce0395231fe9e25e74e620d02b60f9 Olivier Certner 2026-06-02 19:51:54
Commit group #5: sound
sound: Start each channel individually

Unlock all members before starting any of them. Holding multiple channel
locks while calling chn_start() on a virtual channel can trigger the
parent, which acquires PCM_LOCK() while other virtual channels are still
locked -- a lock order reversal.

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57399
47ae0a869c7db693ffb1ac058d63dcb79c4e68a8 Goran Mekić 2026-06-17 10:34:05

sound: Include more information in kevent returned from the kernel

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57362
fe13f70b95a762e19c38d1152eac6312d8578f84 Goran Mekić 2026-06-17 10:35:07

sound: Adjust mmap example to use kqueue

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57410
a48bbef5eb32508a8d7b3b986c9b1d28176d1694 Goran Mekić 2026-06-17 10:36:12
mtw: Fix firmware loading and memory leaks
- Skip firmware reload if MCU already initialized
- Fix firmware_put() memory leaks on error paths
- Increase MCU init timeout to 15 seconds
- Use debug macros instead of device_printf for verbose output
- Remove unused 'ret' variable
- Fix space indentation to tabs per style(9)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57597
f981fa12b760a5f0983eeec8065a4dec5295ab24 Abdelkader Boudih 2026-06-17 14:30:21
est: prevent divide-by-zero in est_msr_info
When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock
from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may
contain zero in the frequency ratio field, causing a
divide-by-zero panic.

Observed in pre Skylake Intel cpu.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57614
021a190c88fc41f981a79fe6822bdafbcda14e99 Abdelkader Boudih 2026-06-17 14:49:52
est: gate "not recognized" message behind bootverbose
On modern Intel CPUs that use HWP (hwpstate_intel: /usr/src/sys/x86/cpufreq/hwpstate_intel.c) instead of EST,
this message prints unconditionally during probe even though it is
expected and harmless. Gated behind bootverbose to reduce console
noise on systems where EST is present but considered legacy.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57616
85814f5912618808ebe5b7065b70344675c98b5b Abdelkader Boudih 2026-06-17 14:50:48
Commit group #6: nvme: Use newbus to ask if a device is storage
nvme: Use newbus to ask if a device is storage

As NVMe is in more places, it has a variety of attachments. On non PCI
busses, we assume we're a storage device. For PCI, we look at the
interface ID. Add newbus glue to make this happen.

Sponsored by:           Netflix
Discussed with:         jhb
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D56994
949804c819096b40210e0b0729e54ba10b79c2e8 Warner Losh 2026-06-17 15:03:31

nvme: Move default is_storage method to nvme_private.h

Since CODE entries wind up in the nvme_if.c file, we got warnings when
it wasn't used (which is always). Move it into nvme_private and change
its name to nvme_is_storage_default to put it into the nvme_ namespace.

Fixes: https://cgit.freebsd.org/src/commit/?id=949804c81909
Sponsored by: Netflix
64b805d52eec795c6436def24cec508404b5bfdc Warner Losh 2026-06-20 17:44:27
mlx5: Add support for 800Gbit/s and 400Gbit/s with 2 lanes
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676 Slava Shwartsman 2026-05-13 14:22:48
mlx5: Add PCI IDs for ConnectX-9.
- Add descriptions for ConnectX-9.
- Add ConnectX-9 for libmlx5

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
741f489ed09ab1d9172d1f61aa341004b5c3e968 Slava Shwartsman 2026-05-04 07:29:18
mlx5: Add missing speeds translation
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
49b78368c5ed9cf41dedfc1c02a597fd49468537 Slava Shwartsman 2026-05-18 11:22:43
mlx5en: guard against empty eth_proto_oper mask
eth_proto_oper is used to derive the active media mode, but an empty
mask leaves no valid bit for ilog2() to consume. Treat this as an
invalid carrier update, reset the active media state, and report the
unexpected PTYS value.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d Slava Shwartsman 2026-06-10 16:43:08
Commit group #7: arm64
arm64: Support building sys/sysl instructions

Add support to build system instructions from a macro. These are based
on the existing support for msr/mrs instructions with adjustments for
the different instruction format.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D57017
a9e12d3ec8bde29e97227757bc08cb1a0a93afa9 Andrew Turner 2026-06-18 13:34:04

arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat

A use for it has been found in the GICv5 driver where we need to read
the Interrupt Affinity ID early in the boot on the secondary CPUs.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54249
cd94485281f3fc6ae5414180420527ce11846742 Andrew Turner 2026-06-18 13:34:47

arm64: Add an initial GICv5 driver

Add an initial driver for the GICv5 interrupt controller.

This provides host-only support for the GICv5 interrupt controller. It
is specified in the ARM-AES-0070 document & based on version 00eac0.

In the GICv5 there are 3 interrupt spaces: PPI, SPI, and LPI. Unlike
previous interrupt controllers they don't share a single interrupt
ID range, so PPI IRQ 1 and SPI IRQ 1 are different interrupts. There
is a common irqsrc stricture that encodes this information as it is
common across the interrupt types.

Unlike previous GIC versions there are no software generated interrupts
that can target a configurable collection of CPUs. These have been
replaced with LPIs, where each CPU will have one allocated for each
IPI type.

This driver handles the CPU interface and interrupt routing service
(IRS). The CPU interface provides the interface to manage and handle
interrupts, while the IRS handles routing LPIs and SPIs to the target
CPU.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54250
c84261da6f6ca6ae6d66eebb86da02467da3dd95 Andrew Turner 2026-06-18 13:30:01

arm64: Add an initial GICv5 ITS driver

Add a driver to support the GICv5 interrupt translation service (ITS).
The ITS is responsible to handling ITS events & translating them to an
interrupt to be delivered to the interrupt routing service (IRS).

An example event is a MSI or MSI-X is delivered. The ITS will generate
an LPI depending on which device sent the interrupt and the value the
device wrote.

This is a similar concept to the GICv3 ITS, however the implementation
details are different so it needs a new driver.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54251
06d64ee0ecc2ed25315b1afa20fea63c51b78abb Andrew Turner 2026-06-18 13:50:54

arm64: Add an initial GICv5 IWB driver

Add a driver to support the GICv5 interrupt wire bridge (IWB). The IWB
translates the change in state of an input wire and sends a MSI to
the interrupt translation service (ITS) to be translated to an LPI.

Unlike other MSI sources each wire has a fixed Event ID value it will
write in the MSI data.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54252
cbef29bde7ce8f2bac4bff831a21e9e54ae51d20 Andrew Turner 2026-06-18 13:52:18
virtio_net: Use bus_dma for rxq/txq buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55492
8193fa3b8e1a9425bd8ac8b707cab565816b8584 Sarah Walker 2026-02-16 14:19:13
virtio_net: Use bus_dma for command/ack buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55564
ea130fa32099ea7e0c03702efdec28e745ea6ef1 Sarah Walker 2026-02-27 14:17:15
thunderbolt: do not enable in GENERIC
The thunderbolt implementation is not 100% complete and causes some
suspend/resume issues. Comment out the device until it is better
fleshed out and some of the core issues with it are resolved.

MFC after:      1 week
Requested by:   obiwac
Differential Revision:  https://reviews.freebsd.org/D57650
92bdcb08113c05ec18ad420a4d84dd858e7f5e64 Enji Cooper 2026-06-18 20:02:01
uart: Add support for the Intel XScale controller
The ns8250 driver avoids clearing IER bit 0x10 to account for the
split "receiver time-out interrupt enable" bit, but it never sets
it in `ier_rxbits` even though a comment in `ns8250_init` implies so.

Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart.

Differential Revision:  https://reviews.freebsd.org/D57629
Reviewed by:    imp
MFC after:      2 weeks
1665954e508f74588108e96c30b90d1a88807faa Bojan Novković 2026-06-18 02:03:55
firewire: extract shared helpers from fwe and fwip
Add fw_net.h with common inline helpers used by both if_fwe and
if_fwip: ISO chunk init, TX xfer allocation, xferlist free,
send queue drain, and DEVICE_POLLING ioctl handling.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57615
9919c1a8ebd7da0aa86c6475446a7af255ecb17a Abdelkader Boudih 2026-06-19 19:01:12
powerpc64le: switch long double to IEEE binary128
Change powerpc64le's long double from 64-bit double to IEEE 754
binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64.

Gated on FreeBSD 16 and powerpc64le only.

Differential Revision: https://reviews.freebsd.org/D57388
Reviewed by:    adrian
Relnotes:       yes
255538cd906045095d0c2113ae6c4731ce36c0cf Piotr Kubaj 2026-06-15 15:37:26
efirt(9): in verbose mode, announce the attachment and fw spec version
Reviewed by:  emaste, imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57710
43fb5b33b00f3b66ec03ab3e0ea002afd16cb7b3 Konstantin Belousov 2026-06-20 13:52:09
sound: Retire SD_F_VPC and related settings
VPC is enabled by default, and the only way to turn it off is through a
loader hint. That being said, there is no benefit to turning it off in
the first place, because VPC provides more fine-grained volume control,
as well as access to the SNDCTL_DSP_[SET|GET][REC|PLAY]VOL ioctls and
dsp_ioctl_channel().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
f70a687bb071cdee60dc7420d75fa1dd122af51a Christos Margiolis 2026-06-20 17:32:21
efirt(9): carefully destroy efi_lock
efi_init() might return error after initializing the mutex, in which
case MOD_UNLOAD() is not processed, and the mutex is not destroyed.
Similarly, efi_uninit() skips any processing if efi_runtime was left as
NULL, leaving mutex not destroyed.

Initialize the mutex in MOD_LOAD case, and destroy in MOD_UNLOAD, also
handling errors.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57704
8edcb37dd0753dc7e50044d9ccf0e991392a3d84 Konstantin Belousov 2026-06-20 12:20:38
Commit group #8: sound
sound: Use and lock only the appropriate channel in dsp_mmap_single()

dsp_mmap_single() mmaps one of the channels associated with a
dsp_cdevpriv, based on the nprot argument. PROT_WRITE and
PROT_READ|PROT_WRITE select the output channel for mmaping, and
PROT_READ the input one. Instead of locking and modifying the flags of
all dsp_cdevpriv channels, do it only for the one we actually use.

While here, retire the now unused dsp_lock_chans() and
dsp_unlock_chans().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
bbb37ddf3669f77d78446b9f1e37f58c63dc0a1c Christos Margiolis 2026-06-12 06:14:05

sound: Re-arrange a calculation in dsp_mmap_single()

This makes it easier to read. No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
0c8147ae3bc1c7db95098fcc92fc2e86111f59d3 Christos Margiolis 2026-06-12 06:14:57

sound: Handle CHN_F_MMAP_INVALID after cdev_pager_allocate()

We drop the channel lock to execute cdev_pager_allocate(). By the time
we pick up the lock again, CHN_F_MMAP_INVALID might be set, so make sure
we fail and free the vm handle.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
47efa8128268c35ac8f0a552d7a7ce43cd1c5925 Christos Margiolis 2026-06-12 06:19:07
aq(4): Fix RSS indirection table OOB write and queue distribution
Two related fixes to `aq(4)`'s RSS indirection table handling:

1. Fix an out-of-bounds stack write in `aq_hw_rss_set()`.  RSS table entries are 3 bits (8 queues max), but with more than 8 RX rings `rss_table[]` holds larger values; the 32-bit write then spills one `uint16_t` past `bitary[]` and corrupts the stack, so the NIC never links or the kernel panics.  Mask each value to 3 bits and pack 16 bits at a time to keep the write in bounds.

2. Build the indirection table in `aq_if_attach_post()` with a modulo over `min(rx_rings_count, HW_ATL_RSS_INDIRECTION_QUEUES_MAX)` instead of `i & (rx_rings_count - 1)`, which assumed a power-of-two ring count.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57240
57f5252ff8a17aa837f677638cce5885b8a5fb3b Nick Price 2026-06-20 19:02:22
aq(4): interrupt model and queue-count correctness
Rework the MSI-X and queue-count handling to use the standard iflib
interrupt model and to keep every ring serviced.

- Cap isc_n{tx,rx}qsets_max at the RSS indirection-table size
  (HW_ATL_RSS_INDIRECTION_QUEUES_MAX, 8) instead of HW_ATL_B0_RINGS_MAX.
  RSS only steers RX traffic to eight rings, so on hosts with more CPUs
  the surplus TX rings never make progress: iflib flowid-steers TCP
  flows across every TX ring, and a flow landing on a surplus ring has
  its segments queued but never transmitted, hanging the connection.

- Add a TX-specific ifdi_tx_queue_intr_enable that reads
  tx_rings[txqid]->msix.  It was wired to the RX handler, which indexes
  rx_rings[] with the qid; safe only while tx_rings_count ==
  rx_rings_count, otherwise the lookup walks past rx_rings[] and feeds a
  garbage msix value into the IRQ mask register.

- Fix three MSI-X / admin-IRQ bugs: the TX softirq was attached to
  rx_rings[i]->irq (overwriting the RX handle and leaving the TX handle
  uninitialized); the admin-IRQ failure path dereferenced
  rx_rings[rx_rings_count], one past the end; and aq_linkstat_isr cleared
  the admin interrupt by writing the raw vector number instead of
  BIT(vector).

- Allocate one IFLIB_INTR_RXTX vector per RX/TX queue pair like every
  other in-tree iflib driver (em/ix/igc, vmxnet3) instead of an
  IFLIB_INTR_RX vector per RX ring plus a hand-wrapped IFLIB_INTR_TX
  softirq per TX ring.  iflib's iflib_fast_intr_rxtx() then services TX
  completions on the shared vector through isc_txd_credits_update().

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57434
b065af196fdcab18d36caae214c905467723b3f1 Nick Pricenull 2026-06-20 19:02:34
aq(4): adopt native FreeBSD errno convention
Convert the driver's internal error-handling chain from the Linux
negative-errno convention to FreeBSD positive errno everywhere.

- All `return (-EXXX)` become `return (EXXX)`, `int err = -EXXX` loses
  the sign, and `if (err < 0)` checks become `if (err != 0)` across
  aq_fw.c, aq_fw1x.c, aq_fw2x.c and aq_hw.c.
- mac_soft_reset_flb_ returns ETIMEDOUT/0 instead of a bool so it
  matches its RBL sibling.
- The ETIME and EOK aliases in aq_common.h are removed; all sites use
  ETIMEDOUT and 0 directly, and the `rc = -rc` sign flips in
  aq_if_attach_pre are dropped.

Turn AQ_HW_WAIT_FOR into a statement expression evaluating to 0 on
success or ETIMEDOUT on timeout, assigned explicitly at all seven call
sites, instead of silently assigning ETIMEDOUT to a variable named err
in the caller scope.  A statement expression rather than an inline
function because every call must re-evaluate its condition each
iteration -- one even assigns hw->mbox_addr as a side effect.

Fix two correctness bugs surfaced by the conversion:

- fw1x_get_stats gated its stats copy with `if (err >= 0)`, correct
  under negative errno but accepting every positive errno after the
  flip.  Change to `if (err == 0)`.
- fw2x_reset returned 0 regardless of capability-download failure,
  silently leaving fw_caps = 0.  Return the real err.

Harden aq_if_attach_pre: bit_alloc(4096, M_AQ, M_NOWAIT) was unchecked,
so under OOM a later `ifconfig vlanN create` would NULL-deref the
bitstring; check for NULL and fail with ENOMEM.  The fail label's
hardcoded `return (ENXIO)` becomes `return (rc)` so each error path
reports its real errno.

Remove the dead error checks in aq_hw_offload_set: the
`if (err != 0) goto err_exit` blocks after the void tpo_/rpo_/tdm_
register-write helpers were unreachable (err is never set), and the real
error capture is the aq_hw_err_from_flags call at the function tail.
Drop the now-orphaned err_exit label.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57435
40accc7235c2f0d2072f051099d183e7f21c2731 Nick Price 2026-06-20 19:02:42
aq(4): RX/TX and HW-path correctness and hardening
Independent correctness fixes, plus robustness against a non-responding
device, malformed descriptor writeback, and torn MMIO reads, and the move
to the FreeBSD bus_space(9) register abstraction.

Correctness:
- aq_hw_ver_match returned true if any of major/minor/build was >=
  expected; compare lexicographically so e.g. 2.0.1 is correctly seen as
  older than 2.1.0.
- The VLAN hardware-filter iteration used the vlan tag directly as the
  bitstring index; use vlan_tag + 1 so the active-VLAN bookkeeping lines
  up with the table.
- aq_initmedia only registered IFM_AUTO in full-duplex/pause variants, so
  a bare "ifconfig aq0 media autoselect" matched no entry and returned
  ENXIO.  Add the bare IFM_ETHER|IFM_AUTO entry, matching ix/em/igc/ixv.
- Convert the per-ring diagnostic counters to counter(9): per-CPU,
  tear-free, no atomics on the increment path, fixing a data race and a
  32-bit torn read against the locklessly-read sysctls.  Drop three
  counters that were never populated (jumbo_pkts, tx_drops, tx_queue_full).

Hardening and modernization:
- Implement aq_hw_err_from_flags (previously a stub returning 0 that left
  ~24 call sites as no-ops): detect a non-responding device in the
  register read path (all-ones, confirmed against reg 0x10) and latch a
  sticky AQ_HW_FLAG_ERR_UNPLUG -> ENXIO; aq_if_init clears it so a
  transient detection cannot permanently wedge the device.
- Bound the RX fragment loop in aq_isc_rxd_pkt_get (EBADMSG once i reaches
  isc_rx_nsegments) so a malformed never-EOP stream cannot write past the
  fragment array.
- Bound the TX completion count in aq_isc_txd_credits_update against the
  raw HW head pointer (reject head >= tx_size) so a glitched head cannot
  make iflib free still-in-flight TX mbufs.
- Remove the dead hardware-RSC branch in aq_isc_rxd_available; it followed
  wb.next_desp, a raw device value used as an index, but RSC is never
  enabled so rsc_cnt is always 0.  Advance sequentially like the other
  in-tree iflib drivers; this drops the last raw-hardware-pointer
  dereference in the RX path.
- Flush MMIO after interrupt-status acks (AQ_HW_FLUSH) so the write lands
  before the vector is re-armed under auto-mask-clear; retry the high word
  in read64_ against a torn lo/hi pair; document the non-atomic IMR
  read-modify-write in itr_irq_map_en_{rx,tx}_set.
- Replace the raw-pointer MMIO (the Linux readl/writel idiom) with
  bus_space(9): store the BAR tag and handle in struct aq_hw and route
  AQ_READ_REG/AQ_WRITE_REG through bus_space_read_4/write_4.  No functional
  change on amd64.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57436
619934a5c165869604810ece91c2f2cb734fc3eb Nick Pricenull 2026-06-20 19:02:52
Commit group #9: aq(4)
aq(4): enable jumbo frames, software LRO, and suspend/resume

- Configure the RX buffer size from the interface MTU and enable jumbo
  frames up to 9000 bytes, replacing the fixed standard-frame setup.

- Advertise IFCAP_LRO so iflib coalesces received TCP segments with its
  software tcp_lro(9), like every other in-tree iflib driver
  (ix/igc/em/vmxnet3); aq does no hardware LRO.  iflib builds the
  per-RX-queue LRO context unconditionally, so the capability bit is all
  that is required; enabled by default via isc_capenable, toggle at
  runtime with ifconfig.

- Add suspend/shutdown/resume handlers, replacing the unimplemented-
  function placeholders.  aq_if_shutdown/aq_if_suspend stop the interface
  and deinitialize the hardware; aq_if_resume re-resets the F/W, re-reads
  the mailbox address and re-selects fw_ops via aq_hw_mpi_create() before
  iflib re-inits, because the runtime init path (aq_hw_init) reuses the
  cached mailbox/fw_ops and a D3 power cycle can clear them.  iflib calls
  IFDI_RESUME unconditionally, so this also covers resuming while the
  interface was administratively down.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57437
b64408358d7f27a69b84d9fd1e23e239e8bd00fc Nick Price 2026-06-20 19:03:00

aq(4): modernize and de-Linuxify the vendor driver

Dead-code removal, device_printf(9) logging, style(9) de-Linuxification,
const F/W-ops tables, and readability cleanups.  No change for valid
traffic.

Dead code and logging:
- Remove the sub-gigabit TSO-masking block in the link-state ISR: it
  cleared IFCAP_TSO from the static isc_capabilities record (read only at
  attach / SIOCSIFCAP, never on the datapath), so it never gated TSO and
  only corrupted the validation mask.  The Atlantic has no sub-gigabit TSO
  erratum.
- Tidy the RX buffer-size handling: drop the dead switch(MCLBYTES) in
  aq_if_rx_queues_alloc, rename rx_max_frame_size -> rx_buf_size, and bound
  the per-fragment length from the wb.pkt_len writeback (EBADMSG on
  underflow or a final fragment longer than the RX buffer).
- Drop every __FreeBSD__/__FreeBSD_version branch (FreeBSD 14.0 baseline);
  the pre-13 arms used pre-opaque-if_t APIs since removed and one never
  built.
- Route all log messages through device_printf(9) (MAC via %6D), adding a
  device_t to struct aq_hw; drop the dead AQ_XXX_UNIMPLEMENTED_FUNCTION and
  aq_log_error macros and the per-ring init console spam.
- Minor: comma -> semicolon in aq_if_attach_pre; (uint64_t) -> (uint32_t)
  TX high-word cast; MODULE_VERSION(atlantic, 1); remove unused/duplicate
  #includes.

style(9) and types:
- Remove all typedef'd struct/enum/union types (aq_dev_t, the speed/fc/
  debug enums, the volatile RX/TX descriptor types, the firmware-file
  types) in favor of bare tags; for the DMA descriptors the volatile
  qualifier moves to the pointer/use sites.  Drop the _s/_e tag suffixes
  and the "#define aq_hw_s aq_hw" alias.  Rename the OOP-style *self
  parameter to hw.  Replace usec_delay/msec_delay/ARRAY_SIZE/LOWORD with
  FreeBSD equivalents (BIT kept).  __attribute__((__packed__)) -> __packed.

F/W-ops vtable:
- Rename the leftover hal parameter to hw; make aq_fw1x_ops/aq_fw2x_ops
  const (read-only data); drop the always-true "fw_ops &&" and
  always-present dispatch guards (only led_control, absent in F/W 1.x,
  keeps its NULL check).

Readability:
- aq_isc_rxd_pkt_get: fold the four identical RX-error blocks into one
  rx_err: label.  aq_isc_rxd_available: hoist the shared descriptor advance
  out of the EOP test and drop the redundant continue.  aq_hw_offload_set:
  drop the dead "int err = 0".  Fix a stale "10 ms" comment on a 50 ms
  DELAY and the redundant literal parentheses.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57438
5409e03a0ef1f2d71da94bedd433fbaa7b6b21f2 Nick Price 2026-06-20 19:03:09

aq(4): take F/W statistics off the iflib core lock (kick-and-read)

The once-per-second statistics refresh ran the whole F/W-mailbox
transaction under iflib's CTX (sx) lock: fw2x_get_stats toggled the MPI
STATISTICS control bit and busy-polled the state register for the
acknowledgement (up to ~25 ms) before downloading the counters, so a slow
F/W response blocked datapath reconfigure / ioctls for the duration.

The per-cast and error counters have no direct-register source -- the
reference Linux atlantic driver and our port both read them out of the
F/W mailbox, and the MSM registers the chip exposes are never used for the
periodic counters.  So rather than poll, adopt the kick-and-read shape the
iflib peer with the same constraint uses (vmxnet3): consume the snapshot
the F/W produced for the *previous* request, then toggle the bit to
request the next one -- no wait.  The F/W finished that previous refresh
~1 s ago, so the download needs no poll, and the toggle write stays
serialized against set_mode by the CTX lock exactly as before.  This
removes the 25 ms poll (and the toggle_mpi_ctrl_and_wait_ helper) from
under the lock; only the fast 16-dword download remains.

Cost: the counters lag one 1 s cycle, invisible for monitoring, and a torn
read is already rejected by aq_update_hw_stats' monotonic-delta check.

Validated on AQC107: a fixed 500 MiB RX transfer advances good_octets_rcvd
by 549.6 MB -- 500 MiB plus the ~4.8% Ethernet framing overhead -- with
rx_err=0 and traffic at line rate.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57439
a10151fa662c1d370861154e2f83e88a20be149c Nick Price 2026-06-20 19:03:18

aq(4): add a runtime dev.aq.N.debug trace control

The trace_* family (trace/trace_error/trace_warn/trace_detail, used in the
F/W and init/config paths) was gated behind the compile-time
AQ_CFG_DEBUG_LVL, which is 0, so the dbg_level_/dbg_categories_ runtime
variables were dead and tracing could only be enabled by recompiling.

Decouple trace_base_ from AQ_CFG_DEBUG_LVL so it is always compiled and
gated purely at runtime on dbg_level_/dbg_categories_, make those two
variables writable (no longer const, default level 0 = off), and expose
them as dev.aq.N.debug (verbosity) and dev.aq.N.debug_categories
(subsystem mask) sysctls.

The datapath-heavy AQ_DBG_ENTER/PRINT/DUMP macros and the trace_aq_*_descr
descriptor dumps stay behind AQ_CFG_DEBUG_LVL (still 0), so the per-packet
paths are untouched -- trace_* is only used off the datapath.  The two
variables are global (the trace macros reference them directly), so the
per-device sysctls share one backing store, which is fine for a debug
knob.

Validated on AQC107: dev.aq.0.debug defaults to 0 with no trace output;
setting it to 6 emits the F/W init/reset/capabilities traces on the next
F/W operation; setting it back to 0 silences them; traffic unaffected at
line rate, rx_err=0.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57440
76d0a25be3976634631bab975f4c2ddbc98f72a2 Nick Price 2026-06-20 19:03:28

aq(4): naming and exposure

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57656
e44579e23430ff2084b03c9b3d486f05e617e04f Nick Price 2026-06-20 19:03:37
ig4: unconditionally un-idle the controller core on resume
On controllers with the LPSS "additional registers" (Skylake and later,
IG4_HAS_ADDREGS), ig4iic_suspend() places the controller in the device
idle state (IG4_DEVICE_IDLE) and asserts core reset.  While idle the
DesignWare core is power-gated: its register bank reads back as zero and
writes are dropped until the core is taken out of the idle state again.

ig4iic_set_config(), called from ig4iic_resume(), only performs that
un-idle handshake when it observes IG4_RESTORE_REQUIRED set in
DEVIDLE_CTRL.  Some platforms (e.g. Intel Alder Lake-P) do not raise
that status across suspend-to-idle (S0ix).  The core is then left gated:
set_config()'s register writes have no effect, it nevertheless returns
success, and every subsequent transfer fails with IIC_ETIMEOUT, leaving
child I2C-HID devices (touchpad, touchscreen) dead after resume.

Give ig4iic_set_config() a force_restore argument and pass it from
ig4iic_resume() so the un-idle handshake runs unconditionally for
IG4_HAS_ADDREGS controllers, regardless of the RESTORE_REQUIRED status.
This keeps the handshake and its reset/restore sequence in one place
instead of duplicating it in the resume path.

The DesignWare core's register bank stays inaccessible (reads back as
zero) until it leaves reset, which happens when ig4iic_set_config()
deasserts the core reset.  Rather than waiting a fixed, guessed
interval, poll the fixed component-type signature (IG4_REG_COMP_TYPE ==
IG4_COMP_TYPE) immediately after that deassert and continue as soon as
the core is ready.  On Alder Lake-P the core is ready with no measurable
delay; the bounded poll keeps this correct on slower parts, and warns if
the core never leaves reset.

While integrating these I2C-HID touch devices, also raise hid(4)'s
MAXLOCCNT from 2048 to 4096: the report-descriptor parser truncates any
variable main item whose usage count exceeds MAXLOCCNT, silently
dropping the trailing report fields.  Some contemporary touch devices
declare variable items with more than 2048 entries, so part of their
input reports was being discarded.

Reviewed by:            adrian
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D57673
a4ed783cee2a10629db7a6c254712f96bd820288 Devin Teske 2026-06-19 17:24:58
amd64: do not restore fsbase/gsbase for 32bit processes
There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the
fsbase and gsbase must always be equal to the bases in the corresponding
segment descriptor, same as on real i386.

If a 32bit program reloads either %fs or %gs using setcontext(9) or
sigreturn(9), restoring bases from the syscall entry time is wrong.
In all other cases, hardware already does the right action when the
segment register is loaded, and the bases for the ufssel/ugssel in GDT
are updated on the context switch.

Reviewed by:    markj (previous version)
Tested by:      terehovv@mail.ru
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57611
c7e5802ab6e6230a5782a09c914585d055eb5223 Konstantin Belousov 2026-06-16 21:44:00
pmap: prefer memcpy over bcopy
Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy.
We'll be adding non-provenance preserving versions for CHERI support and
would like to avoid introducing variants of deprecated APIs just to
maintain symmetry.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57687
2ee2ef607f6087757efd62b814cbf2400ef58ef2 Brooks Davis 2026-06-21 15:47:23
powerpc/booke: Extend TID register bits to the max
Some Book-E cores (at least e6500) can have much larger PID fields, up
to 14 bits.  Extend the PID mask space to the full space, and future
changes may take advantage of this extended space.
9006774e46dfe0859500ce18e1691c75846a884d Justin Hibbits 2026-06-21 20:28:55
powerpc/pmap: Use variable-sized TID
e6500 core supports 14-bit TIDs (16384), while all earlier cores support
only 8 bit TIDs.  Dynamically allocate the tidbusy array at bootstrap
time so that it stays in the TLB1, but is sized appropriately for the
core.  With MAXCPU of 32, a e6500 tidbusy would be (8 * 32 * 16384), or
4MB for this array, while e5500 would use (8 * 32 * 256), or 64kB.
9faeaac936aea78f9b5ce1a8ad3d27e2632d4e37 Justin Hibbits 2025-12-17 03:20:55
powerpc/booke: Save watchdog context to "critical" save area
Watchdog interrupt is a "critical" interrupt, so save the correct
registers (CSSRn, into critical save area).
b3249ed3a6edb993b9acea6358c103d591afb08b Justin Hibbits 2026-06-21 21:58:44

Networking

Network-related commands, library, and kernel.

netlink: Indicate that ifinfomsg uses IFT_* types
On Linux struct ifinfomsg uses ARPHRD_* values, while we used IFT_*
types (which derive from SNMP ifType definitions in RFC 1573).
Update the header to reflect this.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272144
Reviewed by:    pouria
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57334
21a75a85f0e0cc328b6e9b437d783ef0c25dc52e Ed Maste 2026-05-29 16:23:17
udp: Wrap a long line in udp_send()
No functional change intended.

MFC after:      1 week
3b69c7201fd06b368090f2ee3840d384a949cba8 Mark Johnston 2026-06-15 15:57:01
sockstat: don't use getprotoent(3)
This removes requirement for existence of obsolete IPPROTO_DIVERT in
<netinet/in.h> and the 'divert' entry in /etc/protocols.

Also, this avoids running through the nsdispatch(3) machinery on startup,
cutting down about 20 syscalls, three of which are open(2).  The code of
sockstat(1) itself is also reduced.

The only UI change for a normal execution is that now the divert(4)
sockets are reported as "divert4" instead of "div4".  The prefix "4"
itself is also incorrect, as divert(4) is not a part of IPv4.  This will
be addressed in a separate change.

There is small UI change for incorrect runs.  Previously protocols listed
in /etc/protocols, but not supported, would err out like this:

  # sockstat -P ggp
  sockstat: protocol 3 not supported

And non-existent protocols would err out like this:

  # sockstat -P foo
  sockstat: cap_getprotobyname: No error: 0 USER COMMAND
  PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS

Now both cases will consistently err:

  sockstat: protocol foo not supported

Reviewed by:            pouria, tuexen
Differential Revision:  https://reviews.freebsd.org/D57507
3a58a50dd4fa05d4a09054cf66701dc2409b0032 Gleb Smirnoff 2026-06-16 16:58:13
sockstat: consolidate unix(4) protocols in the array of protocols
This makes it possible to list unix(4) protocols in -P, which was not
possible before.  Update the manual page and provide an example.

In 'struct sock' make member proto a pointer into the protocols table
instead of a number.  This removes namespace collision that mixed
IPPROTO_TCP and etc with SOCK_STREAM and etc.  There were no known bugs
due to this collision, though.

Preserve all current UI bugs for possible combinations of protocol
selection options.  Should be no UI changes outside the improved -P.

Reviewed by:            pouria, tuexen
Differential Revision:  https://reviews.freebsd.org/D57508
8b2b62b49d886816213fb6b39258afb1373ef43b Gleb Smirnoff 2026-06-16 16:59:01
pfctl: pfctl_get_astats() doesn't set errno
After commit 08f54dfca197 pfctl_get_astats() doesn't set errno anymore,
except in one place.  Fix up that one place and adjust callers
appropriately.

Reviewed by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=08f54dfca197 ("pf: convert DIOCRGETASTATS to netlink")
Differential Revision:  https://reviews.freebsd.org/D57608
34e155336f0dd10efa8261b971fd540d92817339 Mark Johnston 2026-06-16 19:37:35
tcp: cleanup resource handling in SYN handling
Handle cred, ipopts, and maclabel using the same pattern:
allocate at the beginning and set to NULL when the object is
transferred to a struct syncache. When exiting the function, free
these objects if not transferred or when transferred to the on-stack
struct syncache. This makes use of a new function syncache_release().

This fixes a use after free problem: ipopts should only be freed,
if the on-stack struct syncache is used and the pointer in this
structure still points to the allocated ipopts. If the ipopts
are moved from the struct syncache to the struct inpcb in
syncache_socket(), which is called by syncache_tfo_expand(),
the pointer in the struct syncache is set to NULL.

In a FreeBSD default setup this problem is mitigated by
1. TCP fast open support on the server side not being enabled
   (the sysctl-variable net.inet.tcp.fastopen.server_enable is 0).
2. Incoming IP packet with source routing options are not being
    processed by the host stack
    (the sysctl-variable net.inet.ip.accept_sourceroute is 0).

Only if these two sysctl-variables are changed, a FreeBSD system
is affected, if a server actually using TCP fast open is running.

Reported by:            Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:            markj, rscheff
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D57374
1ed2bf1e0052df8dd6b429fc4ddd1908005f39ef Michael Tuexen 2026-06-17 13:46:56
tcp.fastopen.client_enable: Fix documented default
The default value has been 1 since June 2018, but the docs were not
updated to reflect the change.

MFC after:      3 days
Reviewed by:    ziaee
Fixes:          https://cgit.freebsd.org/src/commit/?id=af4da5865557 (Enable TCP_FASTOPEN by default)
Signed-off-by:  Matteo Riondato <matteo@FreeBSD.org>
Closes:         https://github.com/freebsd/freebsd-src/pull/2285
0bc852cc62afcd79fc776f784623c3f2b7691d27 Matteo Riondato 2026-06-17 14:59:01
net/if_media.h: Add 800GBase-X and 200Gbit/s per lane support
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   Nvidia networking
Differential revision: https://reviews.freebsd.org/D57083
51f313dbc7a28a7bd2013c205261f29f115eb0a7 Slava Shwartsman 2026-05-13 10:10:50
iflib: Fix mbufs leaked by 0 len packets emitted from the if driver
Some interface drivers, notably bnxt, can insert 0 length packets onto
their receive queues when certain conditions are met, such as discarding
packets in the case of bnxt.

When this packet gets processed by assemble_segments(), The solitary
mbuf on the queue that composes it consist of a single zero length
fragment. The loop in assemble_segments() doesn't seem to expect
that a 0 length fragment can exist in the iri_frags list without a
non-zero length header preceding it. In this situation, without filter
intervention rxd_frag_to_sd() returns a pointer to the corresponding
mbuf in the rxq, where it is matched as a zero-length fragment and
immediately discarded without freeing as mh has not yet been assigned.

This change corrects this behavior by falling through the mh == NULL
case and freeing m on the condition that it is not NULL before
continuing the loop.

Reviewed by:    gallatin
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D57537
e2903636a069d5ef364c8f56452bff5818d15f99 Reid Linnemann 2026-06-17 18:22:44
if_ovpn: Fix a lock leak in an error path
Reviewed by:  kp
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf")
Differential Revision:  https://reviews.freebsd.org/D57696
f7b71f832c990da0bf203095f02405df665529d0 Mark Johnston 2026-06-20 14:12:19

System administration

Stuff in man section 8 (other than networking).

ping6: fix outpack overflow in pattern fill loop
The fill loop was bounded by packlen, which is sized for the receive
buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack.
With large datalen the loop wrote past outpack[MAXPACKETLEN].

Bound it to the actual data area in outpack instead.

Reported by:    Oculytic
Reviewed by:    des, markj
Differential Revision:  https://reviews.freebsd.org/D57441
e15be258bbf2978dfc62b5483d86c76884eb8576 Mariusz Zaborski 2026-06-16 17:02:02
Commit group #10: Update bsdconfig dot USAGE
Update bsdconfig dot USAGE

Replace mention of graphics/ImageMagick with graphics/GraphicsMagick
ef0654f2c65066b8e69c3e543099f7034def4fb1 Devin Teske 2026-06-17 14:22:33

Update bsdconfig dot USAGE

graphics/gimmage is no longer in ports, remove mention
234bb65d0bf34580bc93e44a802c0c60e7f31009 Devin Teske 2026-06-17 14:30:39

Update bsdconfig dot USAGE

graphics/gqview is no longer in ports, remove mention
12ec78284337c6aef0acdf942c210cf08e367da6 Devin Teske 2026-06-17 14:32:12
Update bsdconfig dot USAGE copyright following previous commits
08da4322ff6225aacb315e475537229c11a6badf Devin Teske 2026-06-17 15:13:19
Update bsdconfig dot USAGE
print/gsview is no longer in ports, remove mention
4519d987c4db2c500c34b324b315c5dfd6efb3bc Devin Teske 2026-06-17 15:17:02
Update bsdconfig dot USAGE
Add gm prefix to convert command.

`convert` of ImageMagick is now available under `gm convert` where
`gm` is the main entry point for GraphicsMagick commands.
4acaa22829f77d287a4c99a7709fea80040998c8 Devin Teske 2026-06-17 15:24:48
bsdconfig: Update dot USAGE
graphics/gx is no longer in ports, remove reference
00c8e7691001f5659f2bd2dbadb31fe48d9f61c7 Devin Teske 2026-06-17 16:34:46
autofs: remove dead code
log_set_peer_name() and log_set_peer_addr() were never used

Differential Revision:  https://reviews.freebsd.org/D57164
943bfad1097f3459f70ece6ecfd86e5d6d615a6e Robert Wing 2026-06-18 20:12:46
stand: Bulk operations on each gfxfb_blt if shadow buffer enabled
Previously, gfxfb_blt flushed the framebuffer on every call. Since a
single drawing operation may invoke gfxfb_blt multiple times, this can
result in unnecessary flushes.

Instead, write updates to the shadow buffer (when present) and mark the
affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls
can be coalesced into a single update. As before, only the dirty region
is flushed.

This fixes the slow bootloader problem in some platforms.

Reviewed by:    imp, adrian, obiwac
Tested by:      obiwac, jrm
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57373
32da2f23ae4d18888d34682b0ddb49ec80c0bb26 ShengYi Hung 2026-05-31 15:07:51
bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak
Free the previous value before re-strdup'ing, and initialise
remoteMountPoint to NULL in fs_entry_create() so the free() is safe on
the newly-created path

Observed via a dtrace leak snapshot on 15.0-RELEASE-p4:
  data leaked = 1983, count = 1683
    libc.so.7`malloc+0xa8
    snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276
    snmp_hostres.so.6`refresh_storage_tbl+0x502
    snmp_hostres.so.6`op_hrStorageTable+0x1a
    libbsnmp.so.7`0x2a2b1892ba3d
    libbsnmp.so.7`snmp_getbulk+0x37f

Reviewed by:    sjg, ngie
Differential Revision:  https://reviews.freebsd.org/D57604
28ddd11d91f860df9b9be485c5b0526c10b4aec1 Mariusz Zaborski 2026-06-19 11:58:17
tests: Add pjdfstest integration
Use ATF to wrap the new reimplementation of pjdfstest that came out of
GSOC 2022, now available in the ports tree as filesystems/pjdfstest.

So far I added tests for UFS (with several different option
combinations), tmpfs and ZFS, plus ZFS+nullfs.  All of these create a
memory disk, initialize the filesystem, and point the pjdfstest
executable at it.

In the future it would be good to add tests for at least NFS and p9fs.

Reviewed by:    asomers
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56605
8fd4d1c0fff8441b42dbab767810db7aeaf796c3 Mark Johnston 2026-06-19 13:27:04
ifmcstat: Fixup getopt args to match reality.
Reviewed by:  emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=ad0e698e642e ("ifmcstat: remove libkvm(3) code")
Event:          BSDCan 2026
22d66952555c86a5b7d1d499b48906c3a5f4c13d Gordon Tetlow 2026-06-20 01:39:50
efitable: Fixup getopt args to reflect guid use.
Correct the manpage to reflect the preference for GUID vs UUID.
Take the long version of --guid for the -g option.
Sort the argument list while we are touching it.

Reviewed by:    imp
MFC after:      1 week
MFC to:         stable/15
Event:          BSDCan 2026
Differential Revision:  https://reviews.freebsd.org/D57695
3a4e049c38143980e472b2926abde3c7549530c4 Gordon Tetlow 2026-06-20 02:59:49
periodic/security: Introduce $security_status_loginfail_ignore for 800.loginfail
Introduce a new variable "security_status_loginfail_ignore" to filter unwanted
login failure messages from the daily security checks.

Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
Co-authored-by: Joseph Mingrone <jrm@FreeBSD.org>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295191
Reviewed by:    jrm
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57671
6a7c8c92245562cfd9b900dedacab99a13d5ca86 Andre Albsmeier 2026-06-19 13:50:00

Libraries

tests/sigtramp_test: xfail on non-amd64
This test fail until at least https://reviews.llvm.org/D155066 is
rebased and picked up for aarch64 and more work is done for the other
archs.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289096
Reviewed by:    jlduran
Fixes:          https://cgit.freebsd.org/src/commit/?id=fef84fd8ae845e19cec0f6b9aac0e6451cca3d7a
MFC after:      3 days
0010c4b8a020dbeb81e61b71117d1caae9b044cc Siva Mahadevan 2026-06-15 22:09:05
msun/logarithm_test: expect_fail log1p_accuracy_tests in the correct spot
While here, remove the conditional on the "ci" config var to ensure that
this is reproducible locally as well.

This fixes a case where we are expecting a fail before the failing ATF_CHECK_*
assertion happens. Found in a CI failure here:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16608/testReport/lib.msun/logarithm_test/log1p_accuracy_tests/

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253984
Fixes:          https://cgit.freebsd.org/src/commit/?id=405188aeac540f7666dfde37c2f32d222119f56e
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57351
19af9c77acc912e4bf90a667924f5f4ff78a7759 Siva Mahadevan 2026-06-17 17:04:54
libmlx5: sync PCI device allowlist with mlx5_core_pci_table
Userspace mlx5_driver_init() only attached when vendor/device matched
hca_table, while the kernel already probed additional Mellanox PCI IDs
That mismatch prevented libibverbs from loading the mlx5 provider on
those HCAs.

Extend hca_table to mirror mlx5_core_pci_table and add cross-references
so future kernel ID additions are paired with a userspace update.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
0e2175cef5027728c0ca1ff98366cf6ecfbe2db3 Slava Shwartsman 2026-05-04 11:19:36
libusb: Sync libusb_class_code with upstream
This reflects the difference from the upstream libusb code.
See: https://github.com/libusb/libusb/blob/master/libusb/libusb.h

Reviewed by:    adrian
Event:          BSDCan 2026
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57620
61e2ffd8168cc0f558ba7effe445573ffe2ad8c3 ShengYi Hung 2026-06-17 19:50:54
Commit group #11: ctermid(3): Fix return values section
ctermid(3): Fix return values section

ctermid() doesn't, and has never, set errno.

While here, add ctermid_r to the name section and align the parameter
name in the source file.

Reviewed by:    bnovkov
Approved by:    bnovkov
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57396
dc24f31b67f5b0bac35cb93470f6f2d065d99f6f Aymeric Wibo 2026-06-19 14:21:12

ctermid(3): Fix return

Reported by:    bnovkov
Fixes:  https://cgit.freebsd.org/src/commit/?id=dc24f31b67f5 ("ctermid(3): Fix return values section")
Sponsored by:   Klara, Inc.
d7c110658e0b11fbe7a1f5d9f2b340d1985b9742 Aymeric Wibo 2026-06-19 14:53:42
libc/dbm: Differentiate between uninitialized and end-of-db cursors
Commit `3a686b851f8f` fixed a `dbm_nextkey` edge case when using
the function after reaching the end of the database, but it inadvertently
broke the following `R_NEXT` behaviour:
"If the cursor is not yet set, this is the same as the R_FIRST flag."

Fix this by adding a new cursor constant that allows us to differentiate
between an unset cursor and a cursor that overflowed.

Reported by:    ae
Fixes:  https://cgit.freebsd.org/src/commit/?id=3a686b851f8f
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57670
Reviewed by:    markj
f879eb3febb6c294d684e8e7fecd5cc396ec5a28 Bojan Novković 2026-06-19 15:24:05
lib/msun/tests: re-enable nan_test on riscv
Commit 1e25cda7f06923d05e28dac8eb1c1c428a5c92dc fixed it.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
52ad4f883489f73e7a876f5cf296bb5a7dc696a2 Siva Mahadevan 2026-06-15 22:27:52

Filesystems

nfs_clvnops.c: Fix the case where va_flags are being cleared
Commits c5d72d2 and 3b6d4c6 broke the case where the
archive/hidden/system attributes are being set false
(UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.)
and the NFS server does not support those attributes.
These patches only checked for support if the
archive/hidden/system attributes were non-zero.

This patch fixes the problem.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296088
Tested by:      Joshua Kinard <freebsd@kumba.dev>
MFC after:      1 week
Fixes:  https://cgit.freebsd.org/src/commit/?id=c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes")
572680712c317b81d66475203ac1b9d6bbeca5d5 Rick Macklem 2026-06-18 00:30:29
nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools
Some ZFS pools do not support va_birthtime and will return
EINVAL when a VOP_SETATTR() of it is attempted.  The MacOS
NFSv4 client sets va_birthtime (TimeCreate) in the same
Setattr with ctime/mtime and other attributes after a new
file is created.  The EINVAL failure leaves these new files
messed up (mode == 0).

This patch pretends the setting of TimeCreate succeeded if
ctime/mtime were also set in the same Setattr RPC, which
resolves the problem for the MacOS client.

If this fix is not sufficient, a new pathconf name to detect
if a file system supports birthtime may be needed.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296066
Tested by:      Will <freebsd.geography231@slmails.com>
MFC after:      2 weeks
b1af05406b5117d76f567056fba0a023a6374465 Rick Macklem 2026-06-18 15:45:27
pfs_readdir(): block the target process from execing
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
4c0a0909f928baac982b7de4bfa5b5ca7de5291a Konstantin Belousov 2026-06-07 19:32:20
pseudofs: ensure that the target process vmspace is stable for VOP_READ/WRITE
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
a4993bac41350e85bc9affb862d2974a1a09bb5e Konstantin Belousov 2026-06-07 19:39:42
nfs_nfsdstate.c: Another unnecessary initialization for gcc
This code hasn't changed in a long time, so I don't know why
this showed up now?
c57fab60daeb2e7a97700699128897a496fdfd6a Rick Macklem 2026-06-21 14:42:19

Kernel

Kernel stuff (other than networking, filesystems, and drivers).

LinuxKPI: add KERNEL_VERSION() macro
Add a KERNEL_VERSION() macro which normally would be in linux/version.h.
On Linux that file is auto-generated and we are supporting more than
one Linux version in LinuxKPI anyway so any further defines in there
would likely be wrong.

Adding the macro helps to support (vendor/out of tree) drivers more
easily which are supporting multiple Linux versions.

MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D57590
c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 Bjoern A. Zeeb 2026-06-13 11:08:00
LinuxKPI: scatterlist.h: implement sg_init_marker()
Add sg_init_marker() which is needed by mt76 drivers USB attachment.

Sponosored by:  The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D57594
3d0b6c69dced4936fccff6733912a0ef93214dbe Bjoern A. Zeeb 2026-02-03 18:29:09
rpcsec_tls: Avoid a socket reference underflow in rpctls_server()
The upcall_sockets tree owns a ref on any resident socket.  When a
socket is removed after a TLS handshake failure, rpctls_rpc_failed()
thus calls soclose().

rpctls_server() does not acquire an extra ref to compensate for this.
So, if the upcall fails, e.g., because rpc.tlsservd is not running,
we'll call soclose() to drop the reference, but this effectively
releases the xprt layer's reference.

Fix the problem by explicitly acquiring a socket reference when adding
a socket to the upcall tree.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289734
Reviewed by:    rmacklem, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57555
fc7993cf2d6ddba9f94683565838bf8fabc0145c Mark Johnston 2026-06-15 15:52:24
netexport: Move struct netexport in a .h file and refcnt it
This patch moves "struct netexport" into a separate
netexport.h file and refcounts the structure, plus adds
a few fields that will be used in a future NFS server
commit.

The patch also includes some helper functions for
handling the netextport structure:
vfs_netexport_alloc(), vfs_netexport_acquire(),
vfs_netexport_release() and vfs_netexport_reset().

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D57553
2e6615b26bb51ceadc99121f16856aad9345a3cf Rick Macklem 2026-06-16 15:35:30
sys: Reserve EXTERR_CAT_LINKER for kld linker exterrors
Reviewed by:  imp, kib (in D57002)
Sponsored by:   The FreeBSD Foundation
6616c7a9a17d1870a7f15aded0b499b1373ba8b0 Jim Huang Chen 2026-05-25 16:23:29
acpi: Constify acpi_stype_to_sstate() and some users
Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57413
554a459ff59969e0f66b1b1c6695d249e2eecd84 Olivier Certner 2026-06-17 03:03:20
kern_linker.c: re-apply some more bits from db887713de2bf5
The definition of the EXTERR_CATEGORY symbol in the .c file is needed
for the script to regenerate identical context of
gen/exterr_cat_filenames.h.

Sponsored by:   The FreeBSD Foundation
9889fac5b82c8de5b55c9ae708d57bc64c10c87a Konstantin Belousov 2026-06-17 07:12:29
socket: Tag all socket option comments consistently
For all the socket options that have a fixed type, add the type of the
socket option arg to the comment. Most of them already had this, but a
few did not. The ones that don't have a tag use a variable length data
structure of some kind, and are beyond the scope of this
commit. Slightly expand the syntax to allow a comma separated list for
those sockopts that have multiple fixed-length versions.

Sponsored by:           Netflix
Reviewed by:            pouria, peter.lei_ieee.org, tuexen
Differential Revision:  https://reviews.freebsd.org/D57545
52c0d52b91e34f9190c9ba8fab7b6bc463bc4cbb Warner Losh 2026-06-17 13:39:05
RDMA: Fix link active_speed size
According to the IB spec active_speed size should be u16 and not u8 as
before. Changing it to allow further extensions in offered speeds.

Linux commit:
376ceb31ff87 RDMA: Fix link active_speed size

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential revision: https://reviews.freebsd.org/D57084
e5d8b775bbf6f378a591211e373859ec44f74149 Slava Shwartsman 2026-05-13 14:54:51
ibcore: Add support for XDR link speed.
Add new IBTA speed XDR, supporting signaling rate of 200Gb.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential revision: https://reviews.freebsd.org/D57085
b3c09af215ee4803fa67ca94301f662d5eca03a0 Slava Shwartsman 2026-05-13 14:20:35
witness: actually set read-only tunables in time for witness_startup
SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be
used for values that are needed before SI_SUB_KLD.  Otherwise they are
tuned after they are needed.  Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for
the debug.witness.witness_count and debug.witness.skipspin sysctls and
add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e.,
in time for witness_startup.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57613
08180f1b613b6fe000135efa28b7c3293cbf1683 Ryan Libby 2026-06-18 03:52:53
witness: add tunables debug.witness.lock_order_{data_count,hash_size}
Add tunable debug.witness.lock_order_data_count to allow adjusting the
number of witness lock order data entries (stacks) without recompiling
the kernel.  This may help to display stacks when a lock order reversal
is reported but the number of entries is exhausted before recording the
first lock order, by allowing the user to reboot with an adjusted
tunable and try again.

Tunable debug.witness.lock_order_hash_size is also provided to allow the
hash table load factor to be managed, though that is not required.

Also tweak witness_lock_order_add to avoid computing a hash when it
won't be needed because the lock order data entries are exhausted.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57600
ca8a1c3c27b0d5915e0dcfd02ea4ef703db4fe9a Ryan Libby 2026-06-18 03:54:26
busdma_bounce: Allocate bounce buffers as unprotected
Reviewed by:  andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56519
8fdaa1b16367d809bca8d4d3ac5e08443353eac1 Sarah Walker 2026-06-18 15:34:14
unix: implement basic SO_PASSRIGHTS functionality
With exception to sockopt functionality, implement the so_options flag
in unix(4) itself.  The general argument for the flag is that SCM_RIGHTS
can be used maliciously for, e.g., a DoS that the receiving side can't
avoid if it is expecting other control messages.

This option gives the receiver a way to disable SCM_RIGHTS on the
sender-side, surfacing an EPERM to them instead.  This seems to match
the semantics that Linux offers.

If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then
a subsequent recvmsg(2) will silently discard any in-flight files.  This
has the downside of punting a file with the potential to hang over to
the deferred-close task, but perhaps usage of the option would
discourage folks from attempting to take advantage of that possibility
anyways.

Various manpages updated to describe the new behavior.

The ru_msgsnd accounting here might need to be re-evaluated: some error
paths will increment it while others will not, and it isn't really
clearly labelled.  At some point in the operation enough work has been
done that one could consider it enough resources to count, but it's not
obvious that it should work this way.  This change doesn't attempt to
address that.

Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D57423
9b16399225f8acfba675cf0a9312dd9eac563ce3 Kyle Evans 2026-06-19 04:03:30
sockets: plumb SO_PASSRIGHTS into *sockopt(2)
This is a little different than the others in that it's not valid for
anything but unix(4) sockets.  New cases were added that jump into the
more standard case out of a light preference for not taking advantage of
case FALLTHROUGH with the additional logic- it doesn't scale very well
for new cases added that might be slightly special, so we might as well
just add the labels up-front.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57424
0ae7df3708dd97515a5bc2a068d25a733c9b2b10 Kyle Evans 2026-06-19 04:03:30
linux: implement SO_PASSRIGHTS
We have a native version now, plumb it through to the Linuxolator.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57427
59bd4840df037a6898b4e9d917a530bce113f053 Kyle Evans 2026-06-19 04:03:30
socket: remove tautological condition in so_unsplice()
so2rele was introduced in 1000cc4a0d3 and it was necessary there, but
the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT
is to be believed: we've asserted that `so2->so_splice_back == sp` and
`sp` has been dereferenced above, so there's no condition left where
we shouldn't release the socket reference at the end.  Indeed, the
change in so_splice() to NULL out sp->dst removes that possible state of
a partially constructed splice: if sp->dst is set, it has been ref'd.

Reviewed by:    gallatin, markj
Differential Revision:  https://reviews.freebsd.org/D57558
8a3d28375450946e4b0de239c9239df54c22d298 Kyle Evans 2026-06-19 04:03:30
jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
jail_attach lets modules do attachment-specific work by calling
osd_jail_call(PR_METHOD_ATTACH).  If one of the modules returns an
error, the call needs to be repeated with the thread's current prison,
so possible earlier modules and undo any changes they may have made.

MFC after:      5 days
e91e8ebefadcce9d57c8ff945ff70050cbbe1ce1 Jamie Gritton 2026-06-19 19:45:27
imgact_elf.c indicate that interpreter is an interpreter
Use a value that do_execve will ignore since there's nothing there to do.
With this we can set the 'indirect' flag on rtld, to prevent direct execution
being used to bypass the 'indirect' flag on python3:

root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
pwned
root@vuefi:~ # veriexec -z enforce
root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
/libexec/ld-elf32.so.1: Operation not permitted.
root@vuefi:~ #

load_file seems missnamed since it is only used by load_interp
so rename it to load_interp_file.

Reviewed by:    imp
Sponsored by:   Hewlett Packard Enterprise Development LP
Differential Revision:  https://reviews.freebsd.org/D57649
389c124fecb04cf6ae2b0f8ab1047c19badec40c Simon J. Gerraty 2026-06-19 20:21:46
Commit group #12: libc
libc: Add atomics C23 feature test macro

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
85becdacf3b043849b240eb1b1b2cde63add0690 Faraz Vahedi 2026-05-01 01:01:20

libc: Restrict ATOMIC_VAR_INIT for C23 conformance

Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed.
Retain it for earlier C standards and for C++ (as it still remains in
C++23, albeit marked as deprecated since C17 and C++20.)

Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to
avoid coupling with a deprecated initialisation mechanism.

No functional change intended for `atomic_init`; this is purely a
conformance and cleanup adjustment.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
28cecfe27964fdb67497800f5dcd5d3e1033727f Faraz Vahedi 2026-05-01 14:34:44

libc: Add missing kill_dependency macro

Add `kill_dependency` as specified by C11 §7.17.3.1.

The macro is required to break dependency chains in
expressions without affecting the value.

No functional impact beyond providing the required,
value-preserving definition.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
9d87c1aac4a84ac5e82acf872f645a7202977204 Faraz Vahedi 2026-05-01 15:41:49

libc: Reorganise memory_order enumeration constants

Place the `memory_order` enumeration constants alongside the corresponding
typedef under the §7.17.3 heading.

The previous layout separated the fallback constant definitions from the
enum, which could obscure their relationship. These fallbacks exist only
to provide values when the compiler does not supply the builtins.

The removed comment encoded implementation-specific assumptions about
compiler-provided definitions and implied a relationship between Clang/GCC
macros and fallback values. In practice, the fallback definitions exist
solely to ensure the enumerators are defined when compiler intrinsics are
absent, and do not depend on any particular numeric mapping.

No functional change; this is a mere structural and clarity improvement.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
e17fddce8978efbc70fc473425bad59b111f4b16 Faraz Vahedi 2026-05-01 17:49:27

libc: Reorder atomic operations to match ISO C standard

Reorder definitions of specified generic operations on atomic types
so they follow the sequence in ISO/IEC 9899:2024 §7.17.7:

1. `atomic_store`
2. `atomic_load`
3. `atomic_exchange`
4. `atomic_compare_exchange`
5. `atomic_fetch`

This aligns the header layout with the standard, making it easier
to cross-check against the normative text and maintain consistency
with the rest of the header.

The behaviour of the macros remains unchanged; this is purely a
reorganisation and documentation improvement.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
cb88e7b8cdd6b4c707e47abee4ba8541d9fccea6 Faraz Vahedi 2026-05-02 03:40:27

libc: Enforce lock-free atomic_flag and C23-safe initialisation

Select the `atomic_flag` backing type according to the C standard
requirements that `atomic_flag` operations be lock-free.

C11 §7.17.1.5 defines `atomic_flag` as:

> a structure type representing a lock-free, primitive atomic flag

and §7.17.8.2 further requires:

> Operations on an object of type atomic_flag shall be lock free

Therefore:

- Prefer `atomic_bool` when `ATOMIC_BOOL_LOCK_FREE == 2`
- Fall back to `atomic_uchar` when `ATOMIC_CHAR_LOCK_FREE == 2`
- Trigger a translation failure if neither type is lock-free

Adjust `ATOMIC_FLAG_INIT` for C23 initialisation rules:

- Use `{ ATOMIC_VAR_INIT(0) }` in pre-C23 modes
- Use `{ 0 }` in C23 and later

Preserve `atomic_flag_test_and_set_explicit()` semantics by
normalising the exchanged value with `!= 0`, ensuring consistent
boolean results regardless of whether the underlying
representation is `atomic_bool` or `atomic_uchar`.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
640ddf8571291ab2965de85f67e6065a4d7efbf8 Faraz Vahedi 2026-05-07 10:25:56

libc: Fix atomic_init for GCC atomic objects

Add a dedicated `__GNUC_ATOMICS` path that initialises via
`atomic_store_explicit(obj, value, memory_order_relaxed)`.

This ensures the required initialisation semantics without
assuming any particular object representation.

Previously, `atomic_init` on GCC fell through to the legacy
`__val` member path intended only for old struct-backed
atomic objects. For current atomic objects, this caused the
following compilation error:

> error: request for member '__val' in something not a
  structure or union

As a result, valid code such as `atomic_init(&x, 1)` failed
to compile when using GCC.

This fix restores compatibility with standard-conforming
callers while other code paths remain unchanged.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
54ac231419cf09557d2f5826b1539e83db552410 Faraz Vahedi 2026-05-07 23:00:47

libc: Fix GCC pointer semantics for atomic_fetch_add/sub

Correct the GCC implementation of `atomic_fetch_add_explicit()`
and `atomic_fetch_sub_explicit()` for atomic pointer types.

The previous implementation passed the operand directly to the
builtins. For pointer objects, this could result in raw byte-wise
address arithmetic rather than the required C atomic pointer
semantics, where the operand is interpreted as a `ptrdiff_t`
element count.

As a result, operations such as `atomic_fetch_sub_explicit(&p, 2, ...)`
could produce an incorrect post-operation pointer value.

Fix this by applying pointer scaling in the GCC path before invoking
the builtin, mirroring the existing legacy fallback implementation.
Pointer operands are now scaled by the size of the pointed-to type,
while integer atomic behaviour remains unchanged.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
26bf9fc3a40275a7aca0ce1809751a90c84b643a Faraz Vahedi 2026-05-08 02:54:23

libc: Fix ATOMIC_VAR_INIT visibility

Fixes:          https://cgit.freebsd.org/src/commit/?id=28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance")
Reviewed by:    fuz, imp
Differential Revision:  https://reviews.freebsd.org/D57724
4c860db34a1b8cff79e7f0d5184423221613e8e1 Dag-Erling Smørgrav 2026-06-21 19:51:14
sys: Add `isgraph()` to <sys/ctype.h>
Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html:

    "graph": Define characters to be classified as printable characters,
    not including the space character.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57578
4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 Jean-Sébastien Pédron 2026-06-12 14:39:21
Commit group #13: linuxkpi
linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_MODE()`

They are the same as their `__ATTR_RO()` and `_ATTR_RW()` equivalents
but they take the file mode as an extra argument.

We now use these new macros to redefine `__ATTR_RO()` and `__ATTR_RW()`
on top of them.

The amdgpu DRM driver started to use `__ATTR_RW_MODE()` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57574
294553b022b1e775111365094a70041934d98501 Jean-Sébastien Pédron 2026-06-12 10:44:36

linuxkpi: Define a bunch of constants in <acpi/video.h>

`ACPI_VIDEO_NOTIFY_PROBE` was already defined. Let's define the whole
set once and for all.

The amdgpu DRM driver started to use `ACPI_VIDEO_DISPLAY_LCD` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57575
53baadc2f6154d738f935a9dcc26648d2b3d89fd Jean-Sébastien Pédron 2026-06-12 13:58:06

linuxkpi: Add `pm_resume_via_firmware()`

This function is unimplemented, always return false.

While here, fix the return type of `pm_suspend_via_firmware()`: it
should be a boolean, not an integer.

The amdgpu DRM driver started to use `pm_resume_via_firmware()` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57580
2e10a6bd562768256f38078b84d95da30e1e2aa1 Jean-Sébastien Pédron 2026-06-12 17:00:31

linuxkpi: Add 'fd_empty()`

The DRM drivers generic code started to use it in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57582
50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 Jean-Sébastien Pédron 2026-06-12 17:55:34

linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()`

`COUNT_ARGS()` counts the number of arguments it is passed. The
implementation is heavily inspired from the one of `CTR()`.

`CONCATENATE()` is an alias for `__CONCAT()`.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57584
af187b20cdb00b89a39dfea1a8eef41ce5c134aa Jean-Sébastien Pédron 2026-06-12 20:21:12

linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional

The previous implementation always took the `len` but now, it is
optional and defaults to the size of `dst`.

The DRM drivers started to use `strscpy()` without the `len` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57585
c27779e0a9546e8b2bfde74b5c9cbf08bbed000e Jean-Sébastien Pédron 2026-06-12 20:22:51
rights(4): fix our representation of the unused bits
The current format seems to be a little confusing, and the version of it
for index 0 was broken by the below-referenced commit.  Break our
UNUSED macros out into one per unused bit to enumerate the entirety of
the space and make it easier to claim an unused one.

Fixes:  https://cgit.freebsd.org/src/commit/?id=b165e9e3ea4e327fc ("Add fchroot(2)")
Reviewed by:    oshogbo (previous version), kib, markj
Differential Revision:  https://reviews.freebsd.org/D57505
57fefbee1f959d0c65376dbdad309d01c182d710 Kyle Evans 2026-06-20 13:55:26
Commit group #14: pNFSd: Add a directory of newly created files for the pNFSd
pNFSd: Add a directory of newly created files for the pNFSd

When an NFSv4.1/4.2 server is configured as a pNFS server,
new file creation (via Open/Create from an NFS client) is
slow, due to the fact that the NFS server (MDS) must do
RPCs against the DS(s).

This patch precreates files in a directory called ".pnfshide/numfiles",
so that the NFS server can just rename them for the Open/Create.
A kernel process called a "replenisher" creates more files in
".pnfshide/numfiles" as required. (At this point, the MDS must
still do Setattr RPC(s) on the DS(s), but that will change when
the pNFS server is converted to the loosely coupled configuration.

This patch only affects the pNFS server and only if the directory
.pnfshide/numfiles exists in the exported file system.

Reviewed by:    kib
Discussed with: markj
Differential Revision:  https://reviews.freebsd.org/D57554
d8e8f9251975b68fe9c73e39074e0f211ec2145e Rick Macklem 2026-06-20 18:43:45

nfs_nfsdport.c: Do unnecessary initializations to quiet gcc

Fixes:  https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
61152df00aee248bec2ef267c092b6004e25f6d6 Rick Macklem 2026-06-21 00:06:45

nfs_nfsdport.c: One more unnecessary initialization for gcc

Fixes:  https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
fa515f60fce0edd09d0b1078852ec06b1cd0a74c Rick Macklem 2026-06-21 02:53:06
da: Put the SYNC CACHE probing behind bootverbose
These have turned out to be too noisy, so put them behind bootverbose

Event: BSDCan 2026 (noticed during UFS demo)
Sponsored by: Netflix
MFC After: 2 weeks
eafa181d51f712f189ae4558014d8d00de7c5624 Warner Losh 2026-06-20 20:53:32
Commit group #15: execve_block(): a mechanism for mutual exclusion with execve() on the process
execve_block(): a mechanism for mutual exclusion with execve() on the process

A consumer of execve_block(9) is synchorized with the execution of
execve(2) family of syscalls, ensuring that execve_block region is
mutually exclusive with the execve processing. Either execve_block() or
execve() would sleep until other finishes.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e1a84b7708c2514769625c2af6c5034694013b6a Konstantin Belousov 2026-05-26 17:36:20

kern_exec.c: explicitly include sys/limits.h for UINT_MAX

While there, remove unneeded manual inclusion of sys/cdefs.h.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
f5fce0bcc370a9700249e64901eabf2e0be4ecb0 Konstantin Belousov 2026-06-21 14:17:41
execve_block_pass(9): a helper to wait for the execblock to pass
Tested by:    pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
450fe67d19eb2ea8e27109214ff21064fdcf808c Konstantin Belousov 2026-06-17 19:06:50
proc: Allow to make proc_rwmem() operate on a consistent address space
Provide proc_vmspace_ref() to safely obtain the reference to the target
process vmspace, optionally
- requiring that the target cannot execve(2) and thus cannot change its
  vmspace until vmspace in unreferenced
- requiring the check of permissions of the caller after the vmspace
  reference is obtained, since the process lock might have been dropped
  in the process.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e1b0d051bbf7e4e730470cbd6622f71a639834c3 Konstantin Belousov 2026-06-07 17:57:06
Commit group #16: kern_proc.c
kern_proc.c: ensure stability of the vmspace we read the strings from

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
a22c044cce41864a32af6b8281a3c416a2664d7f Konstantin Belousov 2026-06-07 19:12:54

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
5fe6e08d2db56b530f0df2903ef24cfabab7b8ea Konstantin Belousov 2026-06-14 23:49:20

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
31fa677e4af00b795bf671847b4dc72960c90f14 Konstantin Belousov 2026-06-14 23:49:20

kern_proc.c: make kern.proc.osrel atomic

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
80626f34ee985671bb8c60ee986b89587b7a1511 Konstantin Belousov 2026-06-15 17:28:15

kern_proc.c: disallow execve around sysctl kern.proc.kstacks

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
8b5abd9027b8b1f6290c756730ee3adebed007f4 Konstantin Belousov 2026-06-15 17:57:47

kern_proc.c: disallow execve around sysctl kern.proc.rlimit

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589 Konstantin Belousov 2026-06-16 04:30:10
kern_event: block the target process from execing for sysctl kern.proc.kqueue
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
79b384bd8fdff4869ce4799edb0342ff5c25b6fa Konstantin Belousov 2026-06-16 03:48:29
kern_resource.c: disallow execve around sysctl kern.proc.rlimitusage
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
836749817036b90b60af0584fa21f2d9dbd60ff7 Konstantin Belousov 2026-06-16 04:34:16
kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
6a572920f251ac8ac6a80a55d4d039736ea7dd65 Konstantin Belousov 2026-06-15 13:32:47
linux_prlimit(): block execve for the target
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e41c28e67fac9cd22a85b160c5c9d0477ed03600 Konstantin Belousov 2026-06-07 19:21:40
procfs, linprocfs: ensure target process vmspace stability
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
5db31f1b47b586a5091eb41fc957236f28b78dba Konstantin Belousov 2026-06-07 18:48:59
sys_set*id(9): wait for the execblocks to pass
to ensure stability of the process uid/gids during the
p_cansee()/p_candebug()-protected regions.

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
d0384f50dad25d3358d76f7556969ea1d515ba68 Konstantin Belousov 2026-06-17 19:07:22
uiomove_*: centralize the copy function selection
Add a uiomove_step() for the central set of switch statements which
choose between userspace and kernel and if data is going to or from the
iovec.

Refactor uiomove_fromphys loops to unconditionally free per-iteration
resources and drop gotos.

While here, switch from bcopy to memcpy.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57688
fc9b28879e8935cc830b83d8a36d85b9b98b276a Brooks Davis 2026-06-21 15:47:53
uipc_socket: prefer memcpy to bcopy
Reviewed by:  kib, emaste
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57689
8b47939b952248e68c3ee64b8577c636bc90ca53 Brooks Davis 2026-06-21 15:48:33
gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd
After the conversion to using netlink, the kgssapi had
no way of knowing if the gssd daemon was running.
As such, a boot where the kgssapi is loaded, but the
gssd is not enabled would hang the nfsd for a very
long time. (Many timeouts at 300sec each.)

This patch adds a Null RPC upcall with a 200msec
timeout to check to see if the gssd is running.
If the gssd is not running, the nfsd starts up
(without Kerberos support) with only a 200msec
delay.)

Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
to before the daemon() call, so they are guaranteed to have
been done before the nfsd(8) daemon is started by
the rc scripts.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295714
Reviewed by:    glebius
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57455
455c354dd4dbba9b9ec9c68e335ab3aa46dca438 Rick Macklem 2026-06-21 23:15:23

Build system

packages: Fix building packages when WITHOUT_BLOCKLIST is set
Reviewed by:  emaste
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D57601
cd0a101b01d685092d073a367f0e7374f7259256 Brad Davis 2026-06-15 17:59:19
build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them.  NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.

This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.

This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE
needlessly.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881
Reviewed by:    markj, sjg (both previous version)
Differential Revision:  https://reviews.freebsd.org/D57356
13184a69faa700319ab16357cd39708a0e89fc15 Kyle Evans 2026-06-17 22:40:46
Update dirdpes.mk et al
Update to latest dirdeps related makefiles.

dirdeps.mk tweaks useful for universe among other corner cases.
           also additional filtering for bogus paths ending in /

gendirdeps.mk allow more debugging
           also additional filtering for bogus paths ending in /

install-new.mk fix bug when isPOSIX_SHELL is true

meta2deps.?? handle file names with spaces by ignoring them

Reviewed by: stevek
Differential Revision:  https://reviews.freebsd.org/D57683
7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Simon J. Gerraty 2026-06-19 20:29:25
Source upgrade doc: etcupdate no longer needs -B
Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
704db3fe9840ee3e51b080b7c35defd1a74c0c2d Alexander Ziaee 2026-06-21 17:54:12
meta.autodep.mk remove extra }
remove extra } from GENDIRDEPS_ENV

more debug output for gendirdeps.mk

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D57727
c37839dc7b6a4d5f2c4d5bddda6595782a83dae4 Simon J. Gerraty 2026-06-21 19:19:29

Internal organizational stuff

bsd-family-tree: add FreeBSD 15.1
f8b5df434e419e00272bfce343bf7da239081276 Maxim Konovalov 2026-06-16 12:34:28

Testing

tests: Fix build if TIOCSTI is not defined
Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI

We already have some components (such as mail and tcsh) that build
without TIOCSTI defined.  This is (existing portability support in those
projects.

Simplify things for downstreams by extending this approach to this
additional TIOCSTI user.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D50614
52a2b4bc5da21d7a54cb16b9450196244b59b8c0 Ed Maste 2025-05-30 15:58:41
tests/pf/route_to: check_random: rely on test timeout to fail
This test is known to be flaky if 10 attempts happens to be
not enough for the test to pass. Usually, this test passes in ~4-6 attempts.
See https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28664/testReport/junit/sys.netpfil.pf/route_to/random_table/

Rely on the timeout (default 5 mins) to catch a failure here, rather than just 10
attempts. It's very unlikely that 5 mins worth of attempts still isn't enough.

For a history of flakiness, see
https://ci.freebsd.org/job/FreeBSD-main-amd64-test/lastSuccessfulBuild/testReport/junit/sys.netpfil.pf/route_to/random_table/history/

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289477
Reviewed by:    kp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57408
1294f332aec02e111b47d69e0d91e32dc2624001 Siva Mahadevan 2026-06-17 16:52:00
tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload
This is almost a trivial factoring, but it's still a bit of boilerplate
that we don't care to rewrite- the SO_PASSRIGHTS test will still receive
some data, so the iovec construction still saves us a few lines.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57544
2f363febf8bf5c3e9ffad95b5998b461adc77c28 Kyle Evans 2026-06-19 04:03:30
tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS
We test both the standard case where we want to reject any SCM_RIGHTS
message, as well as the case where the kernel discards the unwanted file
upon receipt.

Reviewed by:    glebius (previous version), markj
Differential Revision:  https://reviews.freebsd.org/D57426
c08a86e0c6d989c926c2777c978155dde7d0697a Kyle Evans 2026-06-19 04:03:30
tools/regression: Expand stdatomic conformance tests
Extend the existing test utility to cover recent stdatomic
changes and improve validation of interface semantics,
compile-time assertions, and behavioural conformance.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
0f8941fedce6c622f0fa71464b7790225aefa3e6 Faraz Vahedi 2026-05-08 11:40:02
Commit group #17: sound tests: Add PROT_EXEC rejection test
sound tests: Add PROT_EXEC rejection test

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
730eaf466493315c1d1164eb6b59b14766f49322 Christos Margiolis 2026-06-12 06:20:26

sound tests: Remove trailing PROT_EXEC

Fixes:          https://cgit.freebsd.org/src/commit/?id=730eaf466493 ("sound tests: Add PROT_EXEC rejection test")
Reported by:    Oliver Pinter <oliver.pntr@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
f6b3bd1f3384d262b893af123f3fc2df21c5b9ee Christos Margiolis 2026-06-21 12:17:39

Style, typos, and comments

These could go in other categories, but it's more clear if they're here instead.

jail.8: Fix two typos in the manual page
- s/Similarily/Similarly/
- s/passtrough/passthrough/

MFC after:      5 days
d9e0452f0c8af6b0c03b0bb2e3b824095021e168 Gordon Bergling 2026-06-15 09:07:24
mixer.8: Fix a typo in the manual page
- s/thet/the/

MFC after:      5 days
10b1a35d11866462b5e776015a1b79f4f8f704a6 Gordon Bergling 2026-06-15 09:10:52
pnfs.4: Fix a typo in the manual page
- s/Wihout/Without/

MFC after:      5 days
f930d8a6540648423288567ff473123ff5647484 Gordon Bergling 2026-06-15 09:14:20
pwd.1: Fix a typo in the .dD
- s/Februrary/February/

MFC after:      1 week
586a5bc03541397c432ce98a1551ebeee7c04ef2 Gordon Bergling 2026-06-15 13:40:05
rtw88: Fix typo in portability glue
Fix typo in if statement for compiling rtw88 against a Linux target.

Signed-off-by: Lambert Lim <lambert@sanesecurityguy.com>
Reviewed by: imp,ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/2262
4b146555d39d9fb826bf4524df9e00eb8dad2bfe Lambert Lim 2026-06-05 09:00:20

Contrib code

ldns: Update to 1.9.1
Merge commit '026e5b88eb0cde54d9fc22b9a1ebc79ea0f67aec'
4593470d16714d83ac06a3ccc319f998a02ced07 Dag-Erling Smørgrav 2026-06-19 07:24:23
lsnd: Update to 1.9.2
Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780'
63442ceae5ed31ad45e401f5fe0010b824bc2b38 Dag-Erling Smørgrav 2026-06-19 07:26:20

Reverted commits

Revert "kldload: Improve error handling"
It broke the test suite, and will be recommitted when fixed.
This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155.

Reported by:    markj
9a10af53dbf5b1268d6b74e94f2f8054caab9243 Ed Maste 2026-06-16 15:06:17
Revert "rpc.tlsservd.c: Pin max threads at 1 for now"
This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e.

Hopefully, commit fc7993cf2d6d has fixed the underlying
problem reported by PR#289734, so I am reverting this
temporary work-around.

I will delay MFC'ng this for a while, to see if the
problem occurs again.

MFC after:      3 months
62e7ac83ae14fcc1847d607e98284bd4a98e7127 Rick Macklem 2026-06-16 16:15:25

Unclassified commits

Not classified automatically, and waiting for manual attention.

-- no commits in this category this week --

Technical notes

Dates:

Automatic grouping:

Automatic categories:

Source code:


Generated with commits-periodical 0.20 at 2026-07-13 17:53:14+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-06-15 (debug) (contains info about the classification)