FreeBSD git weekly: 2026-10-05 to 2026-10-11

Introduction

This is a display of mostly-automatically-classified git commits from 2026-10-05 to 2026-10-11.

DEBUG: This version of the report is primarily for checking the classifiers, and therefore contains extra information (in this colour).

Table of contents and commits per category:

(0) Highlighted commits (these are copies, not in stats)
1 0.5% Userland programs
5 2.4% Documentation
70 33.3% Hardware support
20 9.5% Networking
24 11.4% System administration
11 5.2% Libraries
5 2.4% Filesystems
31 14.8% Kernel
12 5.7% Build system
4 1.9% Internal organizational stuff
3 1.4% Testing
3 1.4% Style, typos, and comments
14 6.7% Contrib code
7 3.3% Reverted commits
0 0.0% Unclassified commits
210 100% total
Technical notes about this page

debug: info about the automatic classification

num % num changed stage
7 3.3% 0 00-reverts
4 1.9% 0 01-style
16 7.6% 0 02-filenames_wildcards
3 1.4% 0 02b-filenames_wildcards2
131 62.4% 0 03-filenames_plain1
45 21.4% 0 04-filenames_plain2
1 0.5% 0 05-summary-prefix
3 1.4% 0 Manually-classified commits
0 0.0% 0 Unclassified commits

debug: more stats

num % stage
0 0.0% Misclassified commits
207 98.6% Classified commits, no corrections

debug: groups

6 2.9% num in revert
5 2.4% num in fixes
54 25.7% num in consecutive
65 31.0% Commits in groups

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.

-- no commits in this category this week --

Userland programs

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

whereis: Fix list size calculation.
Use nitems() to calculate the number of elements in sourcepaths.

Reviewed by:            fernape@, ngie@
Approved by:            ngie@
Fixes:                  https://cgit.freebsd.org/src/commit/?id=3963483523a4
Sponsored by:           Intel Corporation
Assisted-by:            Github Copilot (GPT-5.6 Terra)
Differential Revision:  https://reviews.freebsd.org/D60368
e7b019fbf1a0f02386a8d02eac4a691f112cc242 Krzysztof Galazka 2026-10-07 15:24:05

debug: classified in 04-filenames_plain2 by 'usr.bin/'

Documentation

Man pages, release notes, etc.

inotify.2: Add some entries to the BUGS section
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
fa6fe034a73c8b17320d1e68767ad2aa99eaa8bf Mark Johnston 2026-10-07 14:36:46

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

dhclient-script(8): s/URI/URL
Reported by:  glebius@
6c305c3c3129c4b90d22fdea5092788549bf7992 Baptiste Daroussin 2026-10-07 20:04:42

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ports.7: Document how to use mdo(1) for SU_CMD
Reviewed by:  olce
MFC after:      1 week
Sponsored by:   fme AG
Differential Revision:  https://reviews.freebsd.org/D60443
8eb863097f264794eccd8ef7cdaf95aa80260353 Mateusz Piotrowski 2026-10-07 14:11:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ulimit(3): Improve UL_{GET,SET}FSIZE wording
Reword the UL_GETFSIZE and UL_SETFSIZE descriptions to say 512-byte
blocks and make the setter's argument clearer.

While here, improve mdoc markup and pull in other small improvements.

Reviewed by:    des
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D60467
d39b1d6932dcc16b7c8a399d196fd81d038ca261 Aymeric Wibo 2026-10-08 14:17:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

acl(9): expound on NFSv4 constants' meanings
This change adds missing documentation for various NFSv4 constants
supported by acl(9).

Bump `.Dd` for the change.

MFC after:      1 week
Reviewed by:    rmacklem
Differential Revision:  https://reviews.freebsd.org/D58736
7a48c3fd3e6ea097a8fa8f3ce3e25fe7c2d37d9e Enji Cooper 2026-10-10 07:27:35

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

Hardware support

Hardware drivers and architecture-specific code.

powerpc: keep FP, VMX and VSX ownership changes atomic with preemption
trap() and set_mcontext() change the FP/VMX/VSX ownership state in
several steps with preemption enabled.  A context switch in between
leaves the thread computing with another thread's register contents:

- enable_fpu()/enable_vec() set PCB_FPU/PCB_VEC before loading the
  registers, so a switch mid-load saves a half-loaded unit over the PCB.
- set_mcontext() clears the frame's MSR bits and then the PCB flags;
  a switch in between re-enables the unit, and the thread returns to
  user space with it enabled but not owned, so it is neither saved nor
  restored until the next signal.

Both paths run after every sigreturn(2), setcontext(2) and
swapcontext(3).  A POWER9 test that keeps f14-f31 live across a signal,
with other threads using the FPU on the same CPU, saw 283 corrupted
round trips out of 882000; none after this change.

Hold a critical section around both, as amd64 and arm64 do.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60054
1f1043d550ea2b8282e692019f17a88896212a76 Piotr Kubaj 2026-09-21 12:48:06

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

igc: Fix the flow control sysctl
dev.igc.N.fc read and wrote a function-static variable shared by every
igc device, so a read returned the last value written to any of them (3
until the first write), not the state of the device.  The softc value
started as 0, which is also the value of "no flow control", while the
hardware was set up for full flow control.  As a result:

- Writing 0 was taken for no change and did nothing, unless another
  value had been written to that device before.
- igc_reset() took a softc value of 0 for "not set", so a device set to
  0 went back to full flow control on the next init.
- With more than one receive queue the driver enabled per-queue drop
  (SRRCTL.DROP_EN), which is meant for a MAC that does not send pause
  frames, although the MAC was told to send them.
- Values out of range were accepted and ignored.

A write only forced the MAC's flow control bits.  The pause bits
advertised to the link partner, the pause thresholds and DROP_EN stayed
as the last init had set them, and the next link event resolved flow
control from the stale advertisement again: a port set to 0 came back
honoring pause frames, for example.

Start the softc value as full, report it, use it as it is in
igc_reset(), reject invalid values, and apply a change by
reinitializing the interface, as the dmac and eee_control sysctls do.

Two things behave differently now.  Changing the mode of a running
interface takes the link down to renegotiate.  And with the default
mode and more than one receive queue DROP_EN is no longer set: a full
receive ring makes the MAC send pause frames, and holds up the other
queues, where it used to drop that queue's packets.  Setting fc to 0 or
1 selects per-queue drop.

Tested on I226-V ports with four receive queues: for each mode, the
flow control bits in CTRL, the pause thresholds and DROP_EN were read
back, and the mode the link partner resolved, also after a down/up.

Reviewed by:            gallatin
Fixes:                  https://cgit.freebsd.org/src/commit/?id=517904de5cca ("igc(4): Introduce new driver for the Intel I225 Ethernet controller.")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60363
68386f6b551e64c956c9623b9973be9e462ce1de R. Christian McDonald 2026-10-05 14:01:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64/gicv5: Use ArmMpidr to find the correct CPU
The GICv5 ACPI code uses CpuInterfaceNumber to as the CPU ID. This a
GICv5 CPU ID and may not be the same as the appropriate FreeBSD value.

It is also possible the target CPU is disabled, e.g. when the hw.ncpu
tunable is uses to limit CPUs. If this is the case we don't want to
enable the CPU in the cpu set as it is offline so cannot handle
interrupts.

Switch to use ArmMpidr to find which pcpu to use when finding which
CPUs the IRS is attached to.

Fixes:  https://cgit.freebsd.org/src/commit/?id=9556306213e1 ("arm64: Add ACPI support to GICv5 driver")
Differential Revision:  https://reviews.freebsd.org/D59993
Sponsored by:   Arm Ltd
412c3a0370491c6745e056266f54ce9aa67017e1 Andrew Turner 2026-10-05 13:31:02

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64: Elide coherent busdma maps
Avoid allocating per-transfer maps for coherent tags that cannot
bounce. Retain maps for cache synchronization, CCA realms, and KMSAN.
These un-used maps carry with them memory and cache miss overheads.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D60098
Sponsored by: Netflix
16c787fbabb8077df1af3bd3baaddf3b4c0dd8e8 Andrew Gallatin 2026-10-05 14:56:10

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

acpi: Tasks: Remove unnecessary includes
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2165accd3748c0acb6e82756d71a46509b220fd8 Olivier Certner 2026-10-02 17:11:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi: Tasks: Document why 'acpi_task_count' is accessed unsynchronized
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
e89c3ac5df58a9eae9d01f325ffc9b34258c4b29 Olivier Certner 2026-10-02 17:14:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'

e1000: Fix the flow control sysctl
dev.em.N.fc and dev.igb.N.fc read and wrote a function-static variable
shared by every em(4) and igb(4) device, so a read returned the last
value written to any of them (3 until the first write), not the state of
the device.  The softc value started as 0, which is also the value of
"no flow control", while the hardware was set up for full flow control.
As a result:

- Writing 0 was taken for no change and did nothing, unless another
  value had been written to that device before.
- em_reset() took a softc value of 0 for "not set", so a device set to 0
  went back to full flow control on the next init.
- On igb(4) with more than one receive queue the driver enabled
  per-queue drop (SRRCTL.DROP_EN), which is meant for a MAC that does
  not send pause frames, although the MAC was told to send them.
- Values out of range were accepted and ignored.

A write only forced the MAC's flow control bits.  The pause bits
advertised to the link partner, the pause thresholds and DROP_EN stayed
as the last init had set them, and the next link event resolved flow
control from the stale advertisement again.  On 82577 and 82578 (pchlan)
a write could also turn on transmit flow control, which em_reset() keeps
off there as a workaround.

Start the softc value as full, report it, use it as it is in em_reset(),
reject invalid values, and apply a change by reinitializing the
interface, as the dmac and eee_control sysctls do.  This is the same fix
as 68386f6b551e ("igc: Fix the flow control sysctl"); igc(4) inherited
the handler from this driver.  On pchlan, remove transmit pause from the
requested mode instead of replacing the mode with receive pause, so that
the workaround stays and 0 still turns flow control off.

Reviewed by:            kbowling
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60376
481447ad9be2e60e0bb3744ab199ce121baadf84 R. Christian McDonald 2026-10-05 20:21:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: handle delayed IBS NMIs on Zen 6
On Zen 6, an extra IBS NMI can arrive after later samples. Keep the
credit until the empty NMI arrives, and handle fetch and op samples when
both are ready.

Reviewed by:    mhorne
Fixes:  https://cgit.freebsd.org/src/commit/?id=34b00ed041a4 ("hwpmc: fix IBS fetch and op NMI handling")
Fixes:  https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60367
572cd669d6997b759084191007f3744a3610b529 Andre Silva 2026-10-06 18:42:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv: support the new "riscv,isa-extensions" string-array.
Support the new "riscv,isa-extensions" property on RISC-V hart nodes
in FDT.

The "riscv,isa" property is deprecated, but cannot be removed because
doing so would break compatibility with existing DTBs. The new properties
replace it: "riscv,isa-base" describes the base ISA and
"riscv,isa-extensions" is a string array containing the supported ISA
extensions.

The "riscv,isa-extensions" property can be relatively large; on the
Spacemit K3 SoC it is approximately 300 bytes.

The FreeBSD OFW interface does not provide access to the underlying FDT
property data without copying it, and memory allocation is not possible
this early. So allocate a static buffer for the property instead.

Reuse the existing parse_riscv_isa() implementation to parse both the new
extension property and the legacy "riscv,isa" property.

Reviewed by:    bnovkov, mhorne
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60209
3e01ebda68291db307a5e6c23d4995c638be9228 Ruslan Bukin 2026-10-06 18:55:39

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

pcm.4: Remove DIAGNOSTICS section
These diagnostics do not exist anymore.

MFC after:      1 week
25faf861089ca119528ea4da39fe594b1c5ca55a Christos Margiolis 2026-10-07 07:03:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: fix kernel panic on attach failure
When device initialization fails during attach (for instance, if device
resource configuration or firmware negotiation fails), the driver aborts
and unrolls partial state via its detach routine. However, the teardown
path assumes transmit and receive queues have already been created. If
attach aborts before queue allocation, tearing down the uninitialized
queues triggers a NULL pointer dereference and panics the kernel during
boot.

Guard queue teardown against uninitialized queue state so that early
attach failures unwind safely, allowing the driver to report the failure
gracefully without crashing the operating system.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Reviewed by:    adrian, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60385
d45b063c06d46d0f43489708e226821cddbad53b Jasper Tran O'Leary 2026-10-07 13:29:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: fix double free on ring allocation failure
When gve_alloc_rings fails (such as when failing to acquire MSI-X
vectors or during partial ring allocation), ring cleanup can be
executed multiple times across nested error paths (e.g. within
gve_alloc_rings abort and gve_attach abort).

Because gve_free_counters invoked counter_u64_free without nullifying
the pointer in the stats array, repeated invocation caused a double-free
panic when freeing the same counter references.

Check for non-NULL before freeing and nullify each counter pointer
upon release in gve_free_counters.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Reviewed by:    adrian, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60386
67f85bf4b3f1156f2300fb6414f6bb0ca446c436 Jasper Tran O'Leary 2026-10-07 13:29:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: a local TLB invalidation suffices when enabling write access
When a PTE logically supports write access, as indicated by its DBM
field, but write access is nonetheless blocked by the PTE's protection
field, pmap_fault() can enable write access with only a local TLB
invalidation.

Reviewed by:    andrew, kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60417
7dd9a8125f70f1fc40fd9907bdaae0d23c8586c9 Alan Cox 2026-10-06 04:53:00

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

ipmi(4): improve debugging for ioctl(IPMICTL_SEND_COMMAND)
Add a knob to debug ioctl(IPMICTL_SEND_COMMAND). Log the IPMI NetFn and
Cmd fields, followed by a hexdump of the request data. Upon completion,
log the hexdump of the response data.

Reviewed by:    adrian, imp, ngie
Sponsored by:   Vdura
Differential Revision:  https://reviews.freebsd.org/D59514
bf97446e34abfe096d91d8c2bd49ea9a50d2227d Ravi Pokala 2026-10-08 04:01:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iwx: update if_iwx.c to OpenBSD v1.184 and if_iwxreg.h to OpenBSD v1.53
This updates iwx to the given OpenBSD versions upstream.

This is a squashed commit of the given differential revisions
and openbsd upstream commits.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59757
Differential Revision:  https://reviews.freebsd.org/D59758
Differential Revision:  https://reviews.freebsd.org/D59759
Differential Revision:  https://reviews.freebsd.org/D59760
Differential Revision:  https://reviews.freebsd.org/D59761
Differential Revision:  https://reviews.freebsd.org/D59762
Differential Revision:  https://reviews.freebsd.org/D59763
Differential Revision:  https://reviews.freebsd.org/D59764
Differential Revision:  https://reviews.freebsd.org/D59765
Differential Revision:  https://reviews.freebsd.org/D59766

Obtained from: OpenBSD, dd37084bb9bbc1cb63137a98072e149306cc2e2a
Obtained from: OpenBSD, 521eb4f37a87f4d1ba6b3aa685721d015525efb4
Obtained from: OpenBSD, 177f96ae5464c4393971d72a9703f84ba84ad60c
Obtained from: OpenBSD, be47d0a5f00c62ce8dd784cf7f90f635203434ae
Obtained from: OpenBSD, 1fe292d1a480241213e618a905fef43d03ac65ca
Obtained from: OpenBSD, 41713280ddbe6fa1b12833163070617fa75d6e43
Obtained from: OpenBSD, 844e213d50c754e415ff22924cb86e86d4d63002
Obtained from: OpenBSD, 9fb1f10bfcbfc611a885a088a1658b52427addcb
Obtained from: OpenBSD, 3b9d585e0ce86bc6eed0b4493f3c73d741778f91
Obtained from: OpenBSD, 22f856c70e6211679c512ca0726f3c6f6a152dde
6f5803e375fe2214f1fb8f1e1378ab006b196adc Idwer Vollering 2026-10-08 04:13:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_gpu: use an X8R8G8B8 resource on big-endian guests
The virtio-gpu resource formats are defined by byte order in memory,
while vt(4) and the X server (through vt_fb and the fb mmap) write
native 32-bit 0x00RRGGBB pixels into the shadow framebuffer.  On a
big-endian guest such as powerpc64 those pixels land in memory as
00 RR GG BB, which the host interprets under B8G8R8X8 with red and
blue swapped and the padding byte taken as blue: white renders yellow
and blue renders black.

Request X8R8G8B8 on big-endian guests instead, which is also what the
Linux driver does (DRM_FORMAT_HOST_XRGB8888).  Reproduced with a colour
test pattern on a powerpc64 QEMU pseries guest using the identically
coded out-of-tree fork of this driver (graphics/virtio-gpu-qemu-kmod);
little-endian guests are unchanged.

Differential Revision:  https://reviews.freebsd.org/D60085
Approved by:    jhibbits
MFC after:      1 week
7cf02164a517824c07faed91c009be90f2f17ec0 Piotr Kubaj 2026-09-28 08:43:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sound: Remove obsolete comment from sound.h
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
20381bce4b63975494a2f4bc84257f6932e6d379 Christos Margiolis 2026-10-08 13:11:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

libpmc: fix the family check for the AMD DF event encoding
The check compares cpu_family with decimal 19 instead of 0x19, so
Families 17h and 19h get the Family 1Ah DF encoding.

Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=00c0a1f0bf6c ("hwpmc: Fix PMC flags for AMD Zen cores")
MFC after:      3 days
Sponsored by:   AMD
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2461
ca9c5718017fc34d34f2dfe90020644aad3588d3 Osvaldo Janeri Filho 2026-10-08 09:43:59

debug: classified in 03-filenames_plain1 by 'lib/libpmc/'

hwpmc: return errors from PMC_OP_PMCGETMSR
pcd_get_msr() returns a positive errno, but only a negative value was
treated as a failure, so errors were reported as success.

Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   AMD
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2461
911fcebfc7f1e5a5dd184137c0b9d62b4b066f17 Osvaldo Janeri Filho 2026-10-08 09:44:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvmf: Limit namespace character device I/O size
Set si_iosize_max for namespace character devices matching the fix
from commit 125ec0e30785bb0cbca7aa6c0b1a34b75e53078d.

Sponsored by:   Chelsio Communications
3b0eacaed3cf9157baf04ab11243aedf816ac976 John Baldwin 2026-10-08 15:24:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'

usbdevs: Add ublox LARA-L6
The device has multiple PIDs as it supports different USB profiles.

Approved by:            adrian
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D60482
95432767ddc36fd1f6b0054e4eb1a849c73e7da6 Joel Bodenmann 2026-10-08 15:36:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: avoid full icache flushes on PIPT icaches
On many arm64 processors, the kernel plays a part in maintaining
instruction cache (icache) coherence as the contents of the underlying
physical pages change.  Previously, the only mechanism for maintaining
icache coherence implemented by the machine-dependent layer was a full
icache flush.  However, on machines with physically indexed and
physically tagged (PIPT) icaches, where aliasing cannot occur, we can
instead selectively invalidate just the affected cache lines.

Reviewed by:    andrew
Tested by:      markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60271
a66236edbf7182fcb1407590a8021f1e40adc05d Alan Cox 2026-09-29 15:37:35

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

Commit group #0: if_bnxt
if_bnxt: consolidate readl_fbsd/writel_fbsd and fix BAR mapping

There are multiple duplicates of readl_fbsd and writel_fbsd spread
accross bnxt_en and bnxt_re drivers. Move a single definition into bnxt.h as static
inline, shared by bnxt_en and bnxt_re, using the correctly sized
bus_space_read_4()/bus_space_write_4() accessors, and drop the other
two copies along with their declarations.

Also, Fix the BAR selection while at it: bar_idx 0 addresses BAR0 (the
HWRM bar) and bar_idx 2 addresses BAR2 (the doorbell bar), matching
every call site (e.g. BNXT_FW_HEALTH_REG_TYPE_BAR0/BAR1 in
if_bnxt.c) and bnxt_pci_mapping()'s own bnxt_map_bar() calls, but
both old copies and bnxt.h's own inline had the two bars swapped.

Add BNXT_HWRM_BAR_IDX/BNXT_DOORBELL_BAR_IDX macros for the two valid
bar_idx values and use them at every readl_fbsd()/writel_fbsd() call
site plus bnxt_pci_mapping(), instead of bare 0/2 literals. Any other
bar_idx is a programming error, so readl_fbsd()/writel_fbsd() panic
on it rather than silently guessing a BAR.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58995
9ff4cca75c727a5b65f279fe4bc66e71abb305a1 Sumit Saxena 2026-08-18 16:49:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add RX timestamping support

Add PHC register mapping, RTC initialization, refclk read with
FW-reset serialization, and sbinuptime-based calibration to convert
the raw hardware timestamp carried in RX completions into an mbuf
timestamp. Advertise IFCAP_HWRXTSTMP, configure the RX timestamp
filter in bnxt_init(), and drain the calibration callout on stop.
Check HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED in
bnxt_hwrm_func_qcaps() so the capability bit PTP is gated on actually
gets set, without which PTP never armed on real hardware.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58596
f2c300112ea491d69799c5a1085b57c48acef713 Sumit Saxena 2026-08-18 21:00:11

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add CAGR interrupt coalescing tick-resolution support

Add the P7 CAGR (Completion AGgregation Ring) NQ-aggregation timer
tick-resolution knob, programmed via a direct GRC-window register
write, with a new dev.bnxt.<unit>.cagr_tick_res read-only tunable.
This is independent of the existing per-ring AGGINT_PARAMS coalescing.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58598
2f3a1ebba81266b5f21640f88d73e03415cf13be Sumit Saxena 2026-07-29 08:36:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add HW-based TX completion coalescing

When firmware advertises BNXT_FLAG_TX_COAL_CMPL, request coalesced
completions via cmpl_coal_cnt on TX ring alloc and decode the
resulting tx_cmpl_coal_t records using a free-running SQ consumer
index per ring, instead of one completion per BD. Add the
tx_hw_coal_cnt sysctl to tune the firmware coalescing count code.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58599
9e69060da5eaa4a596be96a4a84b6484661466aa Sumit Saxena 2026-08-03 09:06:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add host-based TX completion coalescing

Suppress per-BD completions (TX_BD_LONG_FLAGS_NO_CMPL/_COAL_NOW) and
accumulate a running_bds count per ring, forcing a real completion
when iflib requests one or when the count nears overflowing the
opaque bd-count field. Replaces the previous raw (bd_count << 24 |
idx) TX completion opaque encoding, which only had 8 bits for the
count and would overflow well within these coalescing thresholds,
with a tx_bd_opaque bitfield (16-bit idx + 15-bit bds + 1-bit
ktls_replay for later use). Add tx_host_coal_bds/tx_host_coal_enable
sysctls to tune and toggle it.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58600
3c995919dc4a7f5de35534b3220f972bf0153fb9 Sumit Saxena 2026-08-03 09:07:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: Support backing store v2 for Thor if FW supports it
The driver currently only supports BS v1 for Thor even though the
firmware supports v2, capping max_mr at ~192K when firmware can
support up to ~256K. Enable Backing Store v2 support for the Thor controller.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58601
4c293e01fd2a8a3adb3fbac12e7ce40db84ed734 Sreekanth Reddy 2026-07-21 06:55:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: Fix interrupt storm on Thor2
An interrupt storm was observed on Thor2 because the Rx CQ consumer
index was always one less than it should be. Correct the Rx CQ
consumer index to fix the storm.

Reported by:    gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58602
8c69a5dc60b3630a4c5bca0bda714f791324afad Sreekanth Reddy 2026-07-29 11:28:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #1: if_bnxt
if_bnxt: add MPC (Mid-Path Channel) ring infrastructure

Add MPC ring support: a pair of extra, driver-private
TX/completion/notification rings the firmware uses as a side-channel
for offload commands. The only current consumer is kTLS TX crypto
command submission; RCE/CFA channel types are not yet implemented by
any consumer.

Adds MPC ring allocation/teardown, HWRM ring alloc/free, a private
interrupt path for the MPC NQ ring, and the TX submit/completion
path. The RoCE-only IRQ table builder is split into a generic,
exported bnxt_populate_irq(softc, irq_count) that both MPC and RoCE
use, plus an incremental bnxt_populate_irq_roce() that grows the
table on top of whatever is already there, so IRQ rids stay
consistent regardless of attach order.

This patch does not link standalone: bnxt_mpc_cmp() calls into
kTLS's completion handler, added by a later patch.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58603
088a42c0ff7620463a870bc789f940fdf112802f Sumit Saxena 2026-07-29 09:12:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add bnxt_compat.h version-compat shim

Add bnxt_compat.h, a small __FreeBSD_version-gated compatibility
shim: if_getmtu()/if_name()/if_getsoftc()/if_getflags() fallbacks for
pre-1500000, and a config-task vs. config-gtask abstraction over the
iflib API split at 1403000. On this branch's FreeBSD version it also
unconditionally enables KTLS_IFLIB_SUPPORT/KTLS_REC_SEQ_NUMBER, which
the upcoming kTLS patch depends on.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58604
42988358a9210ccf7ff500895785b49fe5615567 Sumit Saxena 2026-07-29 12:13:39

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add bitmap search/test-and-set helpers

Add bitmap search/test-and-set helpers the kTLS
key-context ID allocator needs; bitstring.h has no equivalent
primitives.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58605
aef2db6fac2329bfd553f8db9c87b34dccdb33ac Sumit Saxena 2026-07-29 12:14:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

f_bnxt: add kTLS (kernel TLS) TX offload
Add kTLS TX crypto offload, layered on MPC (crypto add/delete
commands submitted over its TCE channel) and TX completion coalescing
(shared tx_bd_opaque encoding).

Adds kTLS session lifecycle management, a key-context ID allocator,
HWRM key-context alloc/free with partition-mode support, and the TX
submit path: in-order packets go out on the normal iflib path with
CSUM_SND_TAG set, while out-of-order or retransmitted TLS records get
a presync command plus a replayed copy of the record built from the
driver's own replay ring. Also adds kTLS/MPC completion-time counter
sysctls and the max_ktls_entries tunable.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58606
70d389bede66da585508c1813c10a873d42612e7 Sumit Saxena 2026-07-29 12:16:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #2: if_bnxt
if_bnxt: Fix HWRM mailbox/DMA teardown race on detach

iflib's generic device-deregister path never drains the admin task
before calling IFDI_DETACH, so bnxt_update_admin_status() (scheduled
once/sec) could still run concurrently with bnxt_detach(), racing on
softc->hwrm_lock and the shared HWRM request/response DMA buffer that
bnxt_detach() destroys. That race could leave the firmware-side HWRM
mailbox inconsistent, surfacing as "Timeout sending HWRM_VER_GET" on
the next module load.

Add a softc->detached guard: set it as the first statement in
bnxt_detach(), and bail out of bnxt_update_admin_status() immediately
when it's set.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58607
9330b2f73c04f06e39da5cf2279682a607185601 Sumit Saxena 2026-07-31 15:43:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: honor firmware min wait before VER_GET on reset

The firmware advertises a minimum wait time it needs before it is
ready. The driver was not honoring it and sent VER_GET too early
during firmware error-recovery, which could return an incomplete
VER_GET buffer. Enforce that minimum wait, measured from when the
RESET_NOTIFY async event arrived, before sending VER_GET.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58608
e009e1fd80839a4a570a73dae9011a04ed4579ca Sumit Saxena 2026-07-31 15:46:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Pass HWRM cmd response to apps even if FW fails it

The driver was not passing the HWRM command response to management
apps when the firmware failed the command, which is not what apps
expect. Copy the response out whenever firmware populated one
(resp_len != 0), regardless of the command's overall return code, and
stop bailing out of the mgmt ioctl path early on a failed passthrough
so DMA'd indirect data and the response still get copied to
userspace.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58609
53b576bd81a4fb5c38b952e74ff2f806569bc8ac Sumit Saxena 2026-07-31 15:48:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Collect hw stats every 250 milliseconds

bnxt_if_timer() only scheduled bnxt_update_admin_status(), which
polls HW stats, once per second. Drop the interval to 250ms so stats
collection is timely.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58610
492bd0db44bace9475e15dfebdc17076b536533f Sumit Saxena 2026-07-31 15:49:32

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt_re: Fix witness reported calltrace while unloading driver
bnxt_unregister_dev() called synchronize_rcu() while holding
bp->en_ops_lock, which witness flags as a sleeping-while-locked
violation on driver unload. Drop the lock around the RCU grace period
and reacquire it afterward.

Also gate the RoCE extended-stats hex dump in
bnxt_qplib_qext_stat() behind bootverbose instead of printing it
unconditionally.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58611
0aa3e15900d31a08680e2307cbc550715d727191 Sumit Saxena 2026-07-31 15:51:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #3: if_bnxt
if_bnxt: ktls: Reject new kTLS sessions once driver is detaching

bnxt_tls_snd_tag_alloc() only gated on BNXT_STATE_OPEN, which is set
once by bnxt_open()/bnxt_attach_pre() but never cleared again, so it
could not reject new sessions once bnxt_detach() started tearing
things down. The snd_tag_alloc_ref-based wait in bnxt_detach(), which
waits for in-flight allocators to exit, was already in place, but
without this gate new sessions could keep being created for the
entire duration of that wait, extending it indefinitely instead of
just draining existing ones.

Reject new sessions once softc->detached is set, and reset it back to
false in bnxt_attach_pre() so it doesn't wrongly persist across a
detach/reattach cycle.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58612
a48a50919da5549b2a5a2141042087a25879435e Sumit Saxena 2026-07-31 15:53:02

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Restore Rx CQ doorbell skip-when-idle optimization on P5

The unconditional-doorbell fix for Whp/older NICs (always ring the Rx
CQ doorbell after processing Rx interrupts) had also been applied to
P5+ chips, discarding process_nq()'s work-done signal entirely and
losing the doorbell-skip optimization on P5+ when process_nq() finds
no CQ notification to act on.

Make process_nq() return whether it saw a CQ notification, and only
skip the Rx CQ doorbell on P5+ when it didn't; non-P5+ chips continue
to always ring it, since process_nq() isn't used on that path.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58613
a8622eac118a31187be02f4dd1a53f58fc6ec35a Sumit Saxena 2026-07-31 15:55:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add support for HW generic stats

HW generic stats provide information about PCIe transactions and
out-of-order doorbell writes, useful for debug. Allocate a DMA buffer
for them (disabling BNXT_FW_CAP_GENERIC_STATS if the allocation
fails), fetch them via HWRM_STAT_GENERIC_QSTATS once per admin-status
tick on P5+ chips, and expose them to userspace under
dev.bnxt.<unit>.hwstats.generic_stats.* via sysctl.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58614
d1619865da1cd4c5b557158b4bbf666e0f7f040b Sumit Saxena 2026-07-31 16:00:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: avoid FTQM/STQM pg_info alias on reset

Copying the STQM backing-store context to seed FTQM's also copied
STQM's pg_info pointer verbatim. On cold load STQM's pg_info is still
NULL so this is harmless, but on a firmware reset STQM's pg_info is
already non-NULL, making FTQM alias STQM's backing-store pages. The
allocator then skips FTQM since it looks already allocated, and FTQM
is later indexed as its own array, reading out of bounds into STQM's
buffer and dereferencing a bogus DMA address.

Clear ctxm->pg_info after the memcpy so FTQM always gets its own
backing store.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58615
f2ce672ade231a1e19f1238922a2c3b6fe696e22 Sumit Saxena 2026-07-31 16:02:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Never ARM Tx CQ as they are not interrupt-driven

Tx completion rings are not interrupt-driven, so there is no need to
ring the doorbell with CQ_ARMALL and toggle bits set for them. Stop
arming the Tx CQ doorbell on P5+, which makes tx_cp_rings[]->toggle
dead, so drop the now-unnecessary toggle bookkeeping for it in
process_nq() too.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58616
7781529f31b62a3071995b9f0446b8ded4ec8cf9 Sumit Saxena 2026-07-31 16:04:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: fix HWRM failures/timeouts after repeated FW resets

Consecutive firmware-initiated reset cycles produced HWRM
failures/timeouts and traffic didn't come back. Fix the FW-reset
recovery path:

- bnxt_fw_reset_close() called bnxt_stop() and
  bnxt_hwrm_func_drv_unrgtr(), sending HWRM ring/VNIC/filter free
  commands to a firmware that's already mid-reset and unresponsive,
  producing the observed timeouts. Both are unnecessary since
  firmware comes back with fresh state anyway; drop them along with
  the now-redundant iflib_request_reset().
- bnxt_func_reset() now skips bnxt_hwrm_resource_free() entirely
  while BNXT_STATE_IN_FW_RESET is set, for the same reason.
- bnxt_open() (used to reopen after a firmware reset) now issues
  bnxt_hwrm_func_reset() up front and drives reinit through iflib's
  own reset machinery (iflib_request_reset() plus a new
  bnxt_iflib_reset_sync() that waits for
  IFF_DRV_RUNNING/OACTIVE to flip 1->0->1) instead of calling
  bnxt_init()/bnxt_intr_enable() directly.
- Route repeated PORT_QSTATS/PORT_QSTATS_EXT HWRM timeouts through
  bnxt_log_live() instead of device_printf(), so a stats poll timing
  out during a reset doesn't spam dmesg on every tick.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58617
dbde459751448ab9e98662660049513db783600c Sumit Saxena 2026-07-31 16:13:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: support more Tx rings than Rx rings on P5+

Add an unsupported-config guard rejecting nrxqsets > ntxqsets, and
teach the P5+ NQ datapath to handle the opposite asymmetric case:
extra Tx rings beyond the Rx ring count. softc->nq_rings[i].type now
tags each NQ as SHARED_NQ (paired with an Rx CQ) or BNXT_TX_ONLY_NQ
(dedicated to an extra Tx CQ with no backing Rx ring); bnxt_init()
and bnxt_hwrm_resource_free() gate all Rx ring group/ring/stat-ctx
alloc and free on IS_SHARED_NQ() so the extra Tx-only NQs don't touch
nonexistent Rx ring state. Gate the new type-tagging and IS_SHARED_NQ
checks on BNXT_CHIP_P5_PLUS(), since non-P5+ chips never allocate
softc->nq_rings and would otherwise access a nonexistent array.

BNXT_TX_ONLY_NQ is a distinct value from the existing MPC-private
TX_CP_NQ; the two are unrelated and kept apart to avoid confusion.

Suggested by:   gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58618
644880d7b9b86fa16797fa45e7a876ac503227f9 Sumit Saxena 2026-08-01 08:52:51

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: drop redundant PCI disable in bnxt_fw_reset_close()

bnxt_fw_reset_close() unconditionally called pci_disable_device()
after freeing the Rx IRQs, on every firmware reset, not just the
BNXT_STATE_FW_FATAL_COND path which already disables the device via
bnxt_fw_fatal_close(). BNXT_FW_RESET_STATE_ENABLE_DEV in
bnxt_fw_reset_task() already re-enables the device unconditionally,
so this wasn't leaving the device disabled, just adding an
unnecessary PCI disable/re-enable cycle around every non-fatal reset.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58619
4fbb63f289ed6a06e715c6882e8fff3201381743 Sumit Saxena 2026-08-01 09:07:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: drop epoch_arr[] to detect EPOCH bit toggle

The EPOCH array size is 4096 but the driver does not enforce any limit
on ring size, so setting ring size >4096 corrupts adjacent memory
and leads to undefined behavior.

Toggle epoch_bit directly at every ring-producer wrap point (TX/RX
encap and refill, MPC crypto commands, kTLS presync/replay) instead of
looking it up per-index in the doorbell path, dropping the now-unused
epoch_arr[] snapshot array.

Reported by:    gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58620
Change-Id: I4673d64670ee0e8ea256b8a8932724bbd73f710d
ed1f24d3e1a1c0f85bf3eda0337cfbf76bc34cf6 Sumit Saxena 2026-08-03 05:03:22

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: rework interrupt coalescing onto the AGGINT_QCAPS scheme

Query firmware-advertised coalescing capabilities and program
per-direction rx/tx coalescing settings against them, replacing the
old hardcoded scheme. Add sysctls for the coalescing mode, budget,
and stats-timer knobs the new scheme exposes.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58621
22f37c46b4841fec22612fd4bc485f0515f27a28 Sumit Saxena 2026-08-03 08:52:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: log: fix missing lock coverage in bnxt_log_live()

bnxt_log_live() walked the loggers TAILQ without holding log_lock,
unlike every other bnxt_log.c function, racing against concurrent
bnxt_register_logger()/bnxt_unregister_logger() calls. Take log_lock
around the traversal, and bail out early (with the lock dropped) if
live_msgs_len has already reached max_live_buff_size, which would
otherwise underflow the length passed to bnxt_log_info().

bnxt_start_logging_driver_coredump() now drops log_lock before
invoking logger->log_live_op() (which calls back into
bnxt_log_live()) and re-acquires it afterward, resetting live_msgs
to NULL so a later bnxt_log_live() call (e.g. from a VF async event
handler) can't write into a coredump buffer the caller has already
freed.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59086
fc4cd2c477e6d4a2cb241c0bbac0fb91520cddcf Sumit Saxena 2026-08-05 04:07:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: sysctl: remove unused linux/delay.h include and dead mutex

<linux/delay.h> and the DEFINE_MUTEX(tmp_mutex) it enabled are both
unused in bnxt_sysctl.c: no msleep/udelay/mdelay call remains, and
tmp_mutex itself was never referenced anywhere.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59087
4786d44fef555fe5d4e82f0b716bb2cb0c0c1ecd Sumit Saxena 2026-08-05 04:07:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: sriov: replace Linux kPIs with FreeBSD native APIs

Convert bnxt_sriov.c and related SRIOV files from Linux to FreeBSD
native equivalents:

- Replace cpu_to_le16/32/64/le16_to_cpu with htole16/32/64/le16toh.
- Replace Linux is_valid_ether_addr, ether_addr_equal, ether_addr_copy
  with local bnxt_eth_addr_valid/bnxt_eth_addr_equal/bnxt_eth_addr_copy
  helpers built on ETHER_IS_MULTICAST/ETHER_IS_ZERO.
- Replace kcalloc/kzalloc/kfree with malloc/free (M_DEVBUF,
  M_WAITOK|M_ZERO).
- Replace dma_alloc_coherent/dma_free_coherent with iflib_dma_alloc/
  iflib_dma_free; add struct iflib_dma_info hwrm_cmd_req_mem[4] to
  bnxt_pf_info to hold the DMA handles.
- Replace the Linux unsigned long *vf_event_bmap with FreeBSD
  bitstr_t *, allocated via bit_alloc(); bit_ffs_at()/bit_clear()/
  bit_set() replace find_next_bit()/clear_bit()/set_bit() on it
  (if_bnxt.c's vf-event producer side included).
- Replace DIV_ROUND_UP with howmany; rcu_assign_pointer with a plain
  store.
- Harden bnxt_alloc_vf_resources() error paths to free
  partially-allocated DMA pages and the VF array before returning
  ENOMEM.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59088
e9a6920e3218bb3b092a4babee129e70d57135b2 Sumit Saxena 2026-08-05 04:10:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: port workqueue, task-queue, and synchronization kPIs to FreeBSD natives

- Replace Linux workqueue (struct workqueue_struct, bnxt_pf_wq) with a
  FreeBSD taskqueue (bnxt_taskq) shared by every attached PF. bnxt_taskq
  is created once at module load and destroyed once at module unload
  (SYSINIT/SYSUNINIT on SI_SUB_KLD), matching the module-owned-taskqueue
  idiom used elsewhere in the tree (e.g. sys/dev/cxgbe/t4_main.c's
  reset_tq). This replaces an earlier lazy, per-attach/detach
  create-or-reuse scheme guarded by a mutex and a "ready" flag, which
  had a real race: bnxt_queue_sp_work()/bnxt_queue_fw_reset_work() and
  bnxt_attach_pre() re-read the bnxt_taskq/bnxt_taskq_ready globals
  outside the mutex right after the lazy-init call returned, so a
  concurrent bnxt_detach() on another PF freeing the shared queue once
  bnxt_num_pfs hit 0 could race a still-attached PF into enqueuing onto
  a freed taskqueue. Tying the taskqueue's lifetime to the module
  instead of to any one PF's attach/detach removes that race outright,
  since the module can't unload while a PF is still attached.

- Replace struct work_struct sp_task with struct task sp_task;
  replace struct delayed_work fw_reset_task with
  struct timeout_task fw_reset_tmo.

- Replace INIT_WORK/INIT_DELAYED_WORK with TASK_INIT/TIMEOUT_TASK_INIT;
  queue_work/schedule_work with taskqueue_enqueue;
  queue_delayed_work/schedule_delayed_work with taskqueue_enqueue_timeout;
  cancel_work_sync/cancel_delayed_work_sync with
  taskqueue_drain/taskqueue_drain_timeout.

- Rename bnxt_fw_reset_task(struct work_struct *) to
  bnxt_fw_reset_timeout_task(void *ctx, int pending) to match FreeBSD
  timeout_task callback signature.

- Add inline helpers in bnxt.h to wrap all Linux test_bit/set_bit/
  clear_bit/test_and_clear_bit calls on softc->state and
  softc->sp_event: bnxt_drv_state_test/set/clear/test_and_clear,
  bnxt_sp_event_set/test_and_clear (implemented via bit_test() from
  <sys/bitstring.h> and atomic_testandset_long()/
  atomic_testandclear_long(), all bit-index based like the Linux
  bitops they replace).

- Replace struct mutex lock in bnxt_fw_health with struct mtx;
  mutex_init to mtx_init.

- Replace kzalloc/kfree with malloc/free (M_DEVBUF).

- Replace DIV_ROUND_UP with howmany; hweight32 with bitcount32.

- Replace jiffies/HZ with ticks/hz; msleep with pause_sbt(). Since
  `ticks` (unlike LinuxKPI's `unsigned long jiffies`) is a 32-bit
  `volatile int` that wraps every ~24 days at hz=1000, BNXT_TIME_AFTER
  and bnxt_sleep_until_min_elapsed() compute the ticks delta as `int`
  (matching the in-tree wraparound-safe idiom used elsewhere, e.g.
  sys/dev/axgbe/xgbe-mdio.c) rather than widening it to `long`/
  `unsigned long`, so the comparison stays correct across a wrap.

- Replace IS_ERR_OR_NULL/ERR_PTR with plain NULL checks.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59089
22dcbd7739a174433845da800ad47fa182f37430 Sumit Saxena 2026-08-05 04:12:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: port endian, memory-barrier, and bitops kAPIs to FreeBSD natives

There are few more Linux kernel APIs left in the code. So,
replaced them with corresponding FreeBSD native APIs.

- Replace cpu_to_le16/32/64/le16_to_cpu/le32_to_cpu/le64_to_cpu with
  htole16/32/64/le16toh/le32toh/le64toh throughout bnxt_hwrm.c and
  the vf-event producer path in if_bnxt.c.
- Replace rmb()/wmb() interprocessor-ordering uses in bnxt_ulp.c
  (publishing/consuming ulp->async_events_bmap and max_async_event_id
  across CPUs) with atomic_thread_fence_acq()/atomic_thread_fence_rel();
  keep wmb() for the HWRM doorbell/DMA ordering barrier in
  _hwrm_send_message() (bnxt_hwrm.c), since atomic_thread_fence_rel()
  compiles to a bare compiler barrier on amd64/i386 and does not order
  the request-buffer store against the doorbell MMIO write.
- Replace hweight32 with bitcount32, ARRAY_SIZE with nitems, and
  DECLARE_BITMAP with a plain unsigned long array (sized via
  howmany()) in bnxt_hwrm_func_drv_rgtr(); replace the __set_bit/
  test_bit calls there with bit_set()/bit_test() from
  <sys/bitstring.h>, which correctly index the multi-word bitmap
  (event IDs up to 0x45 span more than one 64-bit word).
- Replace the remaining DIV_ROUND_UP/HZ with howmany/hz in
  bnxt_handle_async_event()'s error-recovery timer setup.
- Replace bnxt_sriov.h's <linux/pci.h> include with the native
  <dev/pci/pcireg.h> + generated "pci_if.h", now that nothing in
  that header needs Linux's struct pci_dev.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59090
fd540c61a1bb31536ff19e14bf456f71f0e4e737 Sumit Saxena 2026-08-05 04:13:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: don't reserve RoCE MSI-x on chips that don't support RoCE

RoCE is only supported on Thor and onwards chips.
bnxt_init_sctx_variants() unconditionally set isc_admin_intrcnt to
BNXT_ROCE_IRQ_COUNT for every PF device, stealing 9 MSI-x vectors from
older, non-RoCE-capable chips that will never use them.

Gate the reservation on the device ID: RoCE-capable chips keep
BNXT_ROCE_IRQ_COUNT, other chips fall back to 1, the baseline
isc_admin_intrcnt value used before RoCE support (commit 050d28e13cde)
repurposed it for RoCE MSI-x on every device.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59091
15187b27c895e82d153dd1de5324076692023e70 Sumit Saxena 2026-08-21 11:33:48

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add support for SIOCGI2CPB page/bank i2c requests

Advertise IFLIB_I2C_PAGE_BANK and forward the requested page/bank to
firmware, so CMIS optics can be read correctly instead of falling
back to bogus legacy SFF-8472 decoding. Also fix bnxt_i2c_req() to
return positive errno values.

Signed-off-by:  gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59573
fdab50f6f8107c9d825a7e6d92d7a6b89c417bbb Sumit Saxena 2026-09-01 07:55:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: dcb: serialize HWRM sends and avoid freeing DMA bufs on timeout

Every _hwrm_send_message() call in bnxt_dcb.c ran without BNXT_HWRM_LOCK,
unlike the rest of the driver, letting concurrent HWRM commands race on
the shared MMIO doorbell and response buffer. Route single-shot sends
through the already-locked hwrm_send_message() wrapper, and wrap the
remaining send+response-read sequences in explicit BNXT_HWRM_LOCK/UNLOCK.

Also stop freeing the transient DMA buffers used for structured-data
get/set on ETIMEDOUT: a host-side timeout doesn't guarantee firmware
actually gave up, so a late completion could still DMA into memory
that's since been freed and reused. Leak the buffer instead in that case.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D60179
4f20e02ed0582bd8a3e2b59853690c1d46e08fa8 Sumit Saxena 2026-09-29 12:15:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #4: arm64
arm64: Add a header for system instructions

Like armreg.h for system registers add a header to hold macros for
system instructions.

Reviewed by:    jhb
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59147
3864fe9317325e6abddf7b7126873918533231f8 Andrew Turner 2026-10-09 11:54:56

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


arm64: Use sysinsn.h to generate tlbi instructions

Some toolchains may not understand the .arch_extension.

Reviewed by:    jhb
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59148
e8997a4e44c7729e6013745cb6590d2ec3691175 Andrew Turner 2026-10-09 11:55:06

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


arm64: Fix the MPIDR_EL1 field names

Use the field names from the Arm Documentation for the MPIDR_EL1
register. These will later be generated from a BSD Licensed JSON file
so to reduce the diff for that rename now.

Reviewed by:    kajetan.puchalski_arm.com
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59176
6bf6fe1d70e780786a07e759d75eeb256f247fcd Andrew Turner 2026-10-09 11:55:14

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


bhyve: Use the new spelling of MPIDR_Aff*

Fixes:  https://cgit.freebsd.org/src/commit/?id=6bf6fe1d70e7 ("arm64: Fix the MPIDR_EL1 field names")
 Sponsored by:  Arm Ltd
406a74f780ab110137011d304ac9212a31bf6364 Andrew Turner 2026-10-09 14:53:25

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

debug: moved to hardware because 'Need to be grouped with 6bf6fe1d70e780786a07e759d75eeb256f247fcd'

arm64/vmm: vgic_v3: Set EOI for level-triggered interrupts
ICH_LR_EL2 bit 41 (EOI) determines whether a maintenance interrupt will
be asserted if the interrupt identified by the LR's vINTID is
deactivated. For level-triggered interrupts, that maintenance interrupt
is necessary for the host to resample the current level once the
interrupt is deactivated.

Set the EOI bit when flushing level-triggered interrupts into LRs.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2437
7081201eb07367be73e43c5f878dfec51e8fe0d7 Kajetan Puchalski 2026-09-17 14:19:27

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/vmm: vgic_v3: Fix missing free of vgic_cpu->private_irqs
vgic_cpu->private_irqs is allocated but never freed, as a result leaking
memory whenever the vmm module is unloaded. Add the missing free.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2439
aa4086951b4a26386bcdcd0693520e7d35be425e Kajetan Puchalski 2026-09-18 15:34:18

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

Commit group #5: x86: Add external retpoline thunk
x86: Add external retpoline thunk

This allows use of -mindirect-branch=thunk-extern, and is only a few
bytes of dead code if not used.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60524
74d971fe156113cc63add2e6701e369c93c4f52b Ed Maste 2018-03-14 14:53:34

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/i386/']'


x86: Fix retpoline capitalization

Fixes: https://cgit.freebsd.org/src/commit/?id=74d971fe1561 ("x86: Add external retpoline thunk")
ac9093170de19a54e9b37d6ff39e23be4af8a554 Ed Maste 2026-10-09 14:51:28

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

thunderbolt: Router suspend routine
Suspend routine for USB4 v1.0 NHIs. This will work on v2.0 NHIs too for
now, but there's ideally a different method we should be using for those
in fine.

Reviewed by:    imp, ngie, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49453
02880ddf9ed01a4b3444239309f522309ef11043 Aymeric Wibo 2025-04-29 20:42:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt_en: dcb: stop zeroing ETS and PFC config in bnxt_dcb_init()
bnxt_dcb_init() currently pushes all-zero ETS and PFC settings to
the firmware at every attach. This reserves bandwidth allocation
for RoCE traffic, which prevents L2 traffic from reaching line rate.

These settings should only be updated with valid values when the
RoCE driver is loaded. Therefore, we should stop programming them
during bnxt_dcb_init().

Signed-off-by:  Andy Gospodarek <gospo@broadcom.com>
Reviewed by:    chandrakanth.patil_broadcom.com, gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D60516
31cbd8f27d687ce9b10a22c858296532be400bb4 Sumit Saxena 2026-10-09 10:41:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mgb: Correct TX interrupt bit
The TX interrupt handler checked MGB_INTR_STS_RX(qidx) instead of
MGB_INTR_STS_TX(qidx) -- presumably a copy-paste issue.

Because the driver does not use TX interrupts so there was no actual
issue in practice.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Fixes: https://cgit.freebsd.org/src/commit/?id=8890ab7758b8 ("Introduce if_mgb driver for Microchip LAN743x PCIe NIC")
Differential Revision: https://reviews.freebsd.org/D60550
6c3f2b8be268de075d60387158f2889140851725 Ed Maste 2026-10-09 19:10:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdgpio: Suspend routine
Mask all interrupts when suspending and warn when there are unserviced
interrupts which might block entry to S0i3.

In the future we won't want to mask wake interrupts.

Once we can actually make use of GPIO interrupts on x86, we'll also want
to unmask relevant pins when resuming.

Reviewed by:    aokblast, avg
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D51589
16d92e92ca12c9772d921346c34f1ef87998c662 Aymeric Wibo 2026-02-25 09:28:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hyperv: Fix single page invalidation path
A single page invalidation sets addr2 == 0. In the original code, it
falsely flush the whole address in non global pmap. However, the
kernel pmap are all PG_G, which means a single page flush will always be
staled and thus become invalid. As a result, we set parameter based on
their op in a new helper function instead of relying on args. This
affects only on AMD platform as Intel has their PTI implementation.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291577
Tested by:      franco@opnsense.org
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60380
5b1f1fd624352840cd9666447ff9cdebeaf910d4 ShengYi Hung 2026-10-05 19:58:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv/pmap.c: Don't pass hartid map to 'smp_rendezvous_cpus'
The pm_active bitmask is indexed by hart IDs which can differ from
CPU IDs. `pmap_invalidate_range_svinval` assumes that the map is
indexed by CPU IDs, which is wrong and causes remote TLB invalidations
on unrelated CPUs.

Fix this by adding a routine that converts a hart-indexed bitmask
to a CPU ID-indexed bitmask. While we're here, fix a similar issue
in `pmap_active_cpus`.

Fixes:  https://cgit.freebsd.org/src/commit/?id=99360212c739 ("riscv/pmap.c: Add an Svinval-aware variant of pmap_invalidate_range")
Reported by:    markj
Reviewed by:    markj, mhorne
Differential Revision:  https://reviews.freebsd.org/D60072
f627ff51b76c728b8c6c4a7e5490ce3803c562ad Bojan Novković 2026-09-27 18:25:22

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

Networking

Network-related commands, library, and kernel.

netinet6: Fix the OSIOCAIFADDR_IN6 handler
We cannot simply treat a pointer to struct oin6_aliasreq as a pointer to
struct in6_aliasreq: the latter is larger.  In particular, the store to
ifra->ifra_vhid is out of bounds.

Since OSIOCAIFADDR_IN6 does not need to copy data back out, it can
simply use a struct in6_ifaliasreq on the stack.

Reported by:    Andrew <xxx.sys@protonmail.com>
Reviewed by:    pouria
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60184
c109a681456d03fc0737ca83487995e28b759e3b Mark Johnston 2026-10-05 13:13:47

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

tcp: Preserve borrowed ICMPv6 error mbufs
The TCP-over-UDP ICMP callback receives ip6c_m as a borrowed chain owned
by icmp6_notify_error.  It used m_pulldown() to obtain a contiguous UDP
header even though that API frees the complete chain when the requested
range is unavailable.  The callback could then return without
propagating the lost ownership, leaving raw ICMP delivery to read and
free a stale head.

Validate that the complete UDP header was quoted, copy it through the
chain with m_copydata(), and temporarily advance the parser offset
instead of consuming bytes from the caller-owned packet.

A remote sender can reach the old path when TCP UDP tunneling is enabled
by quoting the configured local UDP source port in an ICMPv6 error and
including only four through seven UDP-header bytes.

Signed-off-by: Andrew Griffiths <andrew@calif.io>

Reviewed by:    pouria, tuexen, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60143
80af0a32e48bff6ad97e768b16d2dbc01ac8d1c3 Andrew Griffiths 2026-10-05 13:14:38

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

iflib: Do not ring the transmit doorbell when nothing is pending
For a lightly used ring iflib_txd_db_check() may defer zero descriptors,
so its "pending >= limit" test is true even when nothing has been queued
since the last doorbell.  iflib_txq_drain() calls it before, inside and
after its loop, so a sender that drains its own packet wrote the tail
register three times per packet, twice with the value the hardware
already had.

The log of 81be655266fa ("iflib: ensure that tx interrupts enabled and
cleanups") calls skipping the doorbell when db_pending is zero "an
obvious missing optimization"; the comparison against a limit of zero
defeated it.  vmx(4) and mgb(4) have dropped such repeated requests in
the driver since 2019.  Return early when nothing is pending.

Reviewed by:            gallatin
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60290
4a0ec469934a5de60b9b540689703a698ac44105 R. Christian McDonald 2026-10-05 15:17:13

debug: classified in 03-filenames_plain1 by 'sys/net/'

iflib: Make the deferral test in iflib_txd_db_check() an early return
Invert the test so the doorbell write is no longer nested inside the
conditional, and wrap its comments to 80 columns.  Fix a typo in one of
them.

No functional change intended.

Reviewed by:            kbowling
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60371
ac24108dabcac04c7db351d33eb76f3ddee6073b R. Christian McDonald 2026-10-05 18:52:10

debug: classified in 03-filenames_plain1 by 'sys/net/'

netinet: Deprecate OSIOCAIFADDR and OSIOCAIFADDR_IN6
Requested by: glebius
Reviewed by:    pouria, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60247
4bb60157646df86c77cea130c66f63f119947709 Mark Johnston 2026-10-05 22:21:39

debug: classified in 03-filenames_plain1 by '['sys/netinet/', 'sys/netinet6/']'

routing: fix rtentry use-after-free in multipath route append
add_route_flags() drops the RIB lock and passes the existing entry,
rt_orig, to add_route_flags_mpath(). If a concurrent delete removes
the prefix in that window, the retry re-inserts rt_orig, which is
then freed while still linked, crashing later in rn_match().

Pass the new rt instead, return ENOENT when the prefix is gone and
RTM_F_CREATE is not set, and fix the rnd_orig NULL check.

Approved by:    pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=c24a8f19c5d5 ("routing: fix rib_add_route_px()")
Differential Revision:  https://reviews.freebsd.org/D60353
139fa2c12ddc028048efe3946f2663dcfba9b122 Olivier Cochard 2026-10-07 04:16:33

debug: classified in 03-filenames_plain1 by 'sys/net/'

epair: Make vnet_epair_uninit() run earlier
I can't see a reason for vnet_epair_init() and vnet_epair_uninit() to be
inconsistent in the sys(un)init run order.  Move vnet_epair_uninit() to
SI_SUB_PSEUDO, which is more appropriate for software ifnet drivers.

Reviewed by:    glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60388
5c20c75b67e3c96d58c1bbfe82472a8371bfa161 Mark Johnston 2026-10-06 22:04:54

debug: classified in 03-filenames_plain1 by 'sys/net/'

ctld: Fix namespace IDs for exported NVMe namespaces
NVMe namespace IDs are 1-based, but CTL LUN IDs are 0-based.  The
in-kernel NVMe ctl(4) target accounts for this by adding one to the
LUN ID to compute a namespace ID.  ctld was attempting to handle this
by translating namespace IDs from config files to internal LUN IDs,
but it did this incorrectly resulting in the namespace configured for
as namespace N actually showing up as namespace N + 1.

Fixes:          https://cgit.freebsd.org/src/commit/?id=66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
9c8be6518e2e5f396055ecdab8098ce19c4b2218 John Baldwin 2026-10-08 15:24:45

debug: classified in 03-filenames_plain1 by 'usr.sbin/ctld/'

netipsec: Fix V_spd_size updates
key_unregister_ifnet() was erroneously decrementing the size of the
global security policy database, V_sptree, but it doesn't modify that
database.  V_sptree_ifnet is for policies attached to if_ipsec
interfaces.  Note also that key_register_ifnet() was not incrementing
the counter.

Move the definition of V_spd_size up to the rest of the SPD definitions.
Its inclusion among the SPD cache definitions was confusing to me.

Reviewed by:    ae
Reported by:    Stephan de Wit and Cedrik Pischem from OPNsense
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60418
6b1d5fec57f9604a447864ec5e66940126b38df4 Mark Johnston 2026-10-08 17:02:51

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

nd6: Do not allocate an ifaddr for the interface ID in in6_ifadd()
Without a suitable link-local address, in6_ifadd() obtains the
interface identifier from in6_get_ifid().  It wrote the result into a
freshly allocated struct in6_ifaddr, M_NOWAIT since the function runs
in the network epoch, so SLAAC could fail under memory pressure over a
16 byte scratch buffer.

Write the identifier into the on-stack address the rest of the function
uses instead.  Zero it first, in6_get_ifid() only fills in the low 64
bits, as the M_ZERO allocation did.  Track which path provided the
identifier with a flag instead of a pointer into the ifaddr, so each
path releases its own reference.

Reviewed by:            glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=9e792f7ef729 ("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=f9fc93690aef ("sys/netinet6: fix memory corruption in in6_ifadd")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60488
ec76d3f600b528df7c29d3305e44342f08789fbf R. Christian McDonald 2026-10-08 23:08:19

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

libalias: index fully specified inbound links by remote endpoint
Inbound lookups find the (alias address, alias port, link type) group
with a splay tree and then walk grp->full, a list of every fully
specified link in that group, comparing the remote address and port.
With redirect_addr in front of a busy server, every client connection
to public:443 lands in the same group, so each inbound packet that is
not near the head of the list walks all of it.  TCP links live up to
24 hours unless libalias sees a clean close, so the list can grow to
hundreds of thousands of entries and saturate a core at a few hundred
packets per second.

Keep the fully specified links of a group in an RB tree ordered by
(dst_addr, dst_port).  Links that share an endpoint are ordered newest
first by a per-instance insertion counter, which keeps the "most recent
link wins" behaviour of the list (tested by 3_natin:2_portoverlap).

Lookups with an unknown remote address and a known port still scan the
group.  Each link grows by 16 bytes.

With ~170,000 links in one group, LibAliasIn() took 1-2 ms per packet
and one core saturated at ~720 packets/s.  With this change it takes
2-4 us per packet and the offered 1,000 packets/s are handled with the
thread nearly idle.

Sponsored by:           NLINK
Differential Revision:  https://reviews.freebsd.org/D60083
16bc669facc5eba33f7e215adce206bcf6ab2776 Paulo Fragoso 2026-09-27 19:25:07

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

if_me: Do not reuse gre(4)'s static sysctl OID number
if_me(4) registers its net.link.me node with the static OID number
IFT_TUNNEL, the same number if_gre(4) has used for net.link.gre since
2003, so the two tunnel drivers collide under net.link.  Until
d35c4cfad580 that only printed a warning and left two nodes with the
same number; since then sysctl_register_oid() panics, so loading if_me
after if_gre (or the other way round) takes the box down:

  kldload if_gre
  kldload if_me
  panic: sysctl: OID number(131) is already in use for 'me'

Use OID_AUTO like the other tunnel drivers.  Nothing addresses the node
by number.

Reviewed by:            ae
MFC after:              3 days
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60536
21f2245de21931cf388120d8cb464442aaa84c6f R. Christian McDonald 2026-10-10 13:13:22

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_gre(4): Cleanup unused RSS macros
RSS hash calculations no longer depend on RSS macro.
Therefore, remove unused macros and its XOR fallback.

Reviewed by:    adrian
Fixes:  https://cgit.freebsd.org/src/commit/?id=9c55b2e8cd6b ("rss: Enable portions of RSS globally to ...")
Differential Revision:  https://reviews.freebsd.org/D60556
f877ace81633822f66c2b1300040ea15ca063b8d Pouria Mousavizadeh Tehrani 2026-10-09 21:34:27

debug: classified in 03-filenames_plain1 by 'sys/net/'

ng_ubt: ignore further MediaTek USB BT devices
Following 8b21c469dbd6 add more entries for various MT BT USB VPI
combinations given we currently do not support any of them.

Suggested by:   thierry (while testing MT7920 wireless)
MFC after:      3 days
Reviewed by:    emaste, imp
Differential Revision: https://reviews.freebsd.org/D60279
33901f0d6f7bae39d7cb2867aee3327373762df0 Bjoern A. Zeeb 2026-10-03 17:47:40

debug: classified in 03-filenames_plain1 by 'sys/netgraph/'

netgraph/ng_ksocket: Enter epoch on NG_SEND_DATA_ONLY
The work queued by ng_send_fn() is intentionally processed
outside of the epoch in ngthread().
It is ng_ksocket's responsibility to enter epoch if it decides
to send data from such work.

Reviewed by:    glebius
Fixes:  https://cgit.freebsd.org/src/commit/?id=104827151e2a ("ng_iface: don't recursively enter epoch ...")
Differential Revision:  https://reviews.freebsd.org/D60589
67be955f6bd5d5b51fdee407969d1a7cde156f65 Pouria Mousavizadeh Tehrani 2026-10-10 15:51:58

debug: classified in 03-filenames_plain1 by 'sys/netgraph/'

if_gre: Use OID_AUTO for the net.link.gre sysctl node
if_gre(4) registers net.link.gre with the static OID number IFT_TUNNEL.
That number is an interface type that several tunnel drivers share, not
one that belongs to gre(4).  if_me(4) used it too, which made loading
both modules panic until 21f2245de219.  Nothing addresses the node by
number, so use OID_AUTO as if_me(4) now does.

Suggested by:   markj
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
80bc1d0e3ef732c6b58d13d0f223453a2410d8c1 R. Christian McDonald 2026-10-11 11:49:09

debug: classified in 03-filenames_plain1 by 'sys/net/'

sctp: hold tcp lock when calling sctp_calc_rwnd()
This was done in all code paths except one. Fix this to avoid
race conditions.

Reported by:    syzbot+2e2dc35c0e24a74663a7@syzkaller.appspotmail.com
Reviewed by:    tuexen
MFC after:      1 week
MFC to:         stable/14
MFC to:         stable/15
429f2fb48b92011d07798e681d96aa628fd8e387 Lukas Book 2026-10-11 20:00:06

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

net80211: add driver registration documentation
This is a brief introduction into the top-level newbus
driver methods and net80211 driver registration.

Differential Revision:  https://reviews.freebsd.org/D60503
Reviewed by: ziaee, zi
2409e2436a5369146f4cc99463ce5314dba0b7d4 Adrian Chadd 2026-10-11 22:26:14

debug: classified in 03-filenames_plain1 by 'sys/net80211/'

net80211: add DRIVER_REGISTRATION to README.md ; fix links
* add the driver registration doc to README.md
* fix the links to resolve correctly with current doxygen
  (1.18.0) with the current file path -> sanity conversion ->
  html path rules.

Differential Revision:  https://reviews.freebsd.org/D60504
Reviewed by: ziaee
e8b58993ff5d31fa964741d8e37c0f1a3e549095 Adrian Chadd 2026-10-11 22:27:35

debug: classified in 03-filenames_plain1 by 'sys/net80211/'

netlink: Make room for the unfinished message when growing the buffer
When a message outgrows the writer's buffer, _nlmsg_refill_buffer()
allocates a larger one and moves the unfinished message there.  The new
buffer was sized for the data about to be added alone, so with enough of
the message already written the caller wrote past its end and left it
with datalen > buflen.  A 20-byte message plus an attribute of 8176
bytes got a buffer of 8192 bytes for 8200 bytes of data, and reading it
panicked an INVARIANTS kernel in nl_soreceive().

Size the new buffer for both, and add a ktest for it.

Reviewed by:            glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60541
5180fce1cf7ec7430ccf2adb88358602e5ccee1e R. Christian McDonald 2026-10-11 20:46:56

debug: classified in 03-filenames_plain1 by 'sys/netlink/'

System administration

Stuff in man section 8 (other than networking).

camcontrol: Add support for firmware uploading on HPE-branded drives
b30e67dc130ea8217e92e0b4c462f189e2268eba Peter Eriksson 2026-10-02 16:45:59

debug: classified in 03-filenames_plain1 by 'sbin/'

rtld-elf/i386: remove no longer true __unused args annotations
Fixes:        https://cgit.freebsd.org/src/commit/?id=d45d7aea6197 ("i386 rtld: implement support for TLSDESC relocation")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
ea23918b025baf72a43c0ce6f3f505ef153c2644 Konstantin Belousov 2026-10-06 07:09:34

debug: classified in 03-filenames_plain1 by 'libexec/'

stand: userboot: improve userdisk error handling
Currently, userdisk_init() iterates through disks and
checks whether DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls
are available for the device. If either ioctl fails, userdisk_init()
returns ENXIO with ud_info only partially initialized.
devinit() records the failure, but loader_main() ignores
devinit()'s return value, so later code may access an
uninitialized entry.

In certain cases this code can still boot from a disk even if
userdisk_init() returns ENXIO, for example, when the first of
two disks is valid and the second errors out.

To address this issue while not breaking the current behavior, do
the following:

 - Zero-initialize the userdisk_info array and use a zero media size
   to mark disks that do not support the ioctls mentioned above or
   report an empty medium.
 - Update userdisk_print() not to print unusable disks.
 - Update userdisk_open() to return EIO for unusable disks.
 - Update extract_currdev() to pick the first usable disk
   instead of the first disk. Introduce userboot_disk_firstunit()
   for that.

Additionally, reset counters on ud_info allocation failure to prevent
accessing unallocated data.

Reviewed by:    jhb (previous version), markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59262
4445d039583a0a47fc335e0d34401581bcbc104e Roman Bogorodskiy 2026-08-28 16:43:26

debug: classified in 03-filenames_plain1 by 'stand/'

rtld.c: avoid double-free on dso load failure in do_load_object()
The obj->path is assigned directly from the path argument, and
load_object() frees the path on do_load_object() failure.  Do not free
it in obj_free() on the error path.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60402
274236ed084a259a0e8a11df1afebd2f2f1fb097 Konstantin Belousov 2026-10-06 08:22:21

debug: classified in 03-filenames_plain1 by 'libexec/'

camcontrol: Add Spectra Logic copyright
The majority of lines of code currently in fwdownload.c come from ken@'s
rework in commit 0e358df062dd ("Revamp camcontrol(8) fwdownload support
and add the opcodes subcommand.").  Add the appropriate copyright.

Approved by:    ken
e3f5a83b8f3c75651c1acb93c7f0edb8172b5eaa Ed Maste 2026-10-06 20:03:58

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #6: dhclient
dhclient: recognize the Captive Portal DHCP options

Rename option 114 from "url" to "captive-portal" (RFC 8910) and retain
"url" as a deprecated alias.  Rename option 160 from the generic
"option-160" to "captive-portal-legacy" (RFC 7710).

Reviewed by:    emaste, dch
Apprived by:    emaste, dch
Differential Revision:  https://reviews.freebsd.org/D60256
a1789e345db7f7c5f248006b49bb287067e03a45 Baptiste Daroussin 2026-10-02 19:53:30

debug: classified in 03-filenames_plain1 by 'sbin/'


dhclient: request the Captive Portal options

Add DHCP options 114 (captive-portal) and 160 (captive-portal-legacy)
to the default Parameter Request List so that servers advertise the
Captive Portal API URI.

Approved by:            emaste
Reviewed by:            emaste
Differential Revision:  https://reviews.freebsd.org/D60257
afee6fb209d18209f5b7707b944b30b80051e193 Baptiste Daroussin 2026-10-02 19:53:50

debug: classified in 03-filenames_plain1 by 'sbin/'


dhclient: export the Captive Portal URI to the script

Differential Revision=  https://reviews.freebsd.org/D60259
7ba72855939fc53eb8b6d9def386564579780786 Baptiste Daroussin 2026-10-02 19:54:25

debug: classified in 03-filenames_plain1 by 'sbin/'

dhclient-script: store the Captive Portal URI
Write the URI received in DHCP option 114 to
/var/run/captive-portal.IFACE atomically, with the legacy option 160 as
a fallback, and remove the file on EXPIRE and FAIL.

Reviewed by:    bcr (manpage)
Differential Revision:  https://reviews.freebsd.org/D60259
0f1ca95d7740e0800572ed436fd61e70f76eb6c3 Baptiste Daroussin 2026-10-02 19:55:28

debug: classified in 03-filenames_plain1 by 'sbin/'

dwatch(1): Use mdo(1) instead of sudo(8) when configured
Reviewed by:  dteske, olce
Approved by:    christos (mentor)
MFC after:      1 week
Sponsored by:   fme AG
Differential Revision:  https://reviews.freebsd.org/D60408
b6a573aa771e4a4b239a7bfeb074d1d25e811c1b Mateusz Piotrowski 2026-10-06 14:02:42

debug: Commit manually moved from "unknown" to "admin".

rc.d/mountd: Do not require /etc/exports
mountd exits if it cannot read any exports files. Requiring
/etc/exports, however, unconditionally stops mountd from starting on a
server that exports ZFS datasets only (/etc/zfs/exports).

Let sbin/mountd handle requirements itself, instead of hardcoding
/etc/exports, which is also wrong, because different files can be
specified in mountd_flags.

This patch also works with nfsv4_server_enable="YES", by preserving the
behavior of failing to start if there is no "V4:" line in the exports
file, which is missing by default on ZFS-only exports.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    rmacklem, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D60044
26203cca52621c215f60640bf59128dcd9780be7 Christos Margiolis 2026-10-07 16:53:28

debug: classified in 03-filenames_plain1 by 'libexec/'

loader.efi: devinit() just after parsing args instead
c4640126f1160 ("loader.efi: Apply command-line DHCP overrides earlier")
was really good, but moving it just one statement earlier is even
better.  polarian on Libera describes a GELI setup on a system that
doesn't advertise a serial console via ConOut.  They don't have serial
input at the point that they would get prompted for the GELI passphrase,
but if we parse args just before devinit() then he can override the
console with `efibootmgr -e`.  This gives UEFI one advantage over BIOS
loader, as /boot.config isn't available to provide that kind of override
if your impediment is GELI.

We also considered reading loader.env earlier, but we have a chicken/egg
problem in that we must have probed for the ESP to be able to open() it.
We would instead need a devinit_early() and devinit_late() scheme that
allows GELI probing to be deferred until the later pass, after reading
loader.env to pick up the console override.  That's an idea I'd still
like to discuss because it's more robust than hoping that firmware won't
wipe out our efibootmgr(8) entries.

Tested by:      polarian on Libera
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60449
78887369c47fda5707ef72ef46a1c903df5b7cae Kyle Evans 2026-10-08 02:16:28

debug: classified in 03-filenames_plain1 by 'stand/'

bhyve: Remove unneeded include of <machine/iodev.h>
This is a kernel-only header for /dev/io.  The user-facing header
defining the ioctl commands is <dev/io/iodev.h>.

Reviewed by:    bnovkov, imp
Differential Revision:  https://reviews.freebsd.org/D60399
b40ba68a65027b9a13b9ce28a5c43c4ffb7b003d John Baldwin 2026-10-08 15:20:45

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysconf: accept a unique prefix of a target keyword
Exact match still wins.  An ambiguous prefix is rejected with the
list of matches.  Move keyword selection and the rc pass-through
into sysconf-targets.c.  Bump sysconf(8) to 2.1.

Reviewed by:    kfv
Differential Revision:  https://reviews.freebsd.org/D59924
439eb9c9771b8a62b5bcc8d2f7337f26c4d717e2 Devin Teske 2026-10-08 16:26:02

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysconf: add a poudriere target
poudriere.conf is handed to sysrc(8), including the jail, tree, and
set overlays poudriere(8) consults.  make, src, and src-env are
sub-targets over the matching make(1) files under poudriere.d.  -l
and -L list one path per line; -L includes overlays that do not exist
yet.  A bare -- ends the sub-target so the next word is a variable.
Bump sysconf(8) to 2.2.

Reviewed by:    fuz, kfv, bcr
Differential Revision:  https://reviews.freebsd.org/D59943
398b29f07f7d1fa6a045b3ccf242a55cb61207c0 Devin Teske 2026-10-08 16:26:43

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

makefs/zfs: count "." in the link count and size of dataset roots
The root directory of a dataset is populated from an fsnode that is the
"." entry of the staging directory, and its children are the siblings of
that node, so the loop that computes the link count and the size of the
directory (which expects "." among the children, as the nodes of the
other directories have) never counts it.  The link count of the root of
every dataset is one less than it should be (1 for an empty dataset
instead of 2, 19 instead of 20 for a root with 18 subdirectories), and
so is its size.

fts(3) trusts the link count of the directories of ZFS when called with
FTS_NOSTAT and FTS_PHYSICAL: it stops looking for subdirectories once it
has seen as many as the link count says, and does not descend into the
ones it did not look at.  As a result find(1), and rm(1) when it does
not need to stat the entries, silently skip directories of a pool made
by makefs.  On a root filesystem made by makefs, find / does not list
/etc at all.

Start the loop at the "." node itself for the roots of datasets, so that
it is counted the same way as in every other directory.  Add a test that
checks the link counts and the sizes of the dataset roots and of the
other directories, with nested datasets and a dataset whose mountpoint
is not in the staging tree, and that find(1) sees the whole tree.

Fixes:          https://cgit.freebsd.org/src/commit/?id=240afd8c1fc ("makefs: Add ZFS support")
MFC after:      1 week
Approved by:    markj
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60439
81b5b2265d7734f9c4d4603031b3e8254c7e23d8 Renato Botelho 2026-10-07 11:32:45

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

rtld: fix indent
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
46399049f8876ca877604f51689aed8cf9105722 Konstantin Belousov 2026-10-10 15:02:55

debug: classified in 03-filenames_plain1 by 'libexec/'

rtld: release rtld_bind_lock around calls to .preinit_array initializers
We unlock the bind lock around .init calls anyway.  Also, the main
object cannot be unloaded.

Reported and reviewed by:       dim
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60588
ef758b59a44e6b5b2d2dc178b97c01cde1b34570 Konstantin Belousov 2026-10-10 15:05:55

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh add safe_var_set
safe_var_set can be used to safely handle var=val args from command line.
eg.

        while :
        do
                case "$1" in
                *=*)    # eval "$1" can be very dangerous
                        # safe_var_set will only eval if
                        # both var and value are sane.
                        if ! safe_var_set "$1"; then
                                case "$?" in
                                1) echo invalid variable name;;
                                2) echo invalide value;;
                                3) echo variabel not allowed;;
                                esac
                        fi
                        shift
                        ;;
                *)      break
                        ;;
                esac
        done
0fa0966b6a5a6000e4b98104e17629161f6f1f04 Simon J. Gerraty 2026-10-11 04:58:50

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh: add safe_set_var
Get the log message right!
Fix default allowed chars (untabify clobbered TAB)
Add a couple more : messages to help debugging.
475e3bc18a108dca375424c97de13939224c2d89 Simon J. Gerraty 2026-10-11 05:54:59

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh fix description of safe_set_var returns.
The description was out of sync wrt return values.
1. invalid var
2. invalid val
3. var not in allowed list
9f0432041b8fb69832f10c32da50a67f34feeb61 Simon J. Gerraty 2026-10-11 06:05:52

debug: classified in 03-filenames_plain1 by 'libexec/'

pfctl: remove the prototype of pfr_ina_define()
The function went when DIOCRINADEFINE was converted to netlink; pfctl
calls pfctl_ina_define() from libpfctl instead.  Name that one in the
error message that pfctl_load_tables() prints when it fails.

Fixes:          https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
40d42dc214ba0bcd283c5ccc34909a17b8a43455 R. Christian McDonald 2026-10-11 17:03:59

debug: classified in 03-filenames_plain1 by 'sbin/'

safe_eval.sh: safe_set_var avoid positional args
Use options to set ssv_{allow,only,extra}
Improve the documentation.
Add a test harness for safe_set_var.
7c75c96d176f600c7d17cb4652a1e655b44b2943 Simon J. Gerraty 2026-10-11 18:12:59

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh: safe_set_var use [:space:] if possible
Also use $ssv_extra$ssv_only as the default for $ssv_only has '-'
which must be last in the character class.
58a8f100a6fdb84997ed4740bd794779375e376f Simon J. Gerraty 2026-10-11 21:55:11

debug: classified in 03-filenames_plain1 by 'libexec/'

Libraries

libcasper: tolerate kernels without PD_NOWAITPID
Commit 1a296762b3d0 made libcasper pass PD_NOWAITPID to pdfork(2).
Kernels predating the flag (15.1 and earlier, since the flag first
ships in 15.2) reject it with EINVAL, which makes cap_init() and every
service fork fail when a newer world runs on an older kernel, for
example in a poudriere jail.

Add casper_pdfork(), which retries without the flag on EINVAL, and use
it at both pdfork(2) call sites.  The retry is safe because the kernel
validates pdfork flags before creating a child.  On such kernels the
zombie must still be reaped with waitpid(2), as before the flag was
introduced.

The fallback is compiled out once __FreeBSD_version reaches 1700000,
so it disappears from main when stable/16 branches while remaining in
the stable/15 and stable/16 branches that need it.

Reviewed by:    kib
MFC after:      3 days

Differential Revision: https://reviews.freebsd.org/D60401
b4e2c9abaf14d6eabbce59656d448c064e0dc40b Xin LI 2026-10-06 07:17:21

debug: classified in 04-filenames_plain2 by 'lib/'

lib80211: fix build with eXpat 2.9.0
eXpat 2.9.0 deprecates XML_GetCurrentLineNumber() in favour of
XML_GetCurrentLineNumber64().  The new function behaves the same
as the old one but is not prone to 32 bit integer wrap-around.
657c089950a0388811c7ba3f6d3e7127c297864e Philip Paeps 2026-10-06 03:14:03

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Consume error in check_and_init_mutex
MFC after:      2 weeks
192781bf5d047cceff3a1947bfc754c8b5eb0835 ShengYi Hung 2026-10-06 23:08:42

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Do not rely on UB in counter
counter + 1 > 0 is a undefined behavior and nobody guarantee that it
will be honestly perform by the compiler that counter + 1 will always be
INT_MIN. We switch to INT_MAX check instead to provide a deterministic
result.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60426
1d21e67e720a08992e81d626cff9d76524a81f22 ShengYi Hung 2026-10-07 01:41:55

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: reject count < 0
This causes count == -1 spin for INT_MAX times in userspace.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60425
627e7d5b72cf967eae3cd9e9e0707ce0ff63a4da ShengYi Hung 2026-10-07 01:30:56

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Reorder pthread mutex to prevent false sharing
On a 64 byte cache line CPU (amd64), m_owner is contended by all of
the shared processes. However, after finding one winner, mtx is
enqueued, which trigger a cache refresh from other processors. Reorder
mtx so that m_lock and m_qu will not be in the same cache line.

Notice that this doesn't affet arch that expose 128 bytes cache line
line aarch64 or powerpc.

Reviewed by:    kib, markj
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60434
99edcc3bd52614c6cf972ea8424a7807ed3fe1e3 ShengYi Hung 2026-10-07 07:22:13

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Fix some bugs in trylock
1. When contester > 2, a release causes kernel set CONTENTION bit but
   with no owner. In this case, the userspace should be able to try the
   lock instead of fall immediately. We copy this from trylock2.
2. A PI mutex should consult to kernel instead of decided by userspace
   itself.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60427
de2c0f157a9cce0b763da9ae97ada870fa4d1824 ShengYi Hung 2026-10-07 02:30:48

debug: classified in 04-filenames_plain2 by 'lib/'

libsysdecode: Fix some cpp conditionals
While testing the bare values happens to work, the intent is to test
for their definition.

Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=9a16bd169e8c ("libsysdecode: support errno and syscalls for arm64 Linux")
Fixes:          https://cgit.freebsd.org/src/commit/?id=b69ae1a34c6f ("libsysdecode: Add preliminary support for decoding Linux syscalls")
Differential Revision:  https://reviews.freebsd.org/D60415
23be969c12b2c2bb879aa1f2d606478a67a20852 John Baldwin 2026-10-08 15:21:06

debug: classified in 04-filenames_plain2 by 'lib/'

openssl: make libcrypto export the same symbols as upstream
Make the libcrypto Version.map export the same symbol names as upstream
3.5.8 (and 3.5.9, no new symbols were added).

Remove 52 names that upstream does not export:
- the internal threading and record layer functions (ossl_crypto_*,
  ssl3_cbc_*, tls1_cbc_*), which only libssl used;
- the internal WPACKET_quic_* functions;
- OPENSSL_cpuid_setup;
- ASN.1 item functions that are not in util/libcrypto.num.

Add 7 public names that were missing (ASYNC_get_mem_functions,
ASYNC_set_mem_functions, CMS_EnvelopedData_it, EVP_CipherPipeline*) to
OPENSSL_3_5_0, where the other symbols from upstream 3.1 to 3.5 are.

EC_GFp_nistp224_method, EC_GFp_nistp256_method and
EC_GFp_nistp521_method stay unexported (see 6f6446b33064).

Compatibility: libssl.so.35 from earlier builds imports the removed
internal symbols, so it does not load with this libcrypto.so.35.
libcrypto and libssl must be updated together.  This change needs the
previous libssl change, which gives libssl its own copies.
Nothing in the base system imports a removed symbol.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60397
c01c0a27cb82ca40ed507889c8f78fb2dcf76568 Gordon Tetlow 2026-10-08 21:10:10

debug: classified in 03-filenames_plain1 by 'secure/lib/'

libthr: Support disable spinloop
Like yieldloops, we shoulde be able to set _thr_spinloops to zero.
Originally, it makes us to enformce default spin time even if we try to
disable it. Make MUTEX_ADAPTIVE_SPINS a one time initialization now.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60486
305c3044e0249ea24a9b4571dfa6ae319a5bcdec ShengYi Hung 2026-10-08 18:38:06

debug: classified in 04-filenames_plain2 by 'lib/'

libpfctl: Fix the counts returned by pfctl_ina_define()
The counts of a table definition were stored only if the caller's
variables already held a non-zero value, and read uninitialised ones
otherwise.  pfctl_ina_define() passes the address of two uninitialised
locals and sums them up.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60614
5fc8fe3df5b9ede9e1cc1e35a0d10e6390b030d9 R. Christian McDonald 2026-10-11 14:46:41

debug: classified in 04-filenames_plain2 by 'lib/'

Filesystems

ufssuspend(4): mark non-passable
This fixes long-standing issue where ufssuspend file descriptor could
leak over fork or be passed over unix domain socket, and then closing it
in the opener would not unsuspend the file system.

It should not affect the well-behaving growfs(8) utility, but makes the
userspace API safer on principle.

Reviewed by:    markj
Tested by:      pho (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60285
499901dd7a0afc77745ede85c4e6ec063d43a84d Konstantin Belousov 2026-10-04 00:50:57

debug: classified in 03-filenames_plain1 by 'sys/ufs/'

nfscl: Fix oddball cases for session slot release
We have identified some cases where silent slot loss can occur
when operations on NFS mounts are aborted. We experience this
when using NFSv4.2, but it likely also occurs with NFSv4.1.

A slot is acquired for compound operations by nfsv4_setsequence()
and freed by newnfs_request(). Any call path that abandons the
compound before reaching newnfs_request() loses the slot permanently.

We identified four call sites where this happens, one of
which where it actually does happen for us in a semi-reproducible
way, which allowed us to develop a candidate patch, attached.

The patch adds one function, nfsv4_freeunsentslot(), to
nfs_clcomsubs.c. It is called from each of the four call
sites: nfsrpc_writerpc(), nfsrpc_writeds(), and two in
nfsrpc_setextattr().

nfsv4_freeunsentslot() calls nfsv4_freeslot() with resetseq
set to true because the aborted RPC will never be sent and
therefore the slot sequence ID should not advance.

With this patch and other diagnostics, we have confirmed
that slot loss does not occur under the conditions that
otherwise cause it in our environment.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298416
Reviewed by:    rmacklem
MFC after:      1 week
77a7a48a1cb003831ff1d4342b1974fc7f79381e J. David 2026-10-07 01:52:19

debug: classified in 03-filenames_plain1 by 'sys/fs/'

devfs: Explicitly disable inotify
In principle, inotify can be used to leak timing information about I/O
device accesses by privileged process, which might be sensitive, e.g.,
in the case of /dev/input.  See https://inoti.fyi/#1-linux-inter-keystroke-timing

In practice this does not work since I/O to devfs nodes does not go
through vnodes, so the INOTIFY() calls in various VOP hooks do not fire.
But, let's explicitly define a no-op VOP_INOTIFY to help ensure that no
one tries to "fix" this bug.

Alternately we could simply ignore VCHR/VBLK vnodes in vn_inotify().
However, maybe someday it'll be desirable to enable inotify for specific
device files, in which case the filtering should live in devfs.

Add a regression test.

Reported by:    Sudheendra Raghav Neela <sneela@tugraz.at>
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60364
c2ac0db7150c53d3902dbe1c507d96cbacfcadc6 Mark Johnston 2026-10-07 14:36:26

debug: classified in 03-filenames_plain1 by 'sys/fs/'

makefs/zfs: Allow the autotrim pool property to be set
Add an "autotrim" option taking "on" or "off". The value is stored in
the pool properties object alongside "bootfs", so the imported pool
starts trimming freed space automatically without a separate
"zpool set" step. When the option is omitted nothing is written and
the pool keeps the default ("off"), exactly as before.

A string option is used rather than makefs's boolean option type since
the latter ignores its value, which would make "autotrim=off" enable
the feature.

Define the spa_autotrim_t enumeration in the boot zfsimpl.h, copied
from OpenZFS's sys/spa.h, so that makefs can refer to SPA_AUTOTRIM_OFF
and SPA_AUTOTRIM_ON by name. The loader does not use it.

Document the option in makefs(8) and add a regression test.

Reviewed by:            markj
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60420
dece5b05f577fc4c6b89af7ad48dfbdf7cc4945c R. Christian McDonald 2026-10-07 14:57:40

debug: Commit manually moved from "unknown" to "filesystems".

nfs_nfsdsocket.c: Fix "nfsstats -d" for ERELOOKUP
When ERELOOKLUP is returned by a file operation
(always vop_lookup?) the operation is retried without
doing nfsrv_statsend().

This patch fixes this problem,

The only effect of the bug was bogus "nfsstat -d"
output.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298534
Reviewed by:    rmacklem
MFC after:      1 week
9a237074d380233e93a17ddee6b155cc2f90ee96 Bren 2026-10-08 19:03:51

debug: classified in 03-filenames_plain1 by 'sys/fs/'

Kernel

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

LinuxKPI: Add crc16.h for amdkfd support
Reviewed by:  wulf
Differential Revision:  https://reviews.freebsd.org/D60275
d7e7397c217137c9f2465f60a7faf129c87934ec Sourojeet A 2026-10-05 12:10:41

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #7: cdevsw: add D_NONPASSABLE flag
cdevsw: add D_NONPASSABLE flag

to make the opened device files non-passable.

Reviewed by:    markj
Tested by:      pho (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60285
850d4562928ea9308dd9188d5014bcabe7049938 Konstantin Belousov 2026-10-04 00:50:23

debug: classified in 04-filenames_plain2 by 'sys/'


devfs_open: do not access dsw after dev_relthread()

Noted and reviewed by:  markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=850d4562928e ("cdevsw: add D_NONPASSABLE flag")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60393
1e595e959f66e11d0490e90270b9fb701cbc6739 Konstantin Belousov 2026-10-05 23:35:32

debug: classified in 03-filenames_plain1 by 'sys/fs/'

debug: moved to kernel because 'Need to be grouped with 850d4562928ea9308dd9188d5014bcabe7049938'

jaildesc: Lock prison pointer when filling kinfo
Submitted by: Yuri Tkachenko <yura.tkachenko at gmail.com>
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D60392
a5ae2a9bfb1ca7f49e79ee63ed39216c42326d02 Jamie Gritton 2026-10-05 23:54:21

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #8: sendfile: Fix build for kernels without INET or INET6
sendfile: Fix build for kernels without INET or INET6

Don't cap the new low watermark to a TCP-specific setting in kernels
without TCP.

Fixes:          https://cgit.freebsd.org/src/commit/?id=6948f4d5e2b2 ("sendfile: keep the lowat hack more conservative")
1d8c5f8e02558faa578329eb9e2076e04de3fc5d John Baldwin 2026-10-05 21:00:56

debug: classified in 04-filenames_plain2 by 'sys/'


sendfile: Include opt_inet*.h

Pointy hat to:  jhb
Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=1d8c5f8e0255 ("sendfile: Fix build for kernels without INET or INET6")
cb55ad8ff89cbbae776190842d2d71ef7a185098 John Baldwin 2026-10-08 15:19:25

debug: classified in 04-filenames_plain2 by 'sys/'

uiomove_object_page: a failed copy can still dirty the page
For writes, if we fail in the middle of reading from the source, the
destination may have already been dirtied.  For example, the source may
cross a page boundary, and the second page is inaccessible.
Conservatively mark the destination as dirty, even on errors.

Reported by:    Claude (Opus 5.5)
Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60280
d8dfbeb5701769832e84e5bb52f2e8b4e3ab902b Alan Cox 2026-10-03 17:19:36

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #9: sched: New scheduler interface definition scheme
sched: New scheduler interface definition scheme

Define the scheduler interface once and for all (in 'sys/sys/sched.h')
and remove all code duplication related to it (function signatures, slot
names, dispatch, scheduler instance declaration), making it easier to
modify the interface or to add new schedulers.

This is implemented by defining the interface as X macros, which are
passed a macro (and additional arguments for it) that is "called" with
a variable number of arguments describing a single function of the
interface.  The convention used for a function's parameters is that each
parameter is represented with two macro arguments, the first one being
the type and the second one being the name.  Helper macros allow to
process arguments described in this convention in order to generate
a list of arguments for function definitions (currently, up to
4 function parameters).  The chosen convention eliminates the need for
any specific declaration of functions depending on their number of
arguments.

DECLARE_SCHEDULER() has been changed to automatically declare and fill
a 'struct sched_instance' structure.  Its number of parameters has been
reduced to the minimum, and the symbol part used to produce distinct
structure names can now start with a digit (useful for 4BSD).

The new implementation has the following additional benefits:
1. The name of implementations for the interface functions is imposed
   (same name as the interface function but with the scheduler symbol
   that was passed to DECLARE_SCHEDULER() added just after the 'sched_'
   prefix, e.g., for ULE, 'sched_ule_*()') and checked at compile-time.
2. Missing functions in an implementation are detected at compile-time
   (and not at runtime with a NULL dereference).
3. Failures to fill correctly the 'struct sched_instance' object
   associated to an implementation are eliminated.

Preserve comments/categories of interface functions by moving comments
that were in the old explicit interface declarations to the SCHED_ITF*()
macros, and while here, marginally improve some (and move the common
documentation for sched_initticks() from the implementations to the
interface).  Several of them are not exact, but this will be fixed in
a separate commit.

Make the active scheduler instance object internal, as it is not used
outside of the shim implementation and one of the purposes of the
interface is also to hide the actual implementation.  If the need
arises, it would be easy to add scheduler-specific routines as new
fields in 'struct sched_instance' and to extend the machinery to
automatically assign routines returning EOPNOTSUPP to these fields, and
then to provide a macro to register non-trivial implementation, instead
of making the current instance object visible again.

Additionally, in order to avoid collision with C and C++ keywords:
1. Fields in 'struct sched_instance' are now suffixed with '_impl', so
   that, e.g., 'switch()' does not require special treatment anymore and
   the corresponding implementations can be renamed back to
   `sched_*_switch()`.  This suffix avoids any collision with existing
   C++ keywords as new functions are added to the interface.  (See
   SCHED_ITF_FIELD_NAME().)
2. Actual interface functions' C declarations do not list parameter
   names anymore (sched_class() was causing a problem in C++ with its
   'class' parameter).
allowing to remove the bracketing with '#ifndef __cplusplus'.

Reviewed by:    mchoo, kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=ce38acee8d0b ("Add kern/sched_shim.c") (+ some followups)
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59988
42490d5cd29d7a6acd3c28dacfbdc527c2d39028 Olivier Certner 2026-09-07 16:19:53

debug: classified in 04-filenames_plain2 by 'sys/'


sched.h: Fix a typo and remove an extra line

Fixes:          https://cgit.freebsd.org/src/commit/?id=42490d5cd29d ("sched: New scheduler interface definition scheme")
Sponsored by:   The FreeBSD Foundation
0bccbb9e98930f55bff5a943c881e460d4f31aec Olivier Certner 2026-10-06 16:18:14

debug: classified in 01-style by '[tT]ypo'

debug: moved to kernel because 'Need to be grouped with 42490d5cd29d7a6acd3c28dacfbdc527c2d39028'

cam: Rename cam_iosched_bio_complete to cam_iosched_bio_update_stats
The function updates scheduler statistics but does not complete the
bio. Rename it to avoid implying ownership of bio completion.

Sponsored by:           Netflix

Reviewed by:    ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60349
0040d1fb7a251daa0690f4858ddb495bee79ae52 Warner Losh 2026-10-06 22:45:31

debug: classified in 04-filenames_plain2 by 'sys/'

nda: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60155
4a3a5de8ace3c41da35f0fbac4d2549b868d1091 Warner Losh 2026-10-06 22:45:36

debug: classified in 04-filenames_plain2 by 'sys/'

da: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60156
bd86f0508e461526ba7342e52bd9778394b183f7 Warner Losh 2026-10-06 22:45:46

debug: classified in 04-filenames_plain2 by 'sys/'

ada: Update trim stats for every bio
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60157
7845cf8de8db3f6dd60a69379907b51b80123eae Warner Losh 2026-10-06 22:45:55

debug: classified in 04-filenames_plain2 by 'sys/'

cam: Assert we have the periph lock when updating the iosched stats
Sponsored by:         Netflix
Differential Revision:  https://reviews.freebsd.org/D60350
ab7249c288a4d7d09c88f4de705b58a2afbf35f9 Warner Losh 2026-10-06 22:46:03

debug: classified in 04-filenames_plain2 by 'sys/'

sched.h: Include <sys/pcpu.h> unconditionally
Even if SCHED_STATS is not defined, this header is necessary to provide
a definition of 'curthread' used in sched_pin() and sched_unpin().

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
b6d10a962448bf03400dd381b2083d1f547f869c Olivier Certner 2026-10-06 09:27:55

debug: classified in 04-filenames_plain2 by 'sys/'

linux: Initialize per-VNET state earlier
Make sure that linux_ifnet_departure() can't run after
linux_ifnet_vnet_uninit() has destroyed the per-VNET unit number
allocator.  Otherwise, when ifc_detach_cloner() destroys instances of an
interface type, it might be running too late.  Most cloner-based drivers
tear themselves down during SI_SUB_PSEUDO or SI_SUB_PROTO_IF.

Reviewed by:    pouria, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60389
a23901a37be9d8567db42f20d2ccc40fc5b7ee2a Mark Johnston 2026-10-06 22:05:03

debug: classified in 04-filenames_plain2 by 'sys/'

vn_open_cred(): rename VN_OPEN_NAMECACHE flag to VN_OPEN_COREDUMP
The flag only use is for special handling of core dump vnodes.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60283
ccd44c5e4881ece004fa23d3b479d4ee57b2a58e Konstantin Belousov 2026-10-03 23:59:30

debug: classified in 04-filenames_plain2 by 'sys/'

kern/coredump_vnode.c: avoid dumping to the mount point we suspended
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299095
Reported by:    Rick Richard <rick@sloservers.com>
Reviewed by:    markj
Tested by:      Rick Richard <rick@sloservers.com> (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60283
bea382f25b16fec0e9a1c2be130935e739075287 Konstantin Belousov 2026-10-03 23:59:30

debug: classified in 04-filenames_plain2 by 'sys/'

mlx5: support DevX UMEM page size bitmap
rdma-core's mlx5dv_devx_umem_reg_ex() passes the page sizes the caller
can use in MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP.  Add the attribute and
choose the UMEM page size, page offset and MTT count the way Linux commit
7610ab57de56 ("RDMA/mlx5: Allow larger pages in DevX umem") does.

Linux looks at the DMA list only.  The UMEM is mapped at an IOVA equal to
the DMA address of its first byte, ib_umem_find_best_pgsz() picks the
largest page size of the bitmap that this mapping allows, and
devx_umem_find_best_pgsize() halves it while the first DMA address is not
aligned to it or the length is not a multiple of it, stopping at
PAGE_SIZE, even if that is below every size in the bitmap.

The FreeBSD OFED layer has none of the ib_umem helpers this relies on,
so local copies of the current Linux ones are added.
ib_umem_find_best_pgoff() and ib_umem_dma_offset() come from Linux
commit b045db62f6f6 ("RDMA/mlx5: Use ib_umem_find_best_pgoff() for
SRQ"), ib_umem_num_dma_blocks() from Linux commit a665aca89a41
("RDMA/umem: Split ib_umem_num_pages() into ib_umem_num_dma_blocks()").
The ib_umem_find_best_pgsz() logic includes Linux commit 486055f5e09d
("RDMA/core: Fix best page size finding when it can cross SG entries"),
without which no page size above 4K would ever be found, as FreeBSD's
ib_umem_get() maps every page as an SG entry of its own, and Linux
commit 09ea6837a043 ("RDMA/umem: Be careful about boundary conditions in
ib_umem_find_best_pgsz()").

Without the attribute the bitmap defaults to GENMASK_ULL(63, 12), as in
Linux.  The attribute is read with uverbs_copy_from(), FreeBSD's
uverbs_get_const_default() works on an s64 and rejects any value with bit
63 set, the default included.  The page size is kept in a u64, Linux
returns it as an unsigned int and so fails registrations that would use
pages of 4G or more.

Reviewed by:  kib
Sponsored by: Nvidia networking
MFC after:    1 month
78ae174e420a2eaa340b41247a260bc067fae0c6 Ariel Ehrenberg 2026-10-06 10:45:06

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: firmware: remove `enoentok` logic in `*firmware_request(..)`
Prior to this change, in the event that a firmware module could not be
loaded, the linux_firmware driver would return a partially initialized
structure with uninitialized/zeroed out values for certain fields. Linux
does not do this, however, so some drivers that use
`request_firmware_nowait` expecting Linux behavior, like `if_bcrmfmac`,
would crash trying to dereference a NULL pointer.

This doesn't address the load/unload situation completely as the driver
remains loaded after the "firmware crashes", but it makes a completely
unusable situation (a kernel panic) into a slightly more usable situation
(driver does not unload).

As a sidenote: the raw free(9) call was replaced with a call to
`linuxkpi_release_firmware` because the latter call [better] ensures
that all resources allocated earlier on in the function are cleaned up.

MFC after:      1 weeks
Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D58451
ef947bb97302d8862545cd0a5f38b24fa1bae2f6 Enji Cooper 2026-10-07 18:22:00

debug: classified in 04-filenames_plain2 by 'sys/'

sysctl: don't loop when EAGAIN is returned
When userland_sysctl() experiences EAGAIN, don't loop internally but
leave retrying to the caller.
Looping was a problem in case of using tcpsso(8) to switch a TCP stack
where the acceptance check of the new TCP stack results in EAGAIN.

Reviewed by:            kib, glebius
MFC after:              1 week
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D60444
d39b12e9030b20410cecbcbb0c22847d7f8b5471 Michael Tuexen 2026-10-08 13:05:11

debug: classified in 04-filenames_plain2 by 'sys/'

systm.h: Remove unused <sys/kpilite.h>
It only contains sched_pin_lite() and sched_unpin_lite(), which have
been unused in-tree for the past 8 years, and were only briefly used
between 6573d7580b85 ("epoch(9): allow preemptible epochs to compose")
and a760c50c9ea7 ("With epoch not inlined, there is no point in using
_lite KPI. (...)").

Additionally, these functions are redundant with the existing
sched_pin() and sched_unpin() in <sys/sched.h>, which are already
themselves inline functions.  The only difference is that the
sched_*_lite() ones do not require the full definition of 'struct
thread', which may have been useful to circumvent namespace pollution.

That problem, if it materializes again, could be quickly circumvented
without this trickery by the use of non-inline functions, or using
inline functions referencing a variable filled at kernel startup with
the desired offset.  The trickery of using offsets computed at
compile-time appears necessary only in the case of extremely performance
sensitive functions.  Cleaning up namespace pollution should stay the
preferred way forward whenever possible.

Reviewed by:    glebius, imp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60404
e478037df4f12e3d1b6b551f05ea7ce23c096886 Olivier Certner 2026-10-06 09:36:09

debug: classified in 04-filenames_plain2 by 'sys/'

nmount: Introduce the "check_fsid" option
See the manpage addition for rationale

Reviewed by:    ziaee, kib
Approved by:    ziaee, kib
Differential Revision:  https://reviews.freebsd.org/D59930
c3ac06161dd5b1ac61bcf097060d1e7ae5f0cd57 Gleb Popov 2026-09-23 15:35:42

debug: classified in 04-filenames_plain2 by 'sys/'

lindebugfs: implement debugfs_create_devm_seqfile()
Implement debugfs_create_devm_seqfile() keyed by device and a
read function.

This was implemented months ago in order to support debugfs with mt76
but hasn't been exercised since.

The code does not really seem to belong in lindebugfs, but also does
not really fit into debugfs.h (rather fs.h?); leave it here with a
comment for now as neither dumbbell nor I could come up with a better
place.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D57524
3521cce445d4238aa425629c5fcc1c723b427d3e Bjoern A. Zeeb 2026-06-10 11:15:42

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI; factor out parts of device.h into device/devres.h
In [1] it was pointed out that devm_kmemdup_* have moved apparently
in Linux 7.0 into their own device/devres.h header file from device.h.
Move them and other parts (some being dependencies) along.

device/devres.h gets included from device.h so all that changes is
prototype, macro, and inline function ordering.

This should prepare us in case drivers start directly including
the sub-header.  It also helps to keep device.h more reasable.

Suggested by:   dumbbell (in D56396) [1]
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D60213
53beb6950f9415eb06dc24b9addea5932e3bd0da Bjoern A. Zeeb 2026-10-01 23:09:14

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #10: LinuxKPI
LinuxKPI: re-implement pm_runtime.h

The original implementation was based on OpenBSD under public domain
but just defined the functions to void.
FreeBSD later extended the file with more inline functions or dealing
with differences in Linux versions.

This rework tries to group some functions, adds properly typed arguments
and return values in some cases.
It further adjusts return values based on the !CONFIG_PM expectations.

Lastly pr_debug() calls are added so we could see if/how much these
functions are used in new/other works rather than code just compiling
but the functions entirely being ignored without the knowledge of the
person porting code.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58169
863fe7ae5152926fab0380a78ba26b6ba4a2d65f Bjoern A. Zeeb 2026-07-11 14:36:06

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: introduce LINUXKPI_DEBUG to enable LinuxKPI debugging

This allows us to build kernels which will (if the sysctl is enabled
too) show pr_debug() and pr_devel() output.

Enable it by default for debug kernels.

This option can later also be used for other LinuxKPI parts, like
skbuffs, netdevice, rcu, ... to conditionally compile in debugging
support to further justify its existence beyond an in-code #define.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D54060
9820afb99e6fdc471cb820f321530c52ed2c31ac Bjoern A. Zeeb 2025-11-25 17:17:55

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: use LINUXKPI_DEBUG to determine on witness lock tracing

LinuxKPI by default tells witness to ignore the locks, which is
unhelpful in case of panics like 'panic: sleeping thread holds lnxspin'.
While I have edited the lock initialitzation manually in the past,
make this dependent on both LINUXKPI_DEBUG and WITNESS.
Define an internal _LKPI_MTX_NOWITNESS (and equivalent for other lock
types used) and set them accordingly in kconfig.h, a file automatically
included to all LinuxKPI compiled code (like global.h). (*)
In addition, in the debug case, also define WITNESS_ALL to get file,
line, and lock name as a lock name rather than just, e.g., lnxspin.

(*) We will need another follow-up as -include ordering is currently
wrong for LinuxKPI modules. See D60207.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D59231
bbfd52dcbeb7b6e540220b3b24b664df6d200200 Bjoern A. Zeeb 2026-08-21 13:15:22

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #11: LinuxKPI
LinuxKPI: pci: cleanup lkpinew_pci_dev_release()

Factor out some cleanup routines from the device detach path so
we can re-use them here too.
Also clarifying that lkpinew_pci_dev_release() should only run
from the (*release) callback function means that we adjust our
other calls to what we had already envisioned in comments, to
go through the official pci_dev_put() path.

Compared to the device detach path, we have little chance to know
if we held the last reference and if the device is really gone or
not but in this case a later release would be fine (if it happens).
In contrast to the device detach path we cannot do the hack of
setting the .release callback to NULL and check upon return from
pci_dev_put() as in this case the pdev is freed.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell (before rebase for ac9c07a3e908 instead of D57430)
Differential Revision: https://reviews.freebsd.org/D57431
9d82546ac2def568ff2f55c63cd77c8d8ff959e2 Bjoern A. Zeeb 2026-06-03 03:39:09

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: pci: make internal variables file local

The only reason the internal lists and lock are shared seems to be
because the SYSINIT code was in linux_compat.c.

Migrate the three variables (pci_drivers, pci_devices, and pci_lock)
to linux_pci.c and make them file local.

While doing so adjust a few things:
(a) mark the various sections of the linux_pci.c file as we add new
    SYSINIT code to the middle of the file.  The file currently really
    contains three parts.
(b) rename the variables by adding a lkpi_ prefix indicating that they
    are part of our internal code and not part of the public KPI, and
    to clearly distinguish them from any native PCI code upon which
    we call as well.
(c) factor the locking code out into macros as we have often done in
    various parts of the kernel to make the lock itself more opaque.

No functional changes intended.

Sponsored by:   The FreBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell (before rebase)
Differential Revision: https://reviews.freebsd.org/D57432
e2bef7e30aa74ed3d46a5ce5d171993e9e2c14b8 Bjoern A. Zeeb 2026-06-03 04:32:45

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: pci: first round of file cleanup

While the multiple sections of the file are mostly clearly separated
some bits were spread around.

Get the device methods array to the end of the file saving us a lot
of forward function delcarations and making it easier to rename them
to a common lkpi_ prefix instead of linux_ showing that they are file
local internal functions not part of any official LinuxKPI KPI.

Sort the various lkpi_pci_* bus attachment functions together,
followed by the lkpi_pci_iov_ ones.  Then add the
pci_[un]register_driver* driver bits.  This keeps the group
logically together.

For the PCI functions then group the pdev allocations and free/release
functions--for the two paths--together, giving them more homogeneous
names and add comments to some of them so it is more clear which
ones are shared ("common") and which ones belong to which code path.

Move some helper function around to where they are needed now.

There is still more to do for the resource section which sits somewhere
in the middle but that will better be a separate pass.

For the DMA and backlight parts, rename various private bits to
a lkpi_ prefix as well (structures, variables, functions) away
from the public linux_ prefix which should belong to the linuxolator
in first place.

No functional changes intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell (before rebase)
Differential Revision: https://reviews.freebsd.org/D57433
7c9ee41f4fe4a6de6e5f4c3d7c3a38ff447c8cf3 Bjoern A. Zeeb 2026-06-03 05:36:35

debug: classified in 04-filenames_plain2 by 'sys/'

Build system

Commit group #12: bsd.lib.mk: only ctfmerge if objfiles have a CTF section
bsd.lib.mk: only ctfmerge if objfiles have a CTF section

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299013
Reported by:    Trond.Endrestol@ximalas.info
Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=222210c6a822 ("libgcc_s: add libgcc_s_asneeded.so wrapper for gcc 16")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60252
fdd3f6f78888b02a1bfa69a0572317413dc14a45 Siva Mahadevan 2026-10-02 19:54:55

debug: classified in 03-filenames_plain1 by 'share/mk/'


sys.mk: CTFMERGE: don't assume objfiles always have CTF sections

There are many instances, e.g. in the kernel, where
object files don't have CTF sections, but still need
to be merged into one that does have a CTF section.

This fixes cases like the following:

--------------------------------------------------------------
>>> stage 3.1: building everything
--------------------------------------------------------------

linking kernel.full
ctfmerge -t -L VERSION -g -o kernel.full ...
ERROR: ctfmerge: Input file force-dynamic-hack.pico was partially built from C sources, but no CTF data was present
Removing kernel.full

    kernel.full ---
    [kernel.full] Error code 1

This partially reverts commit fdd3f6f78888b02a1bfa69a0572317413dc14a45.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299013
Reported by:    markj
Reviewed by:    markj, emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=fdd3f6f78888 ("bsd.lib.mk: only ctfmerge if objfiles have a CTF section")
Differential Revision:  https://reviews.freebsd.org/D60378
b45d14d3d665e0253391924e5c0595c259b8a773 Siva Mahadevan 2026-10-05 20:13:16

debug: classified in 03-filenames_plain1 by 'share/mk/'

zstream: Downgrade -Watomic-alignment to a warning
Don't complain about unaligned atomic operations on i386.  This
same approach is already used for libspl.
c907302c121acc5ed696544f86a6d44d07faf06c John Baldwin 2026-10-05 20:53:19

debug: classified in 02-filenames_wildcards by '.*Makefile'

sys: Enable pcfclock.ko on all architectures
This driver has been in sys/conf/NOTES (and thus enabled in LINT
builds on all architectures) since the file was renamed from the i386
LINT and there is no i386-specific code in the driver.

Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D60177
228dd4eaae150e68566eb27cb7266cea1a98aea4 John Baldwin 2026-10-08 15:20:21

debug: classified in 02-filenames_wildcards by '.*Makefile'

Makefile.inc1: Update comment wrt world build targets
The utility targets described by this comment are in fact related to
building (buildworld), not installing (which is included in
`make world`).

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56715
87f0db8c672446d7690a781c75075c7d503dc44f Ed Maste 2025-05-24 16:53:00

debug: classified in 02-filenames_wildcards by '.*Makefile'

build: Emit a warning for build targets run as root
Build targets should generally be run as an unprivileged user.  Even
though building as root is discouraged many users do so, so just start
with a warning.

Reviewed by:    brooks
Differential Revision: https://reviews.freebsd.org/D50352
24d5194306b573bf3396858b4c0aa5d420c37c91 Ed Maste 2025-05-14 15:23:42

debug: classified in 02-filenames_wildcards by '.*Makefile'

Makefile.inc1: Don't unnecessarily ignore rm errors
For rm -f it's not an error if the files do not exist.  If there's any
other error it's presumably a real issue, so avoid ignoring all errors.

Reviewed by:    brooks, adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56714
d3c788feec4cbe0854dc6f72e2166c0423a7c118 Ed Maste 2024-08-19 16:03:13

debug: classified in 02-filenames_wildcards by '.*Makefile'

bsd.dirs.mk: Improve "installing DIRS" message
Some of these messages looked at first glance like they were incorrectly
concatenated, e.g. "installing DIRS testsFILESDIR".  Add a colon to
clarify.

Reviewed by:    brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60525
39f7dbff606de56d0a4a18cc9b8ccc5fe1d54c2b Ed Maste 2025-05-21 17:45:09

debug: classified in 03-filenames_plain1 by 'share/mk/'

Commit group #13: man: Link mgb.4 to if_mgb.4
man: Link mgb.4 to if_mgb.4

For consistency, create a symbolic link from mgb.4 to also
if_mgb.4

Reviewed by:            #manpages, ziaee, emaste
Differential Revision:  https://reviews.freebsd.org/D60551
MFC after:              3 days
05c49e2aa6439820f8f4d5bbf19634f84f6bad5a Juraj Lutter 2026-10-09 19:54:04

debug: classified in 02-filenames_wildcards by '.*Makefile'


man4: Only link mgb.4 to if_mgb.4 where mgb.4 is installed

mgb.4 is only installed on amd64 and i386, move the MLINKS entry into
the amd64/i386 block next to _mgb.4.

Fixes:          https://cgit.freebsd.org/src/commit/?id=05c49e2aa643 ("man: Link mgb.4 to if_mgb.4")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
e0a5aa37c1ef3a22e2dc8c311e0e32ea363f7ccf Li-Wen Hsu 2026-10-10 21:02:05

debug: classified in 02-filenames_wildcards by '.*Makefile'


man.4: Create if_mgb.4 symlink on supported architectures only.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=05c49e2aa643 ("man: Link mgb.4 to if_mgb.4")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=e0a5aa37c1ef
Differential revision:  https://reviews.freebsd.org/D60551
2d935a1e93af4d552db1f7218ef97e01f058c084 Juraj Lutter 2026-10-10 13:29:03

debug: classified in 02-filenames_wildcards by '.*Makefile'

tests/libc: only build brk_test where libc provides sbrk
Replace the exclusion list with an allowlist of the architectures
whose libc exports brk/sbrk: amd64, i386, arm and powerpc.

On aarch64, riscv and loongarch libc does not export those symbols
and the test cannot run, so do not build it there. New architectures
now default to not building the test unless brk support is added.

MFC after:      1 week
Signed-off-by:  Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60357
8a7df6c58d549bd2eaa5cad30b2ef93c3eca3c18 Xiaoqiang Zhao 2026-10-10 17:45:18

debug: classified in 02-filenames_wildcards by '.*Makefile'

Internal organizational stuff

ObsoleteFiles.inc: add more obsolete files
152dd1a0ee3076be117e7897c666df95a5a4447d Antoine Brodin 2026-10-05 19:57:35

debug: classified in 03-filenames_plain1 by 'ObsoleteFiles.inc'

committers-src: Add lytboris mentored by ae@
Reviewed by:    ae
Approved by:    ae (mentor)
bd369bc7c2368b19789cfabcea99e355e1e959da Boris Lytochkin 2026-10-07 11:18:00

debug: classified in 03-filenames_plain1 by '['.mailmap', 'share/misc/committers-src.dot', 'usr.bin/calendar/calendars/calendar.freebsd']'

.gitignore: add tgrep index directory
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
c2b7fe4a9e94a0edba9dd2772874928b565c4f9e Konstantin Belousov 2026-10-08 09:20:16

debug: classified in 03-filenames_plain1 by '.gitignore'

Add Christos Longros as ports committer, update mentor/mentee
Reviewed by:  jrm (mentor)
Approved by:    jrm (mentor)
Differential Revision:  https://reviews.freebsd.org/D60591
3061504326cc62d7883dc9320ccb35c02a84d1cf Christos Longros 2026-10-10 18:44:59

debug: classified in 03-filenames_plain1 by 'share/misc/committers-ports.dot'

Testing

tests/netinet6: fix ndp_del_gu_success flakiness
The test pinged an unanswered address and then deleted the resulting
INCOMPLETE neighbor entry.
The kernel frees that entry after about 3s, so on a loaded VM,
ndp -d could run too late and fail with ENOENT.

Configure 2001:db8::2 on epair0b so the ping gets a reply and the
entry becomes REACHABLE.

Approved by:    pouria
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60348
a6a864080cfe2e8308cfae8d07f1affe1a4ac8fa Olivier Cochard 2026-10-07 04:04:16

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/kern: Skip some timer tests if ncpu == 1
62f54beab05a196fd05170eafcc7715b3f4150b0 Mark Johnston 2026-10-08 15:20:59

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

ncal: convert legacy TAP tests to ATF
MFC after:    2 weeks
Sponsored by:   ConnectWise
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2465
Reviewed by:    imp
570d050f4e182ea2cd6c26a996b69fde6049ac4f Alan Somers 2026-10-08 19:19:54

debug: classified in 02b-filenames_wildcards2 by 'usr.bin/.*/tests/.*'

Style, typos, and comments

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

acpi: Tasks: Make OsdSchedule.c whitespace clean
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
f0825f75bab8ae7cb8e0ba717f76110b6f1862f3 Olivier Certner 2026-10-02 17:12:46

debug: classified in 01-style by '[wW]hitespace'

makefs: Correct style(9) nit from a recent change
Fixes: https://cgit.freebsd.org/src/commit/?id=b9811d13572b ("https://cgit.freebsd.org/src/commit/?id=cd9660: merge level 1 and 2 filename conversion")
3ba592cfea1a5625024a0974fa5268f2e0c8f808 Ed Maste 2026-09-23 19:40:16

debug: classified in 01-style by '[sS]tyle'

sound: Whitespace cleanup
In advance of additional sound(4) work, remove EOL whitespace and mixed
tab/space.

Reviewed by:    christos
Differential Revision: https://reviews.freebsd.org/D60442
dd51cef58311ee0024be99116238d1c0032bdf2b Ed Maste 2023-12-02 02:42:36

debug: classified in 01-style by '[wW]hitespace'

Contrib code

sem test: avoid ETIMEDOUT races in the EINTR test cases
timedwait and clockwait_absolute_intr_remaining arm a 50ms SIGALRM and then
wait until an absolute deadline only 100ms in the future.
On a loaded VM the signal can be delivered more than 50ms late, so the wait
times out first.

Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60347
9af3990ba7940e85c31b5fc074e9510ee195465f Olivier Cochard 2026-10-07 00:00:58

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/expat: import expat 2.9.0
Changes: https://github.com/libexpat/libexpat/blob/R_2_9_0/expat/Changes

Security:       CVE-2026-102633
Security:       CVE-2026-77214
MFC after:      3 days
22c3edb31297a79ec3c7bf8f906be2df11b472d2 Philip Paeps 2026-10-06 07:05:31

debug: classified in 05-summary-prefix by 'contrib/'

Commit group #14: contrib/kyua: update to 0.15.0
contrib/kyua: update to 0.15.0

This new release contains multiple feature updates and bugfixes. Please
see the release notes mentioned in the merge commit for more details.

MFC after:      1 month
Merge commit '144afd05f8a2300361ec30c1c2020e4022ddd943'

Conflicts:
        contrib/kyua/cli/cmd_debug.cpp
        contrib/kyua/doc/kyua-debug.1.in
        contrib/kyua/doc/kyuafile.5.in
        contrib/kyua/engine/config.cpp
        contrib/kyua/engine/execenv/execenv.cpp
        contrib/kyua/engine/execenv/execenv.hpp
        contrib/kyua/engine/execenv/execenv_host.hpp
        contrib/kyua/engine/requirements.cpp
        contrib/kyua/engine/requirements.hpp
        contrib/kyua/engine/scheduler.cpp
        contrib/kyua/model/metadata.cpp
        contrib/kyua/os/freebsd/execenv_jail.hpp
        contrib/kyua/os/freebsd/execenv_jail_stub.cpp
        contrib/kyua/os/freebsd/main.cpp
        contrib/kyua/os/freebsd/reqs_checker_kmods.cpp
        contrib/kyua/os/freebsd/utils/jail.hpp
        contrib/kyua/utils/fs/directory.cpp
        contrib/kyua/utils/process/executor.cpp
eb8f69902f7de8012a31a85db2f88a54584f81af Enji Cooper 2026-10-07 17:50:26

debug: classified in 03-filenames_plain1 by 'contrib/'


contrib/kyua: commit Makefile changes for version update

This was accidentally missed in the version update.

MFC after:      1 month
Fixes: https://cgit.freebsd.org/src/commit/?id=eb8f69902 ("contrib/kyua: update to 0.15.0")
b836604e126d5b3d0d3dee5da6c4168d3ec43fea Enji Cooper 2026-10-07 17:55:21

debug: classified in 02-filenames_wildcards by '.*Makefile'


contrib/kyua: commit generated files

MFC after:      1 month
Fixes: https://cgit.freebsd.org/src/commit/?id=eb8f69902 ("contrib/kyua: update to 0.15.0")
26eb328b52c3ec0ff79c8914b1993dfad03a0a7d Enji Cooper 2026-10-07 18:04:21

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

debug: moved to contrib because 'Need to be grouped with eb8f69902f7de8012a31a85db2f88a54584f81af'

openssl: build libcrypto and libssl from upstream's source set
Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.

libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
  and MD5_ASM, as upstream does.  Both files have been generated into
  sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
  compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
  Upstream keeps them in libcommon.a, but the linker does not extract
  them into libcrypto (checked with --why-extract) as nothing in
  libcrypto references them.

libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.
- Build libssl's own copy of crypto/thread/arch*.c, as upstream does.
  Before this change, libssl got these functions from libcrypto, which
  exports them only for this purpose.  A planned later change removes
  those exports.

crypto/openssl:
- crypto/bio/bio_sock2.c: remove the local ktls_enable() call in
  BIO_socket() it does nothing on FreeBSD.  The file is now identical
  to upstream.
- Remove the empty file "patch", committed by mistake in f775385affef.

With this change, libssl no longer imports any libcrypto internals.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60395
ba9a5169d16556d682d03989e15574ed346db092 Gordon Tetlow 2026-10-08 18:25:57

debug: Commit manually moved from "unknown" to "contrib".

openssl: configure with --openssldir=/etc/ssl
BSDmakefile passed --openssldir=etc.  A relative openssldir is taken
relative to the prefix, so the generated files described /usr/etc.
FreeBSD has always used /etc/ssl (OPENSSLDIR in
secure/lib/libcrypto/Makefile.common), so configure with that.

Regenerate tools/c_rehash, the only committed generated file that
depends on openssldir.  It is not installed.  No compiled code changes.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60396
cb3d3e5bb0c6bbb1f6ef3efe67e7a6e71bc20f0b Gordon Tetlow 2026-10-08 18:27:59

debug: classified in 03-filenames_plain1 by 'crypto/openssl/'

ctf*: exit with error upon terminate()
The initial port of the CTF tools had a FreeBSD-specific patch to print
the termination message but exit with a 0 status, with a goal of getting
as much to build as possible and silently ignoring any issues.

We're now past the point where silently ignoring failures makes sense.
Any future issues need to be found and addressed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276826
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276930 [exp-run]
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43743
e959f2a7d8a8ac942983328f91cd5c566e3f72cb Ed Maste 2024-02-04 21:47:50

debug: classified in 03-filenames_plain1 by 'cddl/contrib/'

zfs: drop duplicate `vfs.zfs.metaslab.condense_pct` sysctl
`metaslab.c` already registers this tunable via `ZFS_MODULE_PARAM`, so the
`SYSCTL_UINT` here is a second registration of the same leaf. This
resulted in messages like:

```
sysctl_register_oid: can't re-use a leaf (vfs.zfs.metaslab.condense_pct)
```

Remove the duplicate sysctl registration, as upstream (OpenZFS) did.

MFC after:      1 week
Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Reviewed by:    imp, mm, ngie
Differential Revision:  https://reviews.freebsd.org/D57721
62e958df018a0af83252c4e8f63208be41fc14a8 Christos Longros 2026-10-10 07:11:03

debug: classified in 03-filenames_plain1 by 'sys/contrib'

tests/libc: use an allowlist for sbrk in NetBSD-derived tests
sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAVE_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60358
d45f069002f211398fd7790509fbd25ec6d1c713 Xiaoqiang Zhao 2026-10-10 17:39:44

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/bc: remove vs sub-directory
Some of the files in the vs sub-directory are checked out with  CRLF
line breaks via .getattributes. This causes issues when checking out
the source tree with other tools that operate on Git repositories like
"got". Remove the vs sub-directory from the contrib tree, since it is
not required on FreeBSD.
94d4ba04a96f495d635bf246e4d5021eb1faab22 Stefan Eßer 2026-10-10 20:51:30

debug: classified in 03-filenames_plain1 by 'contrib/'

compiler-rt: enable use of .preinit_array after ef758b59a44e
After base ef758b59a44e6b5b2d2dc178b97c01cde1b34570 we can enable usage
of .preinit_array in compiler-rt's sanitizers. The comment that stated
"On FreeBSD, .preinit_array functions are called with rtld_bind_lock
writer lock held. It will lead to dead lock ..." can also be removed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
000856156745f1a9a05705f8a499c0fd84f183ca Dimitry Andric 2026-10-10 21:41:52

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit 681c2ee4dfbf from llvm-project (by Justin King):
  asan: refactor interceptor allocation/deallocation functions (#145087)

  Do some refactoring to allocation/deallocation interceptors. Expose
  explicit per-alloc_type functions and stop accepting explicit AllocType.
  This ensures we do not accidentally mix.

  NOTE: This change rejects attempts to call `operator new(<some_size>,
  static_cast<std::align_val_t>(0))`.

  For https://github.com/llvm/llvm-project/issues/144435

  Signed-off-by: Justin King <jcking@google.com>

This a prerequisite for adding sanitizer interceptors for free_sized(3)
and free_aligned_sized(3).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
6b0f64133cd930fec8971aa85f4ef36a67b8334f Dimitry Andric 2026-10-10 21:44:49

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit a5fa4dba6e2e from llvm-project (by PiJoules):
  [compiler-rt] Add interceptors for free_[aligned_]sized for asan+hwasan (#189109)

This avoids a jemalloc assertion when running sanitized applications
against glib, which uses free_sized(3).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
a3fbf20c0558ee3c2b88adc0c944e66d074cab7b Dimitry Andric 2026-10-10 21:47:47

debug: classified in 03-filenames_plain1 by 'contrib/'

Reverted commits

Commit & revert pair: linux: implement sched_getattr()
linux: implement sched_getattr()

This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.

This unbreaks using the Linux version of Chromium on FreeBSD.

This change was originally submitted via [freebsd/freebsd-src#2370][github-pr].

MFC after:      2 weeks
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297468
Co-Authored-By: Enji Cooper <ngie@FreeBSD.org>
Signed-off-by:  Joao Bonifacio <joaoboni017@gmail.com>

[github-pr]: https://github.com/freebsd/freebsd-src/pull/2370

Differential Revision:  https://reviews.freebsd.org/D60214
bb5f10e51bd53771f1a438f36f554256fcbd7d08 Enji Cooper 2026-10-05 22:48:22

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "linux: implement sched_getattr()"

The changes need to be reviewed further; revert until the issues have
been worked out.

Requested by:   markj
This reverts commit bb5f10e51bd53771f1a438f36f554256fcbd7d08.
32f5a9f3fb512908805901a1739383766417dd8d Enji Cooper 2026-10-06 04:49:15

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: linux: implement fchmodat2 syscall
linux: implement fchmodat2 syscall

The fchmodat2 syscall on Linux is effectively the same as the fchmodat
on FreeBSD, whereas fchmodat on Linux is fchmodat on FreeBSD, minus
the `flags` argument.

This change provides the necessary glue in order to call kern_fchmodat
properly via the Linuxulator.

NB: glibc transparently passes through the `flags` argument, so this is
[largely] a no-op for end-users, but it affects those who compiled
binaries specifically using the fchmodat2 syscall.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60394
c070ec923e2f49b6ecb5a60b584ba8f4376a6e80 Enji Cooper 2026-10-05 23:50:38

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "linux: implement fchmodat2 syscall"

This got accidentally committed when I was reverting another commit.

This reverts commit c070ec923e2f49b6ecb5a60b584ba8f4376a6e80.
4abfb452ea2d18c4710dffee7f3e65167d543041 Enji Cooper 2026-10-06 04:51:35

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

socket: Remove the divert(4) socket compat shim again
Python in the ports tree now handles PF_DIVERT sockets properly; see
ports commit 4d84480d7a68.  I no longer have any specific reason to keep
the shim and Gleb wants to remove it, so, let's remove it.

This reverts commit cb7009867ae6b33aa39cb6cb1453b69073144b44.

Requested by:   glebius
Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D60390
5bf78497dc3ad24197e4940c91ab7c06230af86b Mark Johnston 2026-10-08 17:10:32

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: tests/libc: use an allowlist for sbrk in NetBSD-derived tests
tests/libc: use an allowlist for sbrk in NetBSD-derived tests

sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAS_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60358
36b849b5c76406bb6d9341bfb1a7f16ae5c189c9 Xiaoqiang Zhao 2026-10-10 17:39:44

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "tests/libc: use an allowlist for sbrk in NetBSD-derived tests"

Need to update the commit message.

This reverts commit 36b849b5c76406bb6d9341bfb1a7f16ae5c189c9.
e8431fae655be5f3c5b95e091e72960ff713431f Enji Cooper 2026-10-10 17:43:00

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

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.21 at 2026-11-16 20:33:55+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-10-05 (release)