FreeBSD git weekly: 2026-01-01 to 2026-03-31

Introduction

This is a display of mostly-automatically-classified git commits from 2026-01-01 to 2026-03-31.

Table of contents and commits per category:

(17) Highlighted commits (these are copies, not in stats)
77 4.3% Userland programs
107 6.0% Documentation
457 25.6% Hardware support
155 8.7% Networking
154 8.6% System administration
88 4.9% Libraries
25 1.4% Filesystems
284 15.9% Kernel
140 7.8% Build system
38 2.1% Internal organizational stuff
87 4.9% Testing
70 3.9% Style, typos, and comments
73 4.1% Contrib code
29 1.6% Reverted commits
0 0.0% Unclassified commits
1784 100% total
Technical notes about this page

Highlighted commits

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

powerpc: put the isync inside the TD_LOCK() checking loop
Fix a narrow window where the lock is unlocked but the checking CPU
hasn't flushed things appropriately.

Inside this window the CPU inside cpu_switch() will loop forever thinking
the destination thread is still blocked/locked even though it is not.

This manifests as the system hanging after starting all APs.

I've seen this reliably trigger in qemu-system-ppc64 running power9 pseries
guests; the more CPUs the more likely it triggers at boot.

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292167
Differential Revision:  https://reviews.freebsd.org/D54478
Reviewed by:    jhibbits
MFC after:      1 week
Relnotes:       yes
8df2e542146801fd01675e56724eaa567d04c209 Adrian Chadd 2026-01-03 22:52:14
zstd: Move to a new zstd package
Zstd is a discrete, self-contained system component.  To match how we
package zlib, bzip2 and xz, move it to its own package, with a separate
lib package.

Add the new package to the minimal set, since this is a core component
that users expect to be installed.

This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.

MFC after:      never
Reviewed by:    bapt
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53603
9c401bf14854ef20e5e187395a686b0d1b7bcb5f Lexi Winter 2026-01-06 04:23:22
nvme: Add APST payload overriding
The apst_data tunable allows APST configuration to be adjusted
during controller initialization.  It accepts an array of encoded
integers, each defining specific transition parameters.

Relnotes: YES
Signed-off-by: Alexey Sukhoguzov <sap@eseipi.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1444
f0d44ee06b6814224653324e09a948e15a177d1f Alexey Sukhoguzov 2024-10-30 11:04:49
RELNOTES: Add some entries from the past several weeks
Reviewed by:  emaste
Differential Revision:  https://reviews.freebsd.org/D54628
e3bfcf6b594e8388c4a2e1835519a8026e90cf71 Mark Johnston 2026-01-09 17:58:00
daemon: Add option for output file mode
The daemon utility has always created its output file with a fixed mode
of 0600. This causes issues for log collection setups where the collector
does not run as root but instead relies on group access to the watched
daemon’s log file.

Introduce a new option that allows specifying the output file mode using
install(1)-style semantics. This enables non-root log collectors to access
the file as intended and improves compatibility with log rotation tools.

Reviewed by:    kevans
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D54930
a3b90a1f008365d9f62773998f89f9c872e2bed5 Michael Osipov 2026-01-28 18:49:26
aw_mmc: Reset card
On H616 (and I think H6, but this isn't verified) we need to reset the
card to have a functioning device.

With this commit all my pending patches for H616 are in tree. We run
well on my test device (Orange Pi Zero3), however there is an
uninvestigated issue with ethernet and graphics are an open question.

Reviewed by:    manu, adrian
MFC After:      1 week
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55097
ec5d4664915f51ae62daec09fa4f9765c969adab Tom Jones 2026-02-09 15:48:24
sys/netinet6: switch net.inet6.ip6.use_stableaddr to on by default
This change switches to using RFC 7217 algorithm as the default to
generate SLAAC addresses for IPv6 interfaces configured with
accept_rtadv.

Reviewed by:            pouria, glebius, zlei
Approved by:            zlei
Relnotes:               yes
Differential Revision:  https://reviews.freebsd.org/D55138
a2eb0894b79bd0241e51c6888a52bea369ae8a6a Guido Falsi 2026-02-09 20:27:15
hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values
We were using percents, for compatibility with hwpstate_intel(4), but
this looses granularity that might be important in some scenarios or
with specific CPU models.

For consistency, hwpstate_intel(4) should be changed accordingly, at the
expense of breaking compatibility.

For release notes: Introduction of hwpstate_amd(4) deserves a release
note, even if the original commit was not tagged.  Functionality
introduced by recent commits tagged with "Relnotes" should be mentioned
along that one.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55009
951788e3733e415ca4721c0a63454937dcb29b2c Olivier Certner 2026-01-27 11:44:29
hwpstate_amd(4): Add knobs to get/set all fields of CPPC_REQUEST
This will allow experimentations and finer-grained tuning to the full
extent allowed by the hardware, which is especially important given that
the spec leaves to hardware implementors an important leeway in
interpreting CPPC's numeric parameters, causing the same settings to
have different effects on different CPU models.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast (older version)
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55010
7689e68506a900de4ba79924d781f092bb9d0335 Olivier Certner 2026-01-27 12:39:40
bhyve: fix USB mouse requests
USB HCI requests may not include HCI transfer block structures (i.e.,
xfer->data[] == NULL), but in several places, the USB mouse emulation
code assumes one will exist. This can lead to a NULL pointer dereference
and a SEGV in the bhyve process as observed via experiments with an
Ubuntu guest and PyUSB code. Note that many of the cases processing
other request types already checked for data == NULL.

While in the neighborhood, fix a typo in the loop iterating over the
usb_data_xfer_block array which used the wrong variable to check for
valid data (idx vs. i).

Reported by: danmcd@edgecast.io
Obtained from: SmartOS
MFC after: 1 week
Relnotes: yes

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54661
10d5404adb11773969a600428d1abeb4308d98aa Chuck Tuffli 2026-02-19 22:27:49
hwpstate_amd(4): CPPC: Switch the default to maximum performance
Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55253
80d32a6b1d73e0c81303417fa280ac74ef1f417a Olivier Certner 2026-02-09 17:45:07
asmc(4): pull 32-bit support for the driver
The asmc(4) driver should work for 32-bit Intel-based Macs, in theory, if
the model details were added to the detection list. That being said,
32-bit Intel Macs were only released and available to the general public
for 8 months [1], so the value in maintaining i386 support in the driver is
reduced due to limited hardware access.

Remove 32-bit support for the driver officially to make it clear its use is
not supported.

This should fix building `NOTES.i386` by proxy as well.

Relnotes:       yes
MFC after:      2 weeks
Fixes:          https://cgit.freebsd.org/src/commit/?id=f224591746b ("Add ASMC_DEBUG make option")
Fixes:          https://cgit.freebsd.org/src/commit/?id=8342d9f7b5f ("asmc(4): Stop building it on i386, as...")
Differential Revision:  https://reviews.freebsd.org/D55544
1f2f5eba24aa53e180a4eb46b772410e5a782469 Enji Cooper 2026-01-05 03:36:55
ipfw: add support for masked ip-address lookups
Current radix-based implementation of lookup tables in ipfw does
not support non-contiguous prefixes while this type of lookup is
needed to write CPU-effective firewall configurations.

For some of the cases we can reach the goal using a masked table
lookup by adding masked (e.g. zero non-significant bits) records
into a table and then zero non-significant bits in lookup key
prior to making a table lookup.

Obtained from:  Yandex LLC
MFC after:      3 weeks
Relnotes:       yes
Sponsored by:   Yandex LLC
Differential Revision:  https://reviews.freebsd.org/D53694
32cd3ee5901ea33d41ff550e5f40ce743c8d4165 Boris Lytochkin 2026-03-01 18:54:24
sys: Retire le(4)
We retired most obsolete 10 and 10/100 Ethernet NIC drivers in 2019 --
see commits following ebcf740a32ae ("FCP-101: remove obsolete 10 and
10/100 Ethernet drivers.).

le(4) was retained with with the note "Emulated by QEMU, alternatives
don't yet work for mips64."  MIPS has since been removed from the tree
and emulators and virtual machines offer many other, more suitable
devices.

Reviewed by:    brooks
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55516
7a323f873662dae95a061d1eaf8b1d9d1a0f8a23 Ed Maste 2025-10-24 17:26:03
netinet6: Remove support for connecting to IN6ADDR_ANY
RFC4291 section 2.5.2:
    The unspecified address must not be used as the destination address
    of IPv6 packets or in IPv6 Routing headers.  An IPv6 packet with a
    source address of unspecified must never be forwarded by an IPv6
    router.

We disallowed connections to IN6ADDR_ANY by default, as of commit
627e126dbb07 ("netinet6: Disallow connections to IN6ADDR_ANY").  As this
is actually disallowed by the RFC, just remove the support.

Reported by:    bz (in D54306)
Reviewed by:    bz, glebius
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54942
a1789fa30c0b1e4c20a083c550f0ec2d50e480e4 Ed Maste 2026-01-27 21:29:20
MFV: zlib 1.3.2.
Relnotes:     yes
MFC after:      2 weeks
7aa1dba6b00ccfb7d66627badc8a7aaa06b02946 Xin LI 2026-03-13 23:49:53
routing: Retire ROUTE_MPATH compile option
The ROUTE_MPATH compile option was introduced to
test the new multipath implementation.
Since compiling it has no overhead and it's enabled
by default, remove it.

Reviewed by:    melifaro, markj
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D55884
254b23eb1f540844cf2a90f2781ae4231c5701ce Pouria Mousavizadeh Tehrani 2026-03-27 11:20:05

Userland programs

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

df: Fix -k flag consistency with other BLOCKSIZE flags
This patch resolves inconsistent behavior between the -k option and
other related flags, including -P. Previously, using -k resulted in
output displayed in 1024-byte blocks, which did not align with the
behavior of similar options such as -m and -g, where output is shown in
1M-blocks and 1G-blocks respectively.

The updated implementation ensures that -k now correctly displays sizes
in 1K-blocks. In addition, the patch incorporates the POSIX requirement
that when both -k -P are specified, the block size must be explicitly
forced to 1024-blocks.

Together, these changes make the behavior of -k consistent, predictable,
and compliant with the standard.

Signed-off-by: Ankush Mondal <mondalankush9851@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1906
539547151678c63903dddda214b16b177cf418b8 Ankush Mondal 2025-11-29 11:15:30
login.conf.5: Remove mention of login copyright setting
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291649
Fixes: https://cgit.freebsd.org/src/commit/?id=905571c03119 ("Remove copyright strings printed at login time via login(1) or sshd(8).")
Signed-off-by: Simon Wollwage rootnode+freebsd@wollwage.com
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1926
54ce6b2c4c163d85b2a8804edbac69d4e8cb3355 Simon Wollwage 2025-12-15 06:27:19
Remove obsolete BUGS section from zgrep(1) man page, add test
I forgot to check/update the man page with D54217. While here add
a test for multiple -e flags.

Reviewed by:    markj
Approved by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54632
da5d94d29a5ec29817476c39ae2b2ad1666c3f06 Craig Leres 2026-01-10 00:34:39
truncate: fix a minor nit + add a hole-punching test
The struct spacectl_range we use is only really used in these three
lines of code, so re-scope it down to just the dealloc branch.  This is
marginally easier to reason about what might be necessary to replace in
porting our truncate(1) to other platforms.

While we're here, add a test for the -d flag to be sure it really does
punch a hole in the file.  The test also tries to confirm that it does
not disturb other segments of the file in the process, just to inspire
some confidence that it's not corrupting the file somehow.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D51207
eacc501eff52db16b7b784c89a3a4a03c9a3ef34 Kyle Evans 2026-01-21 23:34:27
Commit group #0: diff
diff: fix support for -l with new diff algorithm

MFC After: 3 days
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D55052
4d73b07d02d12cdff0558d3ca6c4b3224cae831f Baptiste Daroussin 2026-02-02 15:43:29

diff: use pdwait(2) instead of homemade one

MFC After:      3 days
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D55053
0ec58e7c2e533a15eabfe8dca4a14e9ae93de4b5 Baptiste Daroussin 2026-02-02 15:44:34

diff: remove useless include as kevent is not used anymore

MFC After:      3 days
c479817f30b2d2500c9663a1a07c74ba19321416 Baptiste Daroussin 2026-02-02 16:13:55
diff3: use pdwait instead of homemade one
MFC After:    3 days
404753664a5e145d98f1749d1c7bc046c8aa32c3 Baptiste Daroussin 2026-02-02 16:29:49
runat: Add -h to manipulate a symlink's named attribute dir
Lionel Cons <lionelcons1972@gmail.com> requested
that a new option be added to runat(1) so that it could
be used to manipulate named attributes associated with
a symbolic link and not the file the symbolic link refers to).

This patch adds the option -h/--nofollow to do this.

Requested by:   Lionel Cons <lionelcons1972@gmail.com>
Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55023
4bfb7cfb70e62bc316de9e73cfd63a5c85541154 Rick Macklem 2026-02-02 22:38:13
touch: Fix setting time of created file if fstat() fails
Previously, if creating the file and fstat() fails, we would've ended up
calling utimensat() on that file anyways with whatever was in sb.  Not
that this is an error likely to happen...

We don't check for the return value of close() as we aren't writing
anything to the file and the file is always created on success of
open().

Reviewed by:    kevans
Approved by:    kevans
Fixes:  https://cgit.freebsd.org/src/commit/?id=cb54c500d0e1 ("touch: don't leak descriptor if fstat(2) fails")
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55117
MFC after: 1 week
b8d55a86995b5a8db5d1651c8dc9fc5093b67d2c Aymeric Wibo 2026-02-04 20:58:13
diff: Print an error message on I/O error
If an error occurs while atomizing either file, immediately print an
error message using the error code returned by the atomizer, and set
the error bit in the exit status.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292198
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55109
55f160fb07eaee977c89bdee7bdd83f4d21f5adf Dag-Erling Smørgrav 2026-02-05 14:39:39
Commit group #1: diff: Don't compare a file or directory to itself
diff: Fix integer overflows in Stone algorithm

Fix integer overflows that may occur when the context window is very
large and add tests to exercise those conditions.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267032
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55110
5fc739eb5949620da911db2f87ca8faedc549d3a Dag-Erling Smørgrav 2026-02-05 14:39:43

diff: Add test case for pagination resource leak

The pagination code leaks either processes or descriptors or both,
depending on the exact version of the code you have.  Add a test case
which exercises this leak to facilitate fixing it.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55111
270492602b9bd8b8fce4f021f055804978bf3f23 Dag-Erling Smørgrav 2026-02-05 14:39:47

diff: Don't compare a file or directory to itself

While here, stop abusing struct dirent for something we don't even need
to store.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254455
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55113
590126789c841d80655869bc075c8980c173dd1c Dag-Erling Smørgrav 2026-02-05 14:39:57

diff: Fix build

rc must be defined first.

Fixes:          https://cgit.freebsd.org/src/commit/?id=590126789c84
MFC after:      1 week
X-MFC with:     590126789c84
ee44ab936e84bacaa49847d36aabdf280f9fecce Cy Schubert 2026-02-05 15:18:09

diff: Correctly declare tests

Sponsored by:   Klara, Inc.
Fixes:          https://cgit.freebsd.org/src/commit/?id=5fc739eb5949 ("diff: Fix integer overflows in Stone algorithm")
Fixes:          https://cgit.freebsd.org/src/commit/?id=270492602b9b ("diff: Add test case for pagination resource leak")
Fixes:          https://cgit.freebsd.org/src/commit/?id=590126789c84 ("diff: Don't compare a file or directory to itself")
157d6664aeb815db3b758bd3038fd1512a0f4e2c Dag-Erling Smørgrav 2026-02-05 16:21:22
diff: Fix pagination leak
* Drop an unnecessary variable and rename pidfd to procd.

* Rewinding stdout serves no purpose, so stop doing it.

* Don't bother freeing memory or setting the global status right
  before erroring out.

* Error out if dup(2) or dup2(2) fail.

* In the unlikely case that our pipe is equal to stdout, we need to
  record that information so we don't close it when cleaning up.

* Don't bother closing a descriptor before dup2(2)ing to it.

* Don't forget to close the the process descriptor after reaping the
  child process.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266592
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D55112
c3904a7de78ca1ca15fcdf4c09f9d4be7f6fe6f5 Dag-Erling Smørgrav 2026-02-05 14:39:53
diff: Report I/O errors in Stone algorithm
In the legacy Stone algorithm, we do a first pass over the files to
check if they're identical before we start diffing them.  That code
would correctly set the exit status if an I/O error was encountered,
but would not emit an error message.  Do so.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292198
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj
Differential Revision:  https://reviews.freebsd.org/D55125
f8c12e6e3874cdd353fb16785da6f4e7eb134cd9 Dag-Erling Smørgrav 2026-02-05 17:41:56
diff: Bump version number
MFC after:    1 week
Sponsored by:   Klara, Inc.
40134060f6583486ad8ab303140fa73960d3de3d Dag-Erling Smørgrav 2026-02-06 00:13:27
m4: Change defn processing order
Currently, defn pushes its arguments on the stack in order, which means
they are then processed in reverse order.  POSIX does not specify what
order they are processed in, which arguably suggests that they should be
processed in the order they are listed.  Push them in reverse order so
they will be processed in their original order.  This matches GNU m4.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292937
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    obiwac, imp
Differential Revision:  https://reviews.freebsd.org/D55116
25a8168f86a1222388475ce858da405e4d06c1c3 Dag-Erling Smørgrav 2026-02-07 18:16:21
chio: Add SPDX-License-Identifier tags
Some BSD-4-Clause files under bin/chio were missing the
SPDX-License-Identifier-tag.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55193
b6824fe48e4197877f472268859ffe80d7fd946b Tuukka Pasanen 2026-02-09 07:47:08
pwd: Clean up and adopt POSIX semantics
According to POSIX, the default should be -L.  Based on code history,
whoever first wrote BSD pwd(1) could not figure out how to implement
-L and therefore made -P the default (and only) option. Support for -L
was later added, but the default was never changed.

Clean up the code, make -L the default, and rewrite getcwd_logical() to
reject paths that contain dot or dot-dot, as required by POSIX.

MFC after:      1 week
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D55146
2df923c5d2d02350abc29f61b603c5b9615b225c Dag-Erling Smørgrav 2026-02-10 14:29:04
pwd: Error out if writing to stdout failed
POSIX requires us to print a diagnostic and return a non-zero exit
code if writing to stdout failed.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55227
5b398611607b0dab2f2550ef73f62d41dab6fac5 Dag-Erling Smørgrav 2026-02-11 02:06:41
cp: Expect EINTR while copying
Both copy_file_range() and copy_fallback() can be interrupted before
they have read anything at all, in which case they return -1 and set
errno to EINTR.  If that happens, we should retry, not fail.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293028
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55167
7aa30669d6e04444b8ad1e4863a6e674fcac4afc Dag-Erling Smørgrav 2026-02-11 16:24:46
install: Expect EINTR while copying
Both copy_file_range() and read() / write() in our fallback loop can be
interrupted before copying anything at all, in which case it returns -1
and sets errno to EINTR.  If that happens, we should retry, not fail.

While here, drop the size argument from copy() (we always want to copy
the entire file anyway) and add test cases which exercise the metalog
and digest functionality.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293028
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55168
0fb940fd63dd9b6d6b848421c53b1e9ac8387265 Dag-Erling Smørgrav 2026-02-11 16:24:50
diff: Improve directory loop detection
When we're done processing a directory, remove its entry from the tree
of visited inodes, ensuring that we only report a loop when we encounter
a descendant-to-ancestor link, not when we encounter a cousin-to-cousin
or sibling-to-sibling link.

MFC after:      1 week
Reported by:    Bakul Shah <bakul@iitbombay.org>
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55248
71569594d860a59d8362770a56d806e1d31fb946 Dag-Erling Smørgrav 2026-02-11 16:24:54
ls: check fts_children() for errors that may not surface otherwise
In particular, if one simply does a non-recursive `ls` on a directory
that is not accessible, there are some classes of errors that may cause
it to fail that wouldn't be surfaced unless we do an fts_read() that
will recurse into the inaccessible directory.  Catch those kinds of
errors here since we cannot expect to an FTS_ERR/FTS_DNR entry to follow
up on them.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287451
Reviewed by:    kib
Discusssed with:        des
Differential Revision:  https://reviews.freebsd.org/D51056
7bf81e39d83087dc7f984077b5eed5a48df794d4 Kyle Evans 2026-02-11 19:55:55
diff3: fix diff3 -A
for cases where file2 differs but file1 and file3 agrees, the code
stored the file2 and file3 line numbers in the de[] editing script
entries but used them as if they were file1 line numbers.

Reviewed by:            thj
Differential Revision:  https://reviews.freebsd.org/D55276
8d442cf32e4fb29fbb85090ac29d32d1e30fd824 Baptiste Daroussin 2026-02-13 08:33:17
Commit group #2: diff3: fix merge mode
diff3: fix merge mode

Make the merge mode compatible with GNU diff3
Add tests for all the changes, those tests are extracted from the
etcupdate testsuite.

This version passes the etcupdate testsuite and the diffutils diff3
test suite.

MFC After:      1 week
2cfca8e710f260b8a1bb1ee5e1836a52e468ef4b Baptiste Daroussin 2026-02-13 16:10:44

diff3: add 3 missing files from the testsuite

Fixes:  https://cgit.freebsd.org/src/commit/?id=2cfca8e710f260b8a1bb1ee5e1836a52e468ef4b
284a0aa96eb63f12831a9e06514a50b2cd80957f Baptiste Daroussin 2026-02-13 17:45:39
diff: Tweak range of -C and -U arguments
POSIX uses the terms “positive decimal integer” for -C and “non-negative
decimal integer” for -U, which translates into lower bounds of 1 for -C
and 0 for -U.

POSIX does not specify a minimum upper bound for either mode, but as of
5fc739eb5949 both our backends support context sizes up to and including
INT_MAX, so use that.

Having had the opportunity to consult the Unix System Test Suite, the
diff test cases found therein happen to precisely match these bounds.

While here, switch to using strtonum() to parse numerical arguments, and
try to be more consistent in how we report usage errors.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55261
790f1d1cc5fa892ba59fd7f239b22064c8ab14c7 Dag-Erling Smørgrav 2026-02-13 20:18:24
timeout: Clean up
* Annotate logv() and fix format string bug.

* Don't reinvent str2sig(3).

* Reorganize kill_self() so we unblock signals as late as possible, and
  use raise(2) instead of kill(2).

* Explicitly close unused pipe descriptors.

* Use correct type to collect result of read(2) and write(2).

* Compare return values to 0, not -1.

* Sort local variables according to style(9).

* Reduce unnecessary nesting.

* Reindent.

* Fix typo in manual page.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55277
08208cd694815cc855835960f55231342eb35934 Dag-Erling Smørgrav 2026-02-13 20:18:35
m4: Fix eval output width
According to POSIX, the optional third argument is the minimum number
of digits to print regardless of sign.  We interpreted it as the minimum
width of the output including the sign.  Additionally, the variable used
to hold this value was confusingly named “maxdigits”.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293214
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55311
507c611aeac7ca9aed12353b1044bb21ab00afae Dag-Erling Smørgrav 2026-02-17 14:01:34
csh: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55206
10a8680b4e9a728a20825d1c8425487bc1a43700 Tuukka Pasanen 2026-02-09 08:00:56
date: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55207
62269b2f23859a20bc6a68ca64648217c421c616 Tuukka Pasanen 2026-02-09 08:03:08
ed: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55208
9eeab27c56db507f88c3334172e62357c092707e Tuukka Pasanen 2026-02-09 08:05:17
getfacl: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55209
6e8bb77b4c23837d95ba9fb50b41b948c21cbdc3 Tuukka Pasanen 2026-02-09 08:06:07
kenv: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55210
5705d171dacc69bcdbfc17849a9dc898249dae2e Tuukka Pasanen 2026-02-09 08:07:32
pwait: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55211
0a1fd13e73200756b61d06c949622b4f6bba7dad Tuukka Pasanen 2026-02-09 08:09:10
setfacl: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55212
575e89cb1786a00387e9c1391055263068c4e0ae Tuukka Pasanen 2026-02-09 08:09:45
sh: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55213
632c73b4bfd48b89b7c2318079fd50835b8b5016 Tuukka Pasanen 2026-02-09 08:10:25
sleep: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55215
f4eccc3add7b91532396970913792fa264fc5430 Tuukka Pasanen 2026-02-09 08:11:04
sync: Add SPDX-License-Identifier tags
Reviewed by: immp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55216
0486b5243f094160fd782c1dc15f28392072b259 Tuukka Pasanen 2026-02-09 08:38:13
stty: Add SPDX-License-Identifier tags
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55217
743a7f954c2720fa318e9e1f7ca1c549977560f9 Tuukka Pasanen 2026-02-09 08:11:41
diff: Drop unnecessary casts, fix none algo
MFC after:    1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55349
d5404462f691230423dc8cc543c6fdc44f34ec31 Dag-Erling Smørgrav 2026-02-18 18:28:21
beep: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
7e313584ab1075195ab735c1452375cf2388b162 Tuukka Pasanen 2026-02-09 08:23:16
mkimg: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
971696b22f7acc8c45600bb56b972340e9b912e8 Tuukka Pasanen 2026-02-09 08:32:54
diff: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
878cee8d9b9b4c7c5530b0960306c04b1b691325 Tuukka Pasanen 2026-02-09 08:26:19
etdump: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
2d1c5f43a2a5a4d3021530c7048e72f39b2ab8d0 Tuukka Pasanen 2026-02-09 08:27:55
resizewin: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
c33076859fa319396beb10470ad4101f1c3c5571 Tuukka Pasanen 2026-02-16 08:55:27
vtfontcvt: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
f12a0dca86b529069a940f09aba796dd4e28c66f Tuukka Pasanen 2026-02-16 09:01:58
lesspipe: Allow zstd to operate on a symlink
By default zstd refuses to operate on symlinks, so for example
`zless /var/crash/vmcore.last.zst` failed to view the uncompressed core
file.  Add -f to the zstd command line to allow operation on symlinks.

Reviewed by:    delphij
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55101
b4305c90a3be7e1a40b76545b8b761fdbda5c309 Ed Maste 2026-02-04 16:56:37
procstat: CID 1593951: Resource leak
Summary: A trivial resource leak fix; free the allocated memory before return.

Test Plan: Code inspection, run command.

I built a simple program that waits for a signal on a kqueue, then ran
that. The standard procstat displays:

```
fbsd-dev% Waiting for SIGTERM...
procstat -a kqueue
    PID       KQFD   FILTER      IDENT      FLAGS     FFLAGS       DATA      UDATA     STATUS
  84352          3   SIGNAL         15          C          -          0        0x0          -
```

The revised procstat displays:
```
fbsd-dev% sudo LD_LIBRARY_PATH=/usr/obj/usr/home/dab/git/freebsd/src/arm64.aarch64/lib/libutil /usr/obj/usr/home/dab/git/freebsd/src/arm64.aarch64/usr.bin/procstat/procstat -a kqueue
    PID       KQFD   FILTER      IDENT      FLAGS     FFLAGS       DATA      UDATA     STATUS
  84352          3   SIGNAL         15          C          -          0        0x0          -
fbsd-dev%
```

As expected, the two displays are identical. This doesn't prove that
the leak is gone, but it does prove that the revised command still
operates correctly. I think it can clearly be seen from inspection of
the change that the leak has been remedied.

Reviewed-bys: vangyzen
Differential Revision: https://reviews.freebsd.org/D55422
42ab99095b7dc2243629574e1c627cf5e6a9070c David Bright 2026-02-21 22:47:00
diff3: Code cleanup
* Order includes.

* Turn the diff type into an enum.

* Turn an unreachable error message into an assertion.

* Remove unused debugging code.

* Remove some dead assignments.

* Consistently use 1 instead of EXIT_FAILURE.

* Turn a return from main() into an exit().

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D55517
c2dee7786bf32cb66cedec226e42e79e06457c51 Dag-Erling Smørgrav 2026-02-28 18:15:23
ed: add unicode support for the l (list) command
Use mbrtowc()/iswprint()/wcwidth() in put_tty_line() so that
the l command displays valid multibyte characters as-is instead
of escaping each byte as octal.

Column wrapping now correctly accounts for character display
width (including double-width CJK characters).

Invalid or incomplete UTF-8 sequences and non-printable
characters are still escaped as octal.

Differential Revision:  https://reviews.freebsd.org/D55365
5df6aca10906f669bc7095ff735eba6b8fe95ff0 Baptiste Daroussin 2026-02-17 15:25:46
diff3: bump version to the date when the GNU diff3 compat was reached
5ddfd1db271cc675997a942da599c342ccb53afa Baptiste Daroussin 2026-03-01 11:37:24
Commit group #3: paste(1)
paste(1): Utilise STAILQ from <sys/queue.h> in lieu of the home-rolled linked-list

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1443
4ba5c9d015f02eb1fda30de26c23690dd41731fc Faraz Vahedi 2024-10-08 09:41:42

paste(1): Make small modifications to improve readability

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1443
2e01fc43f23f0e960dc08984ffaff2d1e6ad5cea Faraz Vahedi 2024-10-08 18:09:39

paste(1): Capsicumise

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1443
452ee04d62e22fe923a0b616076715dad0166c98 Faraz Vahedi 2025-08-06 13:31:06
from(1): Replace magic exit codes with standard macros
Signed-off-by: Faraz Vahedi <kfv@kfv.io>

With minor changes from committer.

Reviewed by: imp, oshogbo, markj (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1491
dde5113f470af34bf917ca2690d89c94dc8d6db0 Faraz Vahedi 2024-10-26 15:28:07
from(1): Capsicumise
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp, oshogbo, markj (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1491
4a4c88533712f98a6b8fa04acb319f26aecccc3c Faraz Vahedi 2024-11-01 11:03:56
diff3: Produce correct exit status
Use exit status 2 for errors, 1 only to indicate that differences were
found between the inputs (in some operating modes).

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    ngie, bapt
Differential Revision:  https://reviews.freebsd.org/D55608
fe5341287c6c9bacc18879b25ed72ceb42e1c811 Dag-Erling Smørgrav 2026-03-02 08:52:06
lesspipe: Use zstdcat
zstdcat is equivalent to zstd -dcf, and matches our intention.

Suggested by:   delphij (in D55101)
Sponsored by:   The FreeBSD Foundation
34d7f100c1d9e6f21d2f79097e891f7a17749d1b Ed Maste 2026-02-23 18:59:55
diff3: Add SPDX-License-Identifier tag
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55462
5778700fb8c54a33e5bb00a4a0c4e40fde2edbd9 Tuukka Pasanen 2026-02-12 09:27:34
/bin/ps: Fix display of negative nice values on ARMv7/aarch64
On Arm-based systems (and maybe others), 'char' defaults to unsigned,
causing negative nice values to be displayed incorrectly (e.g., 246
instead of -10). Explicitly using 'signed char' ensures consistent
behaviour across architectures.

[ tested on RPI2 and generic aarch64 qemu install ]

Before:
  # /usr/bin/nice --10 ps -l | awk '(NR == 1 || $(NF-1) == "ps")'
  UID   PID  PPID C PRI  NI  VSZ  RSS MWCHAN  STAT TT     TIME COMMAND
    0 23606 22800 2 -32 246 5400 2544 -       R<+   0  0:00.06 ps -l

After:
  # /usr/bin/nice --10 ps -l | awk '(NR == 1 || $(NF-1) == "ps")'
  UID   PID  PPID C PRI  NI  VSZ  RSS MWCHAN  STAT TT     TIME COMMAND
    0 23614 22800 3 -32 -10 5400 2544 -       R<+   0  0:00.05 ps -l

Signed-off-by: Jamie Landeg-Jones <jamie@catflap.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2064
9006a731bc951c5b62efc4bf75a0c5b42586d279 Jamie Landeg-Jones 2026-03-07 01:18:20
uuidgen: generate UUIDs in bounded batches to respect kernel limit
The uuidgen(2) system call enforces a hard upper limit of 2048 UUIDs per
invocation. uuidgen(1) previously attempted to generate arbitrary counts
in a single call and allocated memory accordingly, leading to EINVAL
errors, unnecessary memory usage, and potential overflow risks.

Generate UUIDs in fixed-size batches, streaming output incrementally
while preserving existing semantics. Mirror the kernel limit explicitly
since it is not exposed via a public interface.

Signed-off-by: NVSRahul <nvsrahul@hotmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1965
3570b19d74ed94dcc7fac2dcbf42b378bc72362e NVSRahul 2026-01-13 05:52:06
Commit group #4: yes: Completely overengineer
yes: Completely overengineer

If we're going to overengineer this, we may as well go all the way.

* If multiple arguments are given, concatenate them into a space-
  separated list like GNU coreutils does.

* When duplicating the expletive, do so exponentially.

* Most importantly, don't modify the memory that argv points to.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D55617
cf74b63d61b49db848ecc20b87e7ee5f16671320 Dag-Erling Smørgrav 2026-03-10 10:18:08

yes: Add missing header

This is a no-op on FreeBSD due to namespace pollution.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Fixes:          https://cgit.freebsd.org/src/commit/?id=cf74b63d61b4 ("yes: Completely overengineer")
ba7439f0a9604b15bfef8084816f34d55eb6bdf2 Dag-Erling Smørgrav 2026-03-10 17:40:23
Calendars: Update status reports deadlines
Also move the deadlines in their own calendar file.

Reported by:    jhs
Reviewed by:    jhs, adamw,
                Graham Percival <gperciva@tarsnap.com>
Differential Revision:  https://reviews.freebsd.org/D55491
738aea3387d831c95024fd28076dadde132ceaec Lorenzo Salvadore 2026-02-24 14:41:20
systat: remove kvm(3) support for -netstat mode
The kvm(3) mode was actually non-functional since FreeBSD 8 for kernels
with VIMAGE, since FreeBSD 12 for the GENERIC kernel and since FreeBSD 14
for all kernels.  The reason for that is that systat(1) tried to lookup
symbol "tcb" to check if kvm(3) is working.  The symbol no longer exist in
the kernel.

A side effect was that systat(1) lost true kvm(3) support for all other
modes, e.g. -swap or -pigs.  The tool was still working, but libkvm was
just a shim to sysctl(3) API.

So, contrary to what the header line says, this change actually restores
the kvm(3) support for other modes.  Now we read the "allproc" symbol.

This was the last tool that abused _WANT_INPCB.
985ac741384ec65463669edee5e1d90dee4c895a Gleb Smirnoff 2026-03-12 04:16:44
llvm: Link cross-tools with static libllvm.a
We generally use TOOLS_PREFIX being set to indicate that we are building
in the cross-build tools stage.  This check was missing for llvm.prog.mk
consumers other than *tblgen, which have not previously been built as
cross tools.

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55930
d478715a72892537d37a70efcb82ee572ac5741a Ed Maste 2026-03-19 02:01:13
m4: Stop abbreviating builtin names
* Stop abbreviating macro names half-randomly to 8 chars, this is no
  longer 1990.

* Likewise for function names (in particular use doindex for a function
  that is notably different from the classic index function).

* Rename a few things for more fidelity: eval is the builtin name, not
  expr and your maketemp/mkstemp conform to mkstemp semantics for better
  security.

* Rewrap a few comments that were ludicrously short.

No functional changes except improved accuracy of some error messages.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55793
f8f6f1cbd576ab5f15cef178cc05251365652f74 Marc Espie 2026-03-25 00:41:18
diff3: prefer posix_spawn over pdfork/execlp
MFC After:            1 week
Reviewed by:            kib
Differential Revision:  https://reviews.freebsd.org/D56075
5f7f0efe8e13247fc80a2a739e757f73a5d7ebda Baptiste Daroussin 2026-03-25 10:08:58
diff: prefer posix_spawn over pdfork/execl
MFC After:            1 week
Reviewed by:            kib
Differential Revision:  https://reviews.freebsd.org/D56076
6d8b2ac449f34423be9d56492022421db61d920e Baptiste Daroussin 2026-03-25 10:22:02
diff3: plug fd leak
MFC After:    1 week
Reported by:    kib
33424fd50ee0333bc6f70b5b14a270b85e5b5de1 Baptiste Daroussin 2026-03-26 07:40:29
diff: handle read(2) failures
MFC After:    1 week
9b98c4b053917cad42e26596b37df72efab6dc39 Baptiste Daroussin 2026-03-26 09:25:21
diff3: set O_CLOEXEC on pipes
This avoid leaking pipe fd in children and simplifies the code

MFC After:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56120
945e60e018c287f8097f3ee4a30ccf4921845aa1 Baptiste Daroussin 2026-03-28 08:41:47
diff: use O_CLOEXEC on pipes
This only simplifies the code, no functional changes expected

MFC After:      1 week
c8d40bf8ecc60cc15e3904410db62065ea681fdc Baptiste Daroussin 2026-03-28 08:55:24

Documentation

Man pages, release notes, etc.

jdec_dimm(4): add a reference to smbmsg(8) to jedec_dimm(4) and smbus(4)
Add a cross reference to smbmsg(8) which is useful for discovering local
devices and difficult to find otherwise.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247749
Reviewed by: pauamma@gundo.com
Differential Review: https://reviews.freebsd.org/D40839
b52347f5b93822ee970b6cf4b5d893d60c3ceee8 Johannes Totz 2026-01-02 15:03:24
makefs.8: Cleanup man page
Reviewed by:  ziaee
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54538
12c51484188f88bcabc5b38ca8523fcde76830a6 Jose Luis Duran 2026-01-06 00:59:27
UPDATING: move entry to the correct place
Reviewed by:  vexeduxr
Signed-off-by:  ykla yklaxds@gmail.com
Sponsored by:   Chinese FreeBSD Community
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1917
171f9cbbbfa1f29c854716dc5a1904d9c8d8ea78 ykla 2026-01-05 04:40:56
nuageinit/man: clarify how to enable sudo and doas
Clarify that both `sudo` and `doas` are not part of the base system and
they need to be listed in the `packages` section if the user wants to
enable them.

MFC After:      1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1944
402f1353707783e2adc8d0bff01faf557820f6f5 Gonéri Le Bouder 2026-01-03 23:10:18
nuageinit(7): pert mandoc linter
MFC After:    1 week
9ea30bbb0e3c34b3ea369e217d930e2165610c0c Baptiste Daroussin 2026-01-06 08:24:50
cxgbe.4: Update for recent HARDWARE
Adjust document description, description section, and hardware section
to include Chelsio T7. Since this driver now supports many generations,
order reverse chronologically. Compare language to ice.4 and bnxt.4,
the other terabit ethernet drivers.

This list of HARDWARE is obtained from the Chelsio prouduct selector.

MFC after:              3 days (T7 support shipped with 15.0)
Discussed with:         jhb, np
Differential Revision:  https://reviews.freebsd.org/D54276
03e1605cdf17c48d5e0d6d42a9f15b78b3b7adb0 Alexander Ziaee 2026-01-06 14:52:42
manuals: Correct some sysctl markup
This enables additional searching the manual by sysctl variable.
This syntax is standardized in style.mdoc(5).

Reported by:    bapt
MFC after:      3 days
75866d71e8d93fe1a1ff469b8a9c6c6c9908a6c8 Alexander Ziaee 2026-01-06 16:02:24
sh.1: Restore missing builtin commands
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292221
Fixes:          https://cgit.freebsd.org/src/commit/?id=2980318b2747 (sh.1: extend the section about getopts)
MFC after:      3 days
2962dc76877538508944a441fd1570322e969380 Alexander Ziaee 2026-01-06 17:25:26
mrsas.4: Add Fujitsu RAID Controller SAS 6Gbit/s 1GB (D3116)
This is an OEM card from Fujitsu using an LSI SAS2208 ROC controller shipped
with many Fujitsu PRIMERGY servers like RX300 S7.

Controller description: https://www.fujitsu.com/global/products/computing/servers/primergy/blades/connection/cb-pmod-110426.html

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54566
ccec94bf63de8ee067b03b981a283d9f968c3667 Michael Osipov 2026-01-06 20:31:24
iflib: document new sysctls
Document the new tx related sysctls I've added to iflib in the
last few months:  tx_reclaim_ticks & tx_reclaim_thresh

Sponsored by: Netflix
Reviewed by: ziaee
Differential Revision: https://reviews.freebsd.org/D54564
MFC after: 3 days
83e6f0d7807b4ebc74bc58e6f03adde56db942bf Andrew Gallatin 2026-01-06 22:43:24
pkgbase.7: Show pkg upgrade to apply updates
MFC after:    3 days
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/freebsd-src/pull/1945
d1f93ea2e1646f1a844f37a855a70de1b186dbd7 Graham Perrin 2026-01-09 04:45:29
freebsd-base.7: Fix stray -r
Remote stray "-r" from the example of installing a toolchain
to alternate root.

Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D54611
a556feb99765a8eae96b2077067dd482c9dd3f57 Juraj Lutter 2026-01-09 09:41:21
getopt(3): be more explicit about :: extension
Make it possible to search for literal two colons (::) and actually
find something.  Make the "x"/"x:"/"x::" examples more explicit and
more visibile.

Signed-off-by: Simon Wollwage <rootnode+freebsd@wollwage.com>
Obtained from:  NetBSD, nbuwe <uwe@stderr.spb.ru>, 856d5b6
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291374
Reviewed by: imp, jlduran
Pull Request: https://github.com/freebsd/freebsd-src/pull/1923
4b2a8aab43ff747bcba6c28f5c0431141ec198a0 Simon Wollwage 2025-12-12 05:11:40
loader.efi(8): clarify UEFI boot path and boot1.efi usage
Reorganise and clarify the legacy role of boot1.efi in DESCRIPTION to
improve clarity.

Add a minor missing word in the BUGS section ["...caution is required*..."].

See also - PR: 290794

Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1939
7b3fb3caef9495cdfcc1c8ec39907defb65ce860 kitkat1424 2025-12-31 19:41:08
RELNOTES: Add some entries from the past several weeks
Reviewed by:  emaste
Differential Revision:  https://reviews.freebsd.org/D54628
e3bfcf6b594e8388c4a2e1835519a8026e90cf71 Mark Johnston 2026-01-09 17:58:00
symlink.7: add a new section "mount options"
Add a new section "mount options" to explain
the mount option nosymfollow in more details.

Differential Revision:  https://reviews.freebsd.org/D54530
a2c87d4f88e1bfe3b7007fa7148ebc7d37fc54cc Wolfram Schneider 2026-01-19 10:47:53
usbhidctl.1: adjust option list indent
For improved legibility.
c0898bdc8661842c51fecfe467a1c921a2d81774 Mitchell Horne 2026-01-19 18:18:01
mac(4): also list jails in the example enumeration of objects
The prison may also be considered part of the subject by way of its
ucred association, but I don't think this is significantly different
enough today than before recent work -- policies could have always
taken them into account, and some did (e.g., mac_bsdextended).

Reported by:    olce
Reviewed by:    olce, ziaee
Differential Revision:  https://reviews.freebsd.org/D54748
bef0475b6810b9cc725bb786a8100a6e54b54891 Kyle Evans 2026-01-20 02:57:42
cron.8: clarify system crontab format
53d6b23765ca27ac7eca4096b2a83e84631c4ec8 Xin LI 2026-01-21 06:28:39
simd.7: Add Arm MOPS memcpy(), memmove() and memset() to manpage
Fixes:                        https://cgit.freebsd.org/src/commit/?id=41ccf82b29f3 (Use MOPS implementations)
Reviewed by:            ziaee
Sponsored by:           Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54812
98cb4874e2bb9a56e1bd883ede72108eb1c39e6e Sarah Walker 2026-01-21 16:47:19
socket.2: Cross-reference protocol families
While here, make wider use of Dv for socket types and protocol families
and reference fcntl(2) flags for the `type` argument values.

MFC after:              3 days
Reviewed by:            glebius, ziaee
Differential Revision:  https://reviews.freebsd.org/D54434
2c6bee2b23db9ec231a6fa2979093eeae10aaf91 Artem Bunichev 2026-01-21 17:25:29
capsicum.4: Replace 'fi' ligature and smart quotation mark
While here, wrap the line to 80 characters.

Reviewed by:    jlduran
Fixes:          https://cgit.freebsd.org/src/commit/?id=c54534e60263 ("capsicum.4: Add some more detail from the Capsicum paper")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54761
e6bafbeb1ee7a61ddfe92ba052c476c7646c405b Artem Bunichev 2026-01-23 16:17:46
mkimg(1): Sync mkimg(1) and usage() with the implementation
Reviewed by:  imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54419
3aa8d5395c4223f1613f28d6f39904c2df4f92d4 Li-Wen Hsu 2026-01-23 20:55:32
vt.4: Document that hw.vga.textmode does not apply for UEFI(8) boot
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292598
Approved by:    ziaee, imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54842
28764001b504c3588fd9f8dd6e4c08144d20571c Michael Osipov 2026-01-23 20:03:20
rights.4: document CAP_PDWAIT
Noted by:     markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
ec8e8fa6014addf90f00a9b945570ff0cd18d768 Konstantin Belousov 2026-01-21 14:16:55
kqueue.2: Fix reference to unexisting kevent1()
kqueue1() was meant.

While here, make the wording in the AUTHORS section more clear.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291908
Fixes:          https://cgit.freebsd.org/src/commit/?id=9b1585384d53 ("kqueue.2: Editorial pass")
Reviewed by:    kib, dab
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54858
4efe75af0869dd71a26685c432e5284d71bf4dc8 Artem Bunichev 2026-01-25 15:39:48
posix_spawnattr_getexecfd_np.3: add closing .Fc
Fixes:        https://cgit.freebsd.org/src/commit/?id=9bf69c37f43e96292e97e41bf942d7aca4101362
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
2a5b083c1f7e0a4518bd944241af1d1102997c4d Konstantin Belousov 2026-01-26 20:07:31
divert: Update divert.4 to mention pf
pf's divert-to action can be used to pass packets to a divert socket,
but divert.4 didn't mention this, only referencing ipfw.  Try to make
the text a bit more general.

Reviewed by:    igoro, kp, glebius
MFC after:      2 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54848
120c0bb833977707fc56f59b0961994fbd6c52e7 Mark Johnston 2026-01-27 13:48:22
RELNOTES: Document a pf enhancement
0dba3626a13d9c90722c88accfdd84915aeceda7 Mark Johnston 2026-01-27 14:05:42
sh.1: Provide detailed job control documentation
Adopt the POSIX standard text to our implementation.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206284
Reviewed by:            des, jilles, ziaee
Differential Revision:  https://reviews.freebsd.org/D49895
2711852bd9ac3ab78d2b128d3549ff437d2a09af Artem Bunichev 2026-01-29 17:08:11
tuning.7: document schedulers knobs
Reviewed by:  emaste, olce, ziaee
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54951
0730a05cd383276ca8eedf295509e869ac9b88a0 Konstantin Belousov 2026-01-29 21:40:29
intro.9: deduplicate vm_page Xrs
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292820
Submitted by:   Kraytonian
MFC after:      1 week
7f537f4ba8a5e19a39d005a81fa6f34a8d2cb60d Maxim Konovalov 2026-01-30 04:48:56
intro.9: grammar
c443f5d1c20868f09076305c3eefcd1ca1917b87 Maxim Konovalov 2026-01-30 04:51:24
INDEX.fonts: Minor maintenance
+ Mention relevance of this file in the vt manual screen.font entry
+ The vidfont manual is in section one, not eight
+ Remove leftover blank line from freebsd tag removal

MFC after:      3 days
1f5795b6422a1c6e4b71fd7e93717522ccb822f9 Alexander Ziaee 2026-02-01 00:24:22
vt.4: Sprinkle mdoc macros
Now that we have angle bracket characters for all common display sizes,
sprinkle in the correct macros for the structures in this page. While
here, fix a mdoc typo, a linter warning, and switch a parenthetical to
a much smoother appositive.

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=7cd6da268a8f (vt.4: Style pass)
a97ed3a39c1044dd1b8056d68a76de74821f2bff Alexander Ziaee 2026-02-01 00:16:34
bcmp(3): update manpage to following the Posix Standard
Reviewed by: glebius
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D52980
6d37c3db62ba32a1e95f390e8570722bfa8ff8a5 Pouria Mousavizadeh Tehrani 2026-02-02 06:51:38
socket.2: Cross-reference netintro(4)
netintro(4) is a great manual page that provides a basic introduction to
network facilities, I think it is well worth mentioning in the
socket(2).

I also think we can incorporate this reference somewhere in the text as
well, but I'm not sure, maybe the reference in the SEE ALSO section
would be enough.

Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55032
d0474eda504c8e1dd784c1cde4b65a42adc4e28e Artem Bunichev 2026-02-02 15:11:05
RELNOTES: Add entry for 7f54c65abc67
69f535564125f6c59b02616c806ab7fcf9563878 John Hall 2026-02-02 20:35:19
EVENTHANDLER.9: EVENTHANDLER_REGISTER never fails
Since ecdf4409f910 ("Rework the eventhandler locking [...]"),
EVENTHANDLER_REGISTER() can never return NULL.

Suggested by:   olce
Reviewed by:    olce, ziaee, zlei
Approved by:    olce, zlei
Fixes:  https://cgit.freebsd.org/src/commit/?id=ecdf4409f910 ("Rework the eventhandler locking [...]")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55014
9d4bad45e233ca7d93666ff1feff6282a88f8a9d Aymeric Wibo 2026-01-31 15:54:11
sh.1: Fix rendering error due to redundant .El
Due to this all the rest of the items in the Built-in Commands section
were not rendered at all.

Fixes: https://cgit.freebsd.org/src/commit/?id=2711852bd9ac ("sh.1: Provide detailed job control documentation")
MFC after:              3 days
Reviewed by:            emaste, ziaee
Differential Revision:  https://reviews.freebsd.org/D55080
9555d80066c919596e152f923d38d58a740cdb5f Artem Bunichev 2026-02-03 16:14:09
geom.8: Improve classes list into a table
Add missing entries MD, VFS, and DISK. Refactor list into a three
column table, so the data is all visible at once, buying us ten lines
at MANWIDTH 80, and still rendering nicely at MANWIDTH 59.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292530
MFC after:      3 days
Reported by:    Slawomir Wojciech Wojtczak <vermaden@interia.pl>
dc2ec1ccc17a0c43c736b16a537c01bb28d814a4 Alexander Ziaee 2026-02-05 15:31:29
wpa_supplicant.conf.5: Remove removed variables
2005-09-25 - wpa_supplicant v0.4.5 removed "server_nai"
2008-02-22 - wpa_supplicant v0.6.3 removed "eappsk" and "nai"

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284126
MFC after:              3 days
Reviewed by:            carlavilla, ziaee
Reported by:            J.R. Oldroyd <fbsd@opal.com>
Differential Revision:  https://reviews.freebsd.org/D49010
c5ee920c3f35c5f0f485a7a274d87ebd91469892 Felix Johnson 2026-02-05 15:46:49
git-arc.1: Refer to new port name
The git-arc script was moved from devel/freebsd-git-devtools to
devel/freebsd-git-arc.

Reviewed by:    ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55127
32bd754d4dcd9752b552ff70d68d3c1e1c335d92 Joseph Mingrone 2026-02-05 17:16:05
development.7: Refer to new port name for git-arc
The git-arc script was moved from devel/freebsd-git-devtools to
devel/freebsd-git-arc.

Reviewed by:    ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55128
deb3c9dc54c72efcb19fd4c55449ba08f07cba2d Joseph Mingrone 2026-02-05 17:16:30
accf_*.9: Rewrite broken synopsis
These manuals abused the name macro for every line of kernel cfg as well
as an example command to show the module name which was mixed in without
separation. This bugs the whatis database into thinking that `INET` and
`kldload` are names for this page, and violates best practice by mixing
commands and configuration in a continuous example.

Rewrite to use the kernel configuration macro, Cd, and show the module
name via an example configuration in rc.conf, according to the spec and
established practice. Do not bump the date because these markup errors
are not a content change.

MFC after:      3 days
c59f12da11d75502b16f9163edc76514007462db Alexander Ziaee 2026-02-07 21:54:59
RELNOTES: Add some entries for recent commits
Reviewed by:  olce, jhb
Differential Revision:  https://reviews.freebsd.org/D55150
997bfa20d2716e4bae94ab7089ec970b8d884376 Mark Johnston 2026-02-09 18:35:33
ifconfig.8: Start new sentence on new line
This change was forgotten by me in the previous commit to this file.

Reported by:    kib
Approved by:    implicit (change omitted from previous commit)
Fixes:          https://cgit.freebsd.org/src/commit/?id=31ec8b6407fdd5a87d70265762457c67ce618283
e912723afb4e6bcfa828fcb73f35cd82fc6bca68 Guido Falsi 2026-02-09 20:04:01
git-arc.1: Fix patch options
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55228
69c64e3fb575e0db0e2f0c1fc56f466624940ded Joseph Mingrone 2026-02-10 18:31:04
pw: make manual page more friendly for uid/gid search
pw.8 structure is quite different from usual manual page, especially in
describing -o option usage.  Specifically, these paragraphs do not
contain "uid/gid" terms, and have "user id"/"group id" instead,
making searching for "override duplicate safety belt" difficult.
Try to simplify such searches.

Also, clarify uid/gid space between 100 and 1000 as "somewhat special",
as it actually is.

Discussed on:   russian telegram FreeBSD group
Reviewed by:    eugen, novel
MFC after:      1 week
e89454417b2bfecce9daee10dece2f49632640d3 Dmitry Morozovsky 2026-02-11 19:34:00
pw.8: spell
66797b469ee3e303c5e228bea1e244f433e666e1 Maxim Konovalov 2026-02-11 21:03:11
sbin/setkey/setkey.8: cleanup groff mdoc warnings
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293072
Sponsored by:   NVidia networking
MFC after:      3 days
c67d8acca30e9f96f0a56f197003d0a4c663a060 Konstantin Belousov 2026-02-12 07:43:46
lib/libc/net/sockatmark.3: fix groff mdoc warning
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293072
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
10fde719587c22085c95759a242e9c51d249d024 Konstantin Belousov 2026-02-12 07:56:42
newsyslog.conf.5: Add a CAVEAT
PR:                   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282639
MFC after:              3 days
Reviewed by:            michaelo
Differential Revision:  https://reviews.freebsd.org/D55122
64e612b46290617ec753b4ee6ec633a3724940e3 Alexander Ziaee 2026-02-12 14:14:47
Summary: *.3: misc man page fixes
Approved by:  markj (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55249
8efcc64928f96bb26a58ec04750688110502227f Robert Clausecker 2025-12-01 15:19:33
src.conf.5: regenerate after switch to BSD diff3
06d07d4af1c9f9ea322b9363d1c8e70e250a7907 Baptiste Daroussin 2026-02-13 17:44:26
multicast.4: Fix disabling multicast forwarding
Reviewed by: markj, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55266
f2c2e5b0bf9def01b10651b9802fa38d07d9d265 Pouria Mousavizadeh Tehrani 2026-02-12 23:06:15
Commit group #5: open.2: stop making impression that fd must be directory
open.2: stop making impression that fd must be directory

Reviewed by:    des, rmacklem
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55302
5bcccc702b29a0e173a5916b001771dd7b280c7c Konstantin Belousov 2026-02-16 07:28:22

open.2: grammar improvements

Submitted by:   matteo
Fixes:  https://cgit.freebsd.org/src/commit/?id=5bcccc702b29a0e173a5916b001771dd7b280c7c
MFC after:      3 days
f1f142c01db43c7dc8d0d172fc1726da2ee01972 Konstantin Belousov 2026-02-16 15:34:35
sh.1: Document the exit status of return
It's not obvious that if `exitstatus` is omitted,
the exit status of the function is taken from the last executed command.

MFC after:              3 days
Reviewed by:            jilles, ziaee
Differential Revision:  https://reviews.freebsd.org/D55026
931d4f0ae4f2dcd088bb92459ff19c8b6aafc2cc Artem Bunichev 2026-02-16 17:14:00
sh.1: Fix ordering of Cm and Aq macros
MFC after:    3 days
Reviewed by:    ziaee
Fixes:  https://cgit.freebsd.org/src/commit/?id=2711852bd9ac (sh.1: Provide detailed job control documentation)
Differential Revision:  https://reviews.freebsd.org/D55194
e5213ca4a3ca742fd8d3b8db413a561b28fa6989 Artem Bunichev 2026-02-16 17:21:21
pdfork.2: add EFAULT as possible error, explain some consequences of it
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
db80ea9b88628168d2bb7f17a60b73568a8ea102 Konstantin Belousov 2026-02-16 10:18:07
trimdomain.3: Explain DISPLAY a bit more
MFC after:            3 days
Reported by:            jrtc27
Reviewed by:            des
Differential Revision:  https://reviews.freebsd.org/D54629
960719762f0a1f6689ec58bc6d8ce21c4daa9096 Alexander Ziaee 2026-02-17 17:22:26
mitigations.7: Describe LASS
Reviewed by:  kib, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55281
b20883e8210eb30c8ffba467c4bc9fce89bde6c4 Ed Maste 2026-02-13 20:31:51
devd.conf.5: Fix cross-references to devfs(4)
Fixes:                https://cgit.freebsd.org/src/commit/?id=1687d77197c0 (man filesystems: move driver pages)
MFC after:      3 days
Reviewed by:    ziaee
Sponsored by:   Defenso
Signed-off-by:  Quentin Thébault <quentin.thebault@defenso.fr>
Closes:         https://github.com/freebsd/freebsd-src/pull/2015
59b7f3ed69df1031e11cdaa3a571248487af91ba Quentin Thébault 2026-02-11 07:39:17
sh.1: Reference editline(7)
Key bindings for command line editing are documented in editline(7).

MFC after:              3 days
Reviewed by:            jilles, ziaee
Differential Revision:  https://reviews.freebsd.org/D54767
009be09172348c352db5d74f6ece2f4cb47ee193 Artem Bunichev 2026-02-18 18:16:38
mitigations.7: spell
1e36ee76757662bf6a672ebd7ad77a6dc674853b Maxim Konovalov 2026-02-18 18:50:14
Commit group #6: vmm.4: Add information on VM access control
vmm.4: Add information on VM access control

Add a section to vmm.4 explaining how vmm device file ownership works.

MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54742
d26c8ae527bbf2cc3da98c0857f634f162622752 Mark Johnston 2026-02-19 14:38:59

vmm.4: Fix width

Reported by:    ziaee
Fixes:          https://cgit.freebsd.org/src/commit/?id=d26c8ae527bb ("vmm.4: Add information on VM access control")
3a0c63a7e0e7f8bd43b0d6b97a627198297e3bdb Mark Johnston 2026-02-19 17:20:17
RELNOTES: Document some recent vmm changes
83cf9b52e96086f598ed21f0f7830b74f4f4476a Mark Johnston 2026-02-19 17:16:59
lpr: Add deprecation notice
These programs require elevated privileges to work and have not seen
regular maintenance in decades.  Unless someone steps up and overhauls
them, we will have to remove them before 16.0.  Better-maintained
alternatives are available in ports (print/cups, sysutils/LPRng).

MFC after:      3 days
d57dee7ab66f60537b557cb602be194e3eed253d Dag-Erling Smørgrav 2026-02-19 17:55:06
stdckdint.3: Fix standard in comment
Sponsored by: Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55360
637a8ec157935c76839185d9068e6f4bc42047bc Aymeric Wibo 2026-02-21 23:20:18
ufs_disk_close.3: Correct include header macro
This manual used the library macro to mark up a header file, causing
pollution in the apropos database for libraries, as well as omission
from the apropos database for headers. This also renders differently,
enclosing the header in angle brackets.

MFC after:      3 days
456ae9820823fcd078746318620925792f112c9a Alexander Ziaee 2026-02-21 21:24:20
ports.7: Add port files to FILES
Add terse descriptions for the individual files that make up a port to
the FILES section of the ports reference manual.

MFC after:              3 days
Reviewed by:            adamw
Differential Revision:  https://reviews.freebsd.org/D55404
451f593194cbea74bcae53b4b8e6e55f6b2ec12d Alexander Ziaee 2026-02-22 02:51:13
sh.1: Add .sh_history and .shrc to FILES
MFC after:            3 days
Reviewed by:            bapt (previous), jilles, tembun@bk.ru
Differential Revision:  https://reviews.freebsd.org/D55295
9a20515bc9ce3fe6d7f09fd6bdece0dd45bdbc87 Alexander Ziaee 2026-02-23 08:16:33
ngctl.8: fix incorrect synopsis
Tiny manpage bug I caused in D50241
I left a line in the manpage that shouldn't be there.

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=72d01e62b082 ("netgraph: teach ngctl to attach and run itself in a jail")
Reviewed by:    des, markj
Differential Revision:  https://reviews.freebsd.org/D55485
9ed56cd8d6929e3ee733e1e61d2e0c6b81122983 David Marker 2026-02-24 14:27:52
efibootmgr.8: capitalize examples section header
MFC after:    3 days
fac9ae3db4e6a28dfd467369e262f636e10a3b01 Ahmad Khalifa 2026-02-24 20:11:26
system(3): Clarify return values
Our manual page currently states that system() will return 127 if it
fails to execute the shell.  The actual return value is, to quote POSIX,
“as if the command language interpreter had terminated using exit(127)
or _exit(127)”.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55483
7305604b29d3db29c9bb5de6e7a25829fb541d1e Dag-Erling Smørgrav 2026-02-25 21:12:36
rge.4: correct media types in the manual page
Correct media types for 1000Mbit/s, 2500Mbit/s, 5000Mbit/s and 10Gbit/s.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55496
25e89051df7ace23ae4953c21402e568cfce78b4 Kevin Lo 2026-02-26 02:52:14
newgrp.1: Provide examples
"These examples appear to be originally noted thirteen years ago by
Mark Saad, contributed by eadler, put into a patch by Felix Johnson,
and made into mdoc by myself. Finally, put this bug to rest." ~ziaee

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=167742
Co-authored-by:         eadler, ziaee, Mark Saad
Differential Revision:  https://reviews.freebsd.org/D48877
86dc5dd0b2a861cf9d8cad18fc17c17dbbfc4465 Felix Johnson 2026-02-27 00:45:03
nuageinit.7: Fix a couple of minor errors
Use the correct key name in the chpasswd section.
Remove a stray line to fix the description of 'password'.

MFC after:      1 week
Sponsored by:   Chelsio Communications
Reviewed by:    maxim
Differential Revision:  https://reviews.freebsd.org/D55547
df5014f71cff2c02f46afa8823370d7f61494bdb Navdeep Parhar 2026-02-26 23:01:47
src.conf.5: Regen after commit c47cefba8312
e80c45dbf7d098677a607a29a55c07b85ea7f315 Ed Maste 2026-03-03 17:08:39
me.4: note that it is a point-to-point interface
Add explicit note that me(4) works as a point-to-point pseudo device.

MFC after:      1 week
f69eab727edbab1385e5ffc8b3f6cb5a233f62c0 Eugene Grosbein 2026-03-04 08:06:05
ichwd: Add manual for i6300esb watchdog
Reviewed by:    ziaee, mhorne
Approved by:    lwhsu (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54466
546d925cb44f1da7efee76bfebb42df8fdbc83a8 ShengYi Hung 2026-01-03 06:12:26
libsys/rename.2: remove commented-out CAVEAT section
FreeBSD UFS does not support hardlinks to directories.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
5f911eaba017645487a1eaee3609b26a77f0f174 Konstantin Belousov 2026-02-27 00:03:59
ports.7: Document DEFAULT_VERSIONS
MFC after:            3 days
Co-authored-by:         Adam Weinberger <adamw@FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D55443
74aec9f02d9d8fbde250da1ecc881729c8baf489 Alexander Ziaee 2026-03-06 23:44:50
igc.4: Describe better
MFC after:    3 days
6560ee97e8f51d5147521319dfd9d1e7afe74d34 Alexander Ziaee 2026-03-09 16:34:00
pci.4: Quote argument to -width for a list block
This fixes an mdoc warning and also properly indents this list.  While
here, update the quoted argument to be the longest tag in the list.

Also while here, correct the description of pd_numa_domain.  NUMA
domains are a property of the device, not of the driver.

Reviewed by:    ziaee, imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55770
c3ac5f14c8b330c036149d1d24cd3369d1418de2 John Baldwin 2026-03-10 16:49:10
pciconf.8: Reorganize slightly to handle additional modes
Move the description of the optional device argument earlier before
describing individual command modes.

Add a subsection for list mode and a second subsection for the other
modes that work with a single device.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55773
98a0d2283701e08353ce670c8023803c58a4994c John Baldwin 2026-03-10 16:50:52
sigreturn.2: refresh the man page
Remove mention of the longjmp(3), which does not use sigreturn.
Try to be more precise when describing the syscall effects.

Reviewed by:    emaste, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55750
9da4a804f0916b24519b8baa7ed460a7ba23d8c8 Konstantin Belousov 2026-03-08 20:08:42
DEFINE_IFUNC.9: update NOTES
ifuncs are now implemented for all architectures, so drop the caveat
statement.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55815
a2b2ce2c15bb73d9f87d5072cf65f1f027e066fb Mitchell Horne 2026-03-12 14:44:46
alloca.3: Add entry about defining VLAs in same block as alloca() to BUGS
Refer to alloca() as a (builtin) function or macro, as it could be
defined as either depending on the compiler.

Paragraph about bug comes from Darwin's libc, and example added to
illustrate it.

Reviewed by:    bnovkov
Approved by:    bnovkov
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55370
4da237aee328f368cd85b659854c4556a39f15ef Aymeric Wibo 2026-02-19 14:47:06
re(4), rge(4): improve Realtek driver man pages
Add D-Link DGE-530(T) and Killer E2600 to the re(4) HARDWARE list.
Both are supported by the driver but were missing from the man page.

Also add cross-references between re(4) and rge(4) in SEE ALSO,
as both are Realtek NIC drivers.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55745
e6f4e4ab8a51f5bec178f5d937e541e227efb561 Christos Longros 2026-03-14 21:35:20
resolver.5: document six previously undocumented options
Document the edns0, inet6, insecure1, insecure2, no-check-names,
and rotate options which are parsed by res_init(3) but were not
described in the resolver(5) man page.

MFC after:      1 week
Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D55864
462a1f6197fa3de63e0eca2835b1d5b0bc6a3bbb Christos Longros 2026-03-15 15:17:04
realpath: Improve manual page
* Try to make the RETURN VALUES section flow better.

* Add basename(3), dirname(3), free(3) to the SEE ALSO section.

* Drop the CAVEATS section, which was obsolete the moment realpath(3)
  was added to the Single Unix Specification in 1994.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55928
1aecb32021ce46d812db36b9037cdc6f423575f9 Dag-Erling Smørgrav 2026-03-19 01:26:21
dtrace.1: Reference dtrace_cam.4
Fixes:        https://cgit.freebsd.org/src/commit/?id=1a7151f79664 cam: Add probes for xpt actions
Event:  AsiaBSDCon 2026
2eb0a888917593220c27c688b026767c20fa68ab Mateusz Piotrowski 2026-03-20 04:24:36
src.conf(5): rebuild after introduction of WITHOUT_PKGSERVE
dc2687bf719a04c81746050bcc1b3c5645efb6cb Baptiste Daroussin 2026-03-20 12:32:55
acpi.4: Update sysctl descriptions for new stypes
The previous S1-S5 options are still accepted for compatibility, but
they are now deprecated in favour of the new generic sleep types.

Reported by:    markj
Reviewed by:    markj
Approved by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=97d152698f48 ("acpi: Use sleep types defined in sys/power.h")
Event:          AsiaBSDCon 2026
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56008
2547f972022197012cb3170ab4d6dcd8cd0ee257 Aymeric Wibo 2026-03-21 03:33:30
mdo.1: Cross-reference with security.7
MFC after:    3 days
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D56024
e23f0deceac4fb77c14066d4a76074548ee75fc4 Mateusz Piotrowski 2026-03-22 07:31:44
hwpmc.4: correct stale default values and update diagnostics
The default values documented for kern.hwpmc.logbuffersize (4KB) and
kern.hwpmc.nbuffers_pcpu (64) have been incorrect since 2981a3420cb1
(2018), which updated the compiled defaults but did not update the
man page.

- Correct logbuffersize default from 4KB to 256KB, add 16MB maximum
- Correct nbuffers_pcpu default from 64 to 32, document 32MB per-CPU
  product limit with kern.hwpmc.logbuffersize
- Update DIAGNOSTICS section to reflect current warning messages

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   NLINK (nlink.com.br)
Differential Revision:  https://reviews.freebsd.org/D56050
2318ea10a3afb66c51078483f74c1a622811a619 Paulo Fragoso 2026-03-23 20:17:54
rge.4: fix incorrect speed range in HARDWARE section
The HARDWARE section stated "PCIe 1GB to 1GB Ethernet devices"
which is incorrect. The RTL8125/8126/8127 chips support speeds
from 1Gbps to 10Gbps. Correct the range.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

rge.4: note that the driver manages PHY directly

The rge(4) driver does not use the miibus(4) interface for PHY
management. Instead, it accesses PHY registers directly via the
chip's OCP (On-Chip Peripheral) bus. Document this in the
DESCRIPTION section.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55995
8f36a012d65f1a3c4e071c3396ecc7a963485637 Christos Longros 2026-03-25 01:26:10
kldload.2: Provide more info about file argument
The information is basically taken from kldload(8).

Reviewed by:            kib, ziaee
Differential Revision:  https://reviews.freebsd.org/D55170
1e2c9bcc4ed5fd2a27abdbcf5dfb007193251648 Artem Bunichev 2026-03-26 13:11:26
manuals: System message vs kernel message
Wordsmith mentions throughout the manual of syslog and dmesg, to clearly
differentiate them in an externally consisteny way, increasing operator
onboarding speed and elegance.

The daemon that handles general system messages, syslog, describes them
as "system messages", and "messages" is the standard filename. Rewrite
syslog related manual titles to align search results with this, and hier
entries to align the index. Use care to maintain keywords and not add
extra lines. Newsyslog trades "maintain" with "rotate" for visibility.

MFC after:      3 days
Reviewed by:    markj
Closes:         https://github.com/freebsd/freebsd-src/pull/2067
04d58d529a61f3bba2c1a843bc2793923a005759 Alexander Ziaee 2026-03-08 07:23:17
rtld_get_var(3): provide explicit list of rtld vars that can be modified
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56055
f7b368d25fadbfcba5072dfab3738082393fa189 Konstantin Belousov 2026-03-25 22:38:35
DEVICE_IDENTIFY.9: Fix function call to detect driver in example code
Fixes:          https://cgit.freebsd.org/src/commit/?id=ccabc7c2e556 ("DEVICE_IDENTIFY.9: Modernize description and use cases")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
c78937677c973c48fd438ea06cfb51e11cc62851 Olivier Certner 2026-03-27 14:46:58
dup(2): document the handling of filedescriptor flags
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56121
6cc99baea607255859ee958608e4db6e2ff24793 Konstantin Belousov 2026-03-28 08:51:42
_exit.2: Cross-reference atexit(3)
atexit(3) is one of the cases when _exit(2) must be used instead of
exit(3).

MFC after:              3 days
Reviewed by:            mhorne, ziaee
Differential Revision:  https://reviews.freebsd.org/D54467
c082e5656417945bfa567114c60969844f3d7bdf Artem Bunichev 2026-03-31 17:09:00
malloc.9: adjust flag table indentation
The current indentation is shorter than all but one of these flags. This
renders much more nicely.

MFC after:      3 days
be79a42275cad21c6087d8bbd6a328735ea813fa Mitchell Horne 2026-03-31 19:42:55

Hardware support

Hardware drivers and architecture-specific code.

snd_hda: Default to 256 when corb/rirb is invalid
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289284
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D54339
2455db44ef088797d113397f863d46c50e77134f Christos Margiolis 2026-01-02 15:49:33
Commit group #7: sound
sound: Retire pcm_feeder->desc_static

Not sure what the value of this was.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54103
84976625da387a266f01b0a566aab447426609f7 Christos Margiolis 2026-01-02 16:55:44

sound: Update pcm/feeder.h LICENSE

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
2b088823df5b0f28c3839bf381c9517b7b0d60c0 Christos Margiolis 2026-01-02 16:55:47

sound: Retire unused pcm_feeder->align

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
6002ce537b6a0e524da1a60ccd70493d8cd59b9b Christos Margiolis 2026-01-02 16:55:51

sound: Get rid of unnecessary breaks

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
21a2aa785d7d7610b3e90e028ae782893d8c095a Christos Margiolis 2026-01-02 16:55:54

sound: Stop building midi as a module

There is no reason for this. The midi functions are used by drivers
on-demand anyway. Use SYSINIT(9) instead to do the appropriate
(de-)initilizations.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54125
45bb10e0ed5a0b87adcae33635400b5bc36337ec Christos Margiolis 2026-01-02 16:55:57

sound: Retire midi_devs and mstat_lock

Nowadays midi_devs only has two uses:

1. To verify in midi_init() if a given device unit exists, as well as to
   calculate the next device unit. Instead, make sure we always get a
   unique unit and channel number using unr(9).
2. To keep track of all midi devices, so that it can destroy them all at
   once in midi_sysuninit(). However, since we stopped building midi as
   a kernel module, there is no reason to do that, simply let the
   drivers tear down the devices themselves.

Also retire mstat_lock since it's only used to protect midi_devs.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261071
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54126
c508be8ca9578ef6e3e4b31de1baca8038c0e0ae Christos Margiolis 2026-01-02 16:56:02

sound: Remove endianness checks for format table declarations

This a legacy thing that is not needed anymore. We can support all of
them just fine.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55939
6755f558c1d7d22cac5b123082fdb2ac080c228d Christos Margiolis 2026-03-24 10:31:39

sound: Do not create root feeder in chn_init()

The feeder chain gets destroyed when feeder_chain() is called, which is
after the chn_reset() call in chn_init() further down for primary chans,
or vchan_create() for vchans. This makes the root feeder creation in
chn_init() essentially a no-op. Remove it altogether and let
feeder_chain() after chn_reset() take care of creating the feeder
properly. It creates the root one as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55941
b9f9fc473eb56273978df4d4c889acba2862b21c Christos Margiolis 2026-03-24 10:31:43

sound: Remove SND_DIAGNOSTIC section in buffer.c

The purpose of this has not been documented, but it seems like it makes
it possible to view the maximum number of bytes that passed to
sndbuf_feed(), as well as the maximum number of cycles taken inside its
main loop. These do not seem particularly useful anymore.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55989
4324e0fa71f85f274013100d912584a042c9909e Christos Margiolis 2026-03-24 10:31:48

sound: Always use chn_getvolume_matrix()

There is no reason not to use it. We do it already with CHN_SETVOLUME().
chn_getvolume_matrix() is the same as the non-INVARIANTS
CHN_GETVOLUME(), just without the additional KASSERT
chn_getvolume_matrix() provides.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55990
0b7f9597024a0061b1e6c544d78bc2ed9392bd89 Christos Margiolis 2026-03-24 10:31:53

sound: Retire CHN_GETVOLUME() and use chn_getvolume_matrix()

CHN_GETVOLUME() is just a wrapped around chn_getvolume_matrix() anyway,
so use it directly.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55991
f190fad18c385c184cb3600b7e24a362858a1911 Christos Margiolis 2026-03-24 10:31:59

sound: Retire CHN_SETVOLUME() and use chn_setvolume_matrix()

CHN_SETVOLUME() is just a wrapped around chn_setvolume_matrix() anyway,
so use it directly.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55992
127aa056fea0714116952efb7664956e0f2b69cd Christos Margiolis 2026-03-24 10:32:04

sound: Retire CHN_GETMUTE() and use chn_getmute_matrix()

chn_getmute_matrix() does what CHN_GETMUTE() does, but with a few
additional checks.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55993
d171d5b8b5acb145efb41a57a2a8f3cded59a484 Christos Margiolis 2026-03-24 10:32:08
snd_dummy: Initial MIDI support
Because testing the midi/ code of sound(4) requires a physical MIDI
device, add some basic MIDI support to snd_dummy(4) so that we can test
patches to midi/ easier.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54127
e963472ef8533fb39b581e746cdc2ddc7447dca2 Christos Margiolis 2026-01-02 16:56:07
Commit group #8: sound
sound: Retire snd_midi->qlock

snd_midi->qlock is used to protect snd_midi->{in,out}q. However, apart
from the numerous LORs present already in the code, there is no reason
not to use snd_midi->lock, as we do for the rest of the structure

Started by:     https://github.com/freebsd/freebsd-src/pull/1902
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_nicolas-provost.fr
Differential Revision:  https://reviews.freebsd.org/D54129
4cc78f5dd7c2e82571ced6e23fa22d48c6cd1697 Christos Margiolis 2026-01-02 16:56:12

sound: Update midi/midi.* LICENSE

Spsonsored by:  The FreeBSD Foundation
MFC after:      1 week
fb945a50e2649c9a1c3a9b38ffb84f53e37abd0a Christos Margiolis 2026-01-02 16:56:15

sound: Merge midi_destroy() with midi_uninit()

Also always call MPU_UNINIT(). It does not make sense not to if we are
deallocating everything.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54192
d912ea5879cd6b1042671ae3986d496c63be4d49 Christos Margiolis 2026-01-02 16:56:19

sound: Retire snd_midi->busy

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
d54c782fde63d3b17433551da0b7ec94bc2a5ed4 Christos Margiolis 2026-01-02 16:56:22

sound: Remove dead if-statement

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
d2baf9301be3093c5f53a7ce1de858a0c690cd07 Christos Margiolis 2026-01-02 16:56:24

sound: Rename midi_cdevsw name to "midi"

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
d6121f7b508bf889359e116da1efab08f848e129 Christos Margiolis 2026-01-02 16:56:27

sound: Retire MIDI_DEBUG

Better logging will be implemented.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
c288595c4eac14616f94c5b7eb84aad2eeeffc1f Christos Margiolis 2026-01-02 16:56:29

sound: Retire MIDIQ_DEBUG

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
3b9e776498a7e3e96c1a351fdd561f25803718df Christos Margiolis 2026-01-02 16:56:31

sound: Improve snd_midi->{in,out}q allocation

Currently we lock and allocate the buffers with M_NOWAIT, without
checking if the return value of malloc(). This is not necessary as
subsequent check below will eventually check that. However, for
correctness, allocate the buffers with M_WAITOK (there is no reason not
to) and lock afterwards.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54131
b9db6c21287311b9e861893c065289d987a75804 Christos Margiolis 2026-01-02 16:56:34

sound: Move sndstat out of pcm/

Needed by follow-up patches that will add sndstat support for midi/

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54140
bafa8c951d8cfaec75e774af03d7ab6fadb448b9 Christos Margiolis 2026-01-02 16:56:41

sound: Take device type into account in sndstat

sndstat will be extended to work with MIDI devices as well, so separate
functionality based on the device type.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54141
2aa16666e2fa5c98be8d330cd0c32c9dc3801ba7 Christos Margiolis 2026-01-02 16:56:46

sound: Do not check for NULL before free()

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54174
792251295cdf6c3e1cbb1aa6291434539632912f Christos Margiolis 2026-01-02 16:56:52

sound: Get rid of unused midi/midi.c defines

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
4a2d1532e84135a50ba8414ceaafc0c3a1bfe94b Christos Margiolis 2026-01-02 16:56:55

sound: Retire mpu_callbackp()

It is the exact same as mpu_callback().

No functional changed intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
e3b57ceffef0158a72a7a5aedfa9df88b3a8a88b Christos Margiolis 2026-01-02 16:56:58

sound: Make mpu_if definitions static

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
3094c5e388df296f1b84579f70a5583ddc3bc26a Christos Margiolis 2026-01-02 16:57:00

sound: Get rid of unused MIDIQ macros

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
3f8a85a085c710f50b8bcd4efe915268882129d2 Christos Margiolis 2026-01-02 16:57:03

sound: Allocate mpu401 with M_WAITOK

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
fd1312d3629cda9691c67af6154946cd55467076 Christos Margiolis 2026-01-02 16:57:06

sound: Retire unused snd_midi->name

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
a9c3bb39bc9181b8762e67c40d00886474e9ae06 Christos Margiolis 2026-01-02 16:57:08

sys/conf/files: Fix sndstat path

Reported by:    CI
Fixes:          https://cgit.freebsd.org/src/commit/?id=bafa8c951d8c ("sound: Move sndstat out of pcm/")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
8c7a7d7df508faa75515d4f0b8ef58c30ad4ccc9 Christos Margiolis 2026-01-02 17:46:48

sound: Address some XXX comments regarding AC'97 IDs

These seem harmless to address. Not sure why the original author did not
just assign the appropriate names if he knew they were wrong.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56044
edad981e1e8673b6dd14656fe75b9f239fb777ce Christos Margiolis 2026-03-24 10:32:31

sound: Remove dead code in pcm/ac97.c

ac97_uninitmixer() does not exist also.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56045
d048cec5fb41cf9529dd0b637a51c7ee72b59b3b Christos Margiolis 2026-03-24 10:32:36

sound: Remove unimplemented chn_reinit() definition

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
2e1cf242292a33a71839c512d222115d36f8fd40 Christos Margiolis 2026-03-24 10:32:38
snd_uaudio: Do not use pcm_channel->lock to protect uaudio_chan
This is a layering violation, but it also makes the control flow
confusing; snd_uaudio(4) should have its own lock to protect its
structures.

Fixes:          https://cgit.freebsd.org/src/commit/?id=5cc34a83e1 ("Revert "sound: Merge chn_intr() with chn_intr_locked()"")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54102
c234740c9d34c2b953c6010f6a01b0aca9648c08 Christos Margiolis 2026-01-02 17:20:36
sound: Merge chn_intr() with chn_intr_locked()
There is no scenario where chn_intr() is called with the channel lock
already held.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D53854
0794365d5d3cc93940b873553382288a2a2c88c4 Christos Margiolis 2026-01-02 17:20:41
Commit group #9: hwpstate: add CPPC support for pstate driver on AMD
hwpstate: add CPPC support for pstate driver on AMD

Implement CPPC interface for AMD Pstate Driver.
This feature is only enabled when the CPUID shows it support CPPC.

The CPPC is implemneted by the following steps:

1. Write MSR to enable it.
2. Read capability registert which indicates binary value of levels
about lowest, best energy efficient, guarantee, and max performance.
3. Write request register with epp in energy balanced mode. And let
CPU and firmware to enter autonomous mode.

Also, create a sysctl handler to allow userspace to change epp value.
In intel's hwpstate, The epp value can be in package level and core level.
However, in AMD's one, there is only core level. Thus, to sync with the
intel's code, we implement package level control in software and provide
another sysctl (machdep.hwpstate_pkg_ctrl) to control it.

Reviewed by:    olce, khng
Approved by:    lwhsu (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49587
3e6e4e4a0d42fa24f3b2a1c087e9ad25f9594081 ShengYi Hung 2025-07-08 11:45:26

hwpstate_amd: Fix compile error

Add parentheses between OR and AND operator to pass the compiler check.

Approved by:    lwhsu (mentor)
Fixes:  https://cgit.freebsd.org/src/commit/?id=3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate driver on AMD")
MFC aftert:     2 weeks
Differential Revision: https://reviews.freebsd.org/D54465
3642ba2a9840734d83dd77ca4c1aa0ecb3bfe879 ShengYi Hung 2026-01-03 05:07:15
asmc: improve asmc_dumpall to read actual SMC key count
The asmc_dumpall debug function previously used a hardcoded loop limit
of 0x100 (256) keys with a "XXX magic number" comment.

This change improves asmc_dumpall to:

* Read the actual number of keys from the ASMC_NKEYS SMC key
* Print the key count being dumped for better debugging output
* Loop only up to the actual key count (e.g., 297 on Mac Mini 5,1)

This provides more accurate debug output and removes the magic number.

Tested on Mac Mini 5,1 (FreeBSD 16.0-CURRENT):

* Rebuild kernel with DEBUG enabled in asmc driver
* Boot with new kernel
* Verify dmesg shows "asmc_dumpall: dumping 297 keys" (or actual count)
* Verify all 297 keys are dumped

Differential Revision:  https://reviews.freebsd.org/D54436
Reviewed by:    markj, adrian
2a7c4685b7693bfa15e2bd4d5e82905a368b0030 Abdelkader Boudih 2026-01-03 18:33:11
powerpc: put the isync inside the TD_LOCK() checking loop
Fix a narrow window where the lock is unlocked but the checking CPU
hasn't flushed things appropriately.

Inside this window the CPU inside cpu_switch() will loop forever thinking
the destination thread is still blocked/locked even though it is not.

This manifests as the system hanging after starting all APs.

I've seen this reliably trigger in qemu-system-ppc64 running power9 pseries
guests; the more CPUs the more likely it triggers at boot.

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292167
Differential Revision:  https://reviews.freebsd.org/D54478
Reviewed by:    jhibbits
MFC after:      1 week
Relnotes:       yes
8df2e542146801fd01675e56724eaa567d04c209 Adrian Chadd 2026-01-03 22:52:14
ufshci: Fix task management queue num_trackers on failure path
Fix a kernel panic caused by the task management queue using
the transfer request queue’s num_entries value.

Sponsored by:           Samsung Electronic

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54243
ef2d7cc11d04728f2b97d2b0188d77be77d5c252 Jaeyoon Choi 2026-01-05 02:35:52
ufshci: Enable admin command retry
Also, This patch fixes an issue where the admin command flag was not
passed through.

Sponsored by:           Samsung Electronic

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54244
ece6e062ae4b419736c8bb65874ece6be28c2100 Jaeyoon Choi 2026-01-05 02:36:10
asmc: add per-fan manual mode control via sysctl
Add per-fan manual mode control via dev.asmc.0.fan.N.manual sysctl.

Apple SMCs support manual fan control via the FS! SMC key,
a 16-bit bitmask where each bit controls one fan (0=auto, 1=manual).

This change adds a new sysctl per fan:
    dev.asmc.0.fan.N.manual (0=auto, 1=manual)

When set to manual mode (1), the fan runs at the speed set via
dev.asmc.0.fan.N.targetspeed instead of automatic thermal control.  When
set to auto mode (0), the SMC controls fan speed automatically.

The FS! key was already defined in asmcvar.h but not accessible.
This exposes it for debugging, testing, and advanced fan control.

Implementation uses read-modify-write to allow independent control of
each fan without affecting others.

Reviewed by:    adrian, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54437
1ecac45cfc5f0886907c34ec0da2c1b32618665d Abdelkader Boudih 2026-01-05 18:03:23
ixl: verify flowid is valid before setting rsstype & flowid
According to section 8.3.2.2.1 of the XL710 datasheet,
FLTSTAT indicates if RSS hashing was used (or flow director
or nothing) to arrive at the flowid it is reporting.
We need to check this before reporting the flowid and setting the
rss type. Not checking this allows invalid flowids (0s) to be
reported for some TCP traffic (it seems to mostly impact incoming
connections). This leads to the inp flowid being 0, and egress
traffic being unbalanced (going to tx queue 0, and NIC 0 of an
lacp bundle).

Differential Revision: https://reviews.freebsd.org/D54442
Reviewed by: adrian, kbowling
Sponsored by: Netflix
MFC after: 2 weeks
ac1cd655f647cfd8e8d8c08da00f41abfce212a1 Andrew Gallatin 2026-01-05 17:02:23
x86: change ap_boot_mtx from spinlock mutex to naive lock
Problem is that the printfs done under the spinlock might be very slow,
then spinlock triggers the panic due to some AP holding the mutex too
long.  We do want to ensure that the printfs are serialized, still.

Also, reduce the scope of the lock. The local APIC and MTRR
initializations are local to the AP, while mca_init() protects the
shared state with mca-private spinlock.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289297
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54464
55305b590797524dd1cecfc9406869700e925e51 Konstantin Belousov 2026-01-03 01:09:32
powerpc: Update CPUTYPE options in make.conf
Document the supported PPC/POWER CPUTYPEs in the example make.conf.

Update bsd.cpu.mk to handle CPUs newer than POWER9, and remove
32-bit CPUTYPEs since we no longer support those at all.

Reviewed by:    imp, jhibbits
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D54257
665ac052aa04c4dc240d67c3c2166ac63e7f86eb Lexi Winter 2026-01-06 04:22:20
arm64: Add Arm SPE thread mode support
Add support for the using the Arm Statistical Profiling Extension (SPE) in
the hardware tracing framework, hwt(4), thread mode.

SPE is an optional extension added in Armv8.1 to provide profiling of
software using randomised instruction sampling. Thread mode allows tracing
of a single thread, regardless of the CPU it is scheduled on.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53738
6748ac4ee7ce1e6e6888293cf855fed4eb734126 Sarah Walker 2026-01-02 16:27:43
arm64: Fix jump to wrong label in case of 0 entries
Broke qemu-system-aarch6 boot with VIRT kernconf

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292156
Fixes:          https://cgit.freebsd.org/src/commit/?id=ea8dc498aa8e ("arm64: Create an L3 table to limit permissions")
Signed-off-by:  Marian Cingel <cingel.marian@gmail.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1943
a9f2f92322f211921b955b13b088624efe7f901a Marian Cingel 2026-01-03 14:45:27
arm64: Correctly align the SVE signal context
The SVE signal context needs to be correctly aligned. Fix this by
creating a new macro to calculate the needed size to provide this
alignment, and use it when setting and checking the saved SVE signal
context.

Reported by:    cperciva
Reviewed by:    cperciva, markj
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54396
a9e77eb7016df70723c208fc09fbd01ec23a732d Andrew Turner 2026-01-06 10:35:55
mips: remove mips leftovers
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1909
6c6e00b7f16f3bda1b56da6a57d65ff6e26ae3e7 Minsoo Choo 2025-12-01 02:48:05
mfi(4): Add subvendor and subdevice for Fujitsu RAID Controller SAS 6Gbit/s 1GB (D3116)
This is an OEM card from Fujitsu using an LSI SAS2208 ROC controller shipped
with many Fujitsu PRIMERGY servers like RX300 S7. This chip is also recognized
by mrsas(4) under the generic name for the controller chip.

Controller description: https://www.fujitsu.com/global/products/computing/servers/primergy/blades/connection/cb-pmod-110426.html

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54520
8b210276cde207ca3dc1f7f46d5a6d32e0a1c51d Michael Osipov 2025-12-21 15:53:27
if_rge: sync with up to date OpenBSD code
a0b4d9e5bd63984bc3ad25b7f2881741e0d73980
Add support for RTL8126 chip revision 0x64a00000 from Carl Henriksson.
While here, update and add microcode for the RTL8126 chipset variant.

46810ff569a9416642fc5f8e86501028008a2e95
For RTL8125, there's no need to check whether RGE_CMD_STOPREQ has been
completed.  As with other chip variants, RGE_CMD_STOPREQ never acknowledges
completion.

5729fb17b5eeba56781da0b5c0525c198c5c2cd8
remove duplicate RGE_PHYSTAT_5000MBPS test

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D54517
Obtained from:  OpenBSD
5d73fca1f4b2bac8833e2b9233fa496059dab745 Brad Smith 2026-01-07 02:24:12
sdhci_pci(4): Remove incorrect __unused
The slot parameter actually is used as index into the memory resource.

Fixes:  https://cgit.freebsd.org/src/commit/?id=c11bbc7d
9b5d6ab1be32772ba86021e50e709db9a1659226 Marius Strobl 2026-01-07 22:18:21
acpi: Make taskqueue only run on BSP
This is needed because when we add the suspend-to-idle loop, we only
want to break the BSP out of idle to process the taskqueue while keeping
all the others idled.

Currently assuming BSP to be CPU0, which may not always be the case on
non-x86.

Reviewed by:    kib
Approved by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54406
c0df8f6f0e6a5f77ec9140e8075d09c55fe4c3c7 Aymeric Wibo 2025-12-29 20:01:50
bnxt: fix i2c read to allow access to different addresses
Allow reading of i2c addresses other than A0. A0 does provide most
information, but doesn't provide things like module temps, and optical
signal levels.

Sponsored by: Netflix
Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D54590
MFC after: 3 days
b72cb305899ed30daf103b92818c199ccfc52378 Andrew Gallatin 2026-01-08 13:49:38
amd64: Remove tpm(4) from GENERIC for now
It breaks suspend/resume and no one has had time to investigate and fix
it.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291067
Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=3deb21f1afd5 ("random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM")
Differential Revision:  https://reviews.freebsd.org/D54587
16f8ea6a81b59a82d8c27c6b3aa380617485bfd2 Mark Johnston 2026-01-08 14:54:15
Commit group #10: vmm
vmm: Consolidate vm and vcpu definitions

There is quite a lot of duplication of code between amd64, arm64 and
riscv with respect to VM and vCPU state management.  This is a bit
tricky to resolve since struct vm and struct vcpu are private to vmm.c
and both structures contain a mix of machine-dependent and
machine-independent fields.

To allow deduplication without also introducing a lot of churn, follow
the approach of struct pcpu and 1) lift the definitions of those
structures into a new header, sys/dev/vmm/vmm_vm.h, and 2) define
machine-dependent macros, VMM_VM_MD_FIELDS and VMM_VCPU_MD_FIELDS which
lay out the machine-dependent fields.

One disadvantage of this approach is that the two structures are no
longer private to vmm.c, but I think this is acceptable.

No functional change intended.  A follow-up change will move a good deal
of machine/vmm/vmm.c into sys/dev/vmm/vmm_vm.c.

MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53584
a6411f6b7df46edc7167a7844ed443db7a91a031 Mark Johnston 2026-01-08 21:53:31

vmm: Deduplicate VM and vCPU state management code

Now that the machine-independent fields of struct vm and struct vcpu are
available in a header, we can move lots of duplicated code into
sys/dev/vmm/vmm_vm.c.  This change does exactly that.

No functional change intended.

MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53585
ed85203fb7a0334041db6da07e45ddda4caef13d Mark Johnston 2026-01-08 21:54:06

vmm: Move common accessors and vm_eventinfo into sys/dev/vmm

Now that struct vm and struct vcpu are defined in headers, provide
inline accessors.  We could just remove the accessors outright, but they
don't hurt and it would result in unneeded churn.

As a part of this, consolidate definitions related to struct
vm_eventinfo as well.  I'm not sure if struct vm_eventinfo is really
needed anymore, now that vmmops_run implementations can directly access
vm and vcpu fields, but this can be resolved later.

No functional change intended.

MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53586
5f13d6b60740c021951ae0e4d096903cfa1679e2 Mark Johnston 2026-01-08 21:54:16

vmm: Add an include to vmm_ktr.h for vm_name()

Required when KTR is configured.

Remove the pcpu.h include while here, as it seems to be unneeded.

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=5f13d6b60740 ("vmm: Move common accessors and vm_eventinfo into sys/dev/vmm")
0aaa95ae02803ba0195c5da695ffbb17a79135bc Mark Johnston 2026-01-08 23:29:06
kshim/usb: Prefer memset to bzero
Replace bzero with the equivalent memset(x,0,x) since the latter is
available in the kshim environment and we have a soft goal of migrating
to standard interfaces when there's a reason...

Sponsored by:           Netflix
b258282ecce3e2ad7ece6bec4f1507f70b85de87 Warner Losh 2026-01-02 19:55:28
mps/mpr: Remove bogus sys/cdefs.h includes
These are left over from the $FreeBSD$ stuff.

Sponsored by:           Netflix
d650b2ceda4641475e90ba1f6d349eac98aaa963 Warner Losh 2026-01-09 05:48:13
mps: Add a probe on completion
cam::mps:complete(union ccb *, struct mps_command *, u_int, u32);
    Where u_int is scsas->flags u32 is the device_info.

This can't be done as an fbt because the data needed for it isn't
present out a function boundary.

Sponsored by:           Netflix
6f8e117e5d78709ff70c19e5286949b35099fa9a Warner Losh 2026-01-06 05:13:38
mpr: Add a probe on completion
cam::mpr:complete(union ccb *, struct mpr_command *, u_int, u32);
    Where u_int is scsas->flags u32 is the device_info.

This can't be done as an fbt because the data needed for it isn't
present out a function boundary.

Sponsored by:           Netflix
0e80273f0d864d28bd3c3ae9dafd58e637743910 Warner Losh 2026-01-06 05:13:38
bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN
The driver and applications currently use hard-coded numeric ioctl command
opcodes. These opcodes are interpreted as having the IOC_IN direction (data
copied from the user application to the driver), regardless of the actual packet
size. Consequently, when the packet size is zero and the direction is set to
IOC_IN, the kernel fails these ioctls if COMPAT is disabled.

While the driver and applications should ideally set the direction correctly—
for example, using IOC_VOID when the packet size is zero—the driver will now
be updated to define ioctl opcodes using the _IOC macro to support both
IOC_VOID and IOC_IN. This change ensures backward compatibility with older
applications that exclusively use IOC_IN.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D54601
MFC after: 3 days
d53d7b466016408229491cfd2f8bdc742ff642e3 Sumit Saxena 2026-01-09 10:28:53
libpmc: Import AMD Zen 5 PMU events.
Sponsored by:         Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1954
bae832487038b2c8778dc6f52700b4353175ccec Ali Mashtizadeh 2026-01-08 22:33:41
smartpqi: update to version 4660.0.2002
This updates the smartpqi driver to Microchip's
latest available public release.

Reviewed by: imp
Approved by: imp

Sponsored by: Microchip Technology Inc.

Differential Revision: https://reviews.freebsd.org/D52507
c558eca47970c8467ed0494145f08d1879050bbd John Hall 2025-08-28 21:11:02
param.h: remove powerpcspe
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 1bfae8b50814697ac12bc8879ad8013e7ffd77b2)
81516ef418a7b3fb23b423b62dc1f2a5a3bde51b Minsoo Choo 2025-12-03 04:00:39
conf: remove MPC85XXSPE
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 40a49bccf388494f9685a81cfa781050f5f8bb1f)
f69fb0f8307e472e79f34ed7622b85ecb4c3c66d Minsoo Choo 2025-12-03 04:01:00
sdio: add sdio_{read,write}_2
This is equivalent of sdio_readw and sdio_writew in linuxkpi

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1951
2727bdebb366c3741509eb3553f0fee2453729d3 Minsoo Choo 2026-01-06 16:57:25
Commit group #11: nvme
nvme: Handle get/set feature payloads

Signed-off-by: Alexey Sukhoguzov <sap@eseipi.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1444
4c18ec0e75e1f2ca99e587d749a9191513e63a29 Alexey Sukhoguzov 2024-10-30 10:48:09

nvme: Support Autonomous Power State Transition (APST)

APST is an optional NVMe power-saving feature that allows devices
to autonomously enter higher non-operational power states after a
certain amount of idle time, reducing the controller's overall power
consumption.

Signed-off-by: Alexey Sukhoguzov <sap@eseipi.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1444
a24932dcec45ca68fa5ca2f49bbf0df539cfd710 Alexey Sukhoguzov 2024-10-30 11:03:30

nvme: Add APST payload overriding

The apst_data tunable allows APST configuration to be adjusted
during controller initialization.  It accepts an array of encoded
integers, each defining specific transition parameters.

Relnotes: YES
Signed-off-by: Alexey Sukhoguzov <sap@eseipi.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1444
f0d44ee06b6814224653324e09a948e15a177d1f Alexey Sukhoguzov 2024-10-30 11:04:49
acpi_ibm: register all appropriate sysctls as uint
All sysctls except thermal sensor readings and the handlerevents
whitelist-separated string are bitmasks or small integers. This avoids some
bitmasks being erroneously displayed as negative values.

Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1824
e881b8ee0bc7bf552c9c0a63c7d84542243f9f0d Quentin Thébault 2025-08-27 10:05:27
ata-serverworks: Fix incorrect port count for BCM5770 SATA controller
The 1166:0241 PCI device has 8 ports instead of 4.

Signed-off-by: Dmitry Borisov <di.sean@protonmail.com>
Reviewed by: imp, jlduran
Pull Request: https://github.com/freebsd/freebsd-src/pull/1883
247d24a694af84f0c80708ff0a6c4baa7fcca14d Dmitry Borisov 2025-10-29 14:06:57
smartpqi: Make pqisrc_is_supported_write static
This fixes a build error with -O0 and matches all the other pqisrc_is_*
routines in the file.

--- kernel.full ---
ld: error: undefined symbol: pqisrc_is_supported_write
>>> referenced by smartpqi_request.c:1799 (/.../smartpqi_request.c:1799)
>>>               smartpqi_request.o:(pqisrc_build_scsi_cmd_raidbypass)
73a238643a2e9ef298d961966040587ca0970a58 Navdeep Parhar 2026-01-10 20:15:17
cxgbe(4): Update shared code and config files
Obtained from:        Chelsio Communications
MFC after:      1 week
Sponsored by:   Chelsio Communications
dda55f83f9b8238ebf2940c9c1e227785db540b2 Navdeep Parhar 2025-11-20 21:27:48
cxgbe(4): Move CPL-specific handling out of eth_rx
IPsec rx uses a new CPL and this prepares eth_rx for IPsec support in
future commits.

Tidy up the comment and code around M_TSTMP while here.

MFC after:      1 week
Sponsored by:   Chelsio Communications
01c0005dced136423829724d6b6e9566de10966c Navdeep Parhar 2026-01-10 02:48:36
vmm: Avoid clobbering errors from vmm_modinit()
Reported by:  novel
Reviewed by:    bnovkov
Fixes:          https://cgit.freebsd.org/src/commit/?id=e758074458df ("vmm: Move the module load handler to vmm_dev.c")
Differential Revision:  https://reviews.freebsd.org/D54750
99afbc5cc7ae8ba7b112fbafbf24ea2575a65ba4 Mark Johnston 2026-01-19 14:29:33
x86/local_apic.c: add lapic_maxlvt() helper
that calculates the max index of the present LVT entry from the value of
the LAPIC version register.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54773
ad5e3cb950344f9822dbbd90f5ac7c256f97fa4c Konstantin Belousov 2026-01-19 12:50:09
x86/local_apic.c: Properly calculate the number of LVT entries
First, the CMCI entry index is APIC_LVT_MAX, so it was excluded
unconditionall [1].

Second, the number of entries is reported by the version register, and
we must not access past the last reported entry.

Reported by:    olivier [1]
Fixes:  https://cgit.freebsd.org/src/commit/?id=11f954b021a1aadde1d03d40ed5d6b529e14da98
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54773
709a53c8b20b5770f7e2f117d4799b5617479976 Konstantin Belousov 2026-01-19 11:55:36
acpi: Fix not calling AcpiLeaveSleepState() in S3 path
When resuming from ACPI suspend, the ACPI_SS_SLP_PREP bit in slp_state
was being checked and subsequently unset when calling resumeclock().
This bit was also being checked for the AcpiLeaveSleepState() call in
the non-s2idle path, but having just been unset, it was never actually
being called.

Change this so that resumeclock() is always being called (since we never
goto breakout between suspendclock() and resumeclock() anyway) and
ACPI_SS_SLP_PREP is purely used for AcpiEnterSleepStatePrep() and
AcpiLeaveSleepState() in the non-s2idle paths.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292568
Reported by:    Marek Zarychta
Reviewed by:    olce
Tested by:      Marek Zarychta
Approved by:    olce
Fixes:  https://cgit.freebsd.org/src/commit/?id=7669cbd0f064 (“acpi: Suspend-to-idle support (s2idle)”)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54777
4b534b814aa03b44660ede6d5f1a62cb33c24115 Aymeric Wibo 2026-01-19 13:19:52
amd64/vmm: remove unused static function vcpu_state2str()
It is guarded by #ifdef KTR, so the warning does not show up under usual
kernel configs.

Fixes:  https://cgit.freebsd.org/src/commit/?id=ed85203fb7a0334041db6da07e45ddda4caef13d
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D54781
002c50ea23b99b415b1b392d3dd5ea6223c3a74c Konstantin Belousov 2026-01-19 16:25:50
dwc: cleanup
No functional change intended.

Reviewed by:            Timo Völker
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D54788
3d771e0db66da77da5a7f323df1c0638e6b586ea Michael Tuexen 2026-01-20 10:25:31
dpaa: Simplify CPU binding for bman and qman
If cpu-handle property doesn't exist simply iterate and assign the CPUs
in sequence rather than following the convoluted search which may not
bear fruit in some cases.  If cpu-handle doesn't exist for one portal it
probably doesn't exist for any of them.
c611ef5747a5d2ceb094331d3dd74d5c8b523b9c Justin Hibbits 2026-01-21 04:16:04
powerpc/mpc85xx: Set pc_hwref to the primary thread ID
On multithreaded cores (e6500) the CPU ID in the device tree (reg[0]) is
the primary core, which may not match the cpuid, until Book-E threading
is added.
24d048be7aae10e101596bd0d0f09a901a6f97f0 Justin Hibbits 2026-01-21 04:16:17
powerpc/mpc85xx: Fix PCI attach error cleanup
If an error occurs during attach after ofw_pcib_init() runs, the device
is torn down, leaving the rmans embedded in the softc attached to the
rman list, thus corrupting the rman list.  Fix this by undoing
everything that was done by this point.

MFC after:      1 week
21a7a9ef8b49ce21b87c8526b526f97cc91fdd43 Justin Hibbits 2026-01-21 04:19:28
dpaa2: cleanup
No functional change intended.

Reviewed by:            bz, dsl
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D54805
d8b8dc776b7ce28bff8939dd185b4d6554b5e351 Michael Tuexen 2026-01-21 07:16:46
hwpstate: Add CPPC enable tunable
The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.

Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.

Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:

machdep.hwpstate_amd_cppc_enable="0"

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:            lwhsu, olce
Differential revision:  https://reviews.freebsd.org/D54803
ad9932995cf8f93143ff033712016d95b5cb7a50 Cy Schubert 2026-01-05 04:53:51
x86: add machine/ifunc.h
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
2b1db07bec92e9447e6574a74366d4dd606e80a6 Konstantin Belousov 2026-01-22 05:08:30
x86 lapic: Dump LVTs from the ddb show lapic command
Add description for each LVT element, use it in show lapic dump.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
dfc4186c6dcf2986b510fac108784011a236554d Konstantin Belousov 2026-01-22 18:00:56
dpnaa2: announce transmit checksum support
Let the network stack know that the NIC supports checksum offloading
for the IPv4 header checksum and the TCP and UDP transport checksum.
This avoids the computation in software and therefore provides the
expected performance gain.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Reviewed by:            dsl, Timo Völker
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D54809
f31336b3e3146fed9cc517fef8e877c17496f9e0 Michael Tuexen 2026-01-23 07:59:57
arm/gic: Detect broken configurations
Some virtualization platforms provide broken configurations. There
is a GIC interrupt controller, however accessing the CPU interface
registers leads to an external data abort. As these are needed to
handle interrupts we are unable to boot further.

Detect this misconfiguration and panic to tell the user the issue.

Reviewed by:    emaste
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54832
6c5fdba45a63d66984e15ddc6996f5e88a55f22c Andrew Turner 2026-01-23 14:31:04
amd64: Fix sys/pcpu.h usage in vmm_host.h and md_var.h
Include sys/pcpu in vmm_host.h as its structs and functions are used
there, and add a forward declaration of struct pcpu to md_var.h as it
is used in some function prototypes.

Reviewed by:    corvink, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D51550
202e3109a9d6699cf78e83f9047cefeb07659767 Hans Rosenfeld 2026-01-24 01:29:00
cam/scsi: Restore scsi_start_stop() and add scsi_start_stop_pc()
Revert the argument change that broke libcam in 8c35de49 and move
power_condition support to scsi_start_stop_pc().

Reported by:            imp
Reviewed By:            #cam, imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D54822
8ef8c6abfadfc9eb0465ce57c6b09ca310415bdd Jaeyoon Choi 2026-01-26 06:29:28
hpt: remove unnecessary macro expansion hacks
Reviewed by:  imp
Differential Revision:  https://reviews.freebsd.org/D54875
c29e05113c000dc04552f8d21a92fd00c60d0a98 Ahmad Khalifa 2026-01-26 09:28:08
Commit group #12: acpi_spmc: Add system power management controller driver
acpi_spmc: Add system power management controller driver

Add SPMC (system power management controller) driver as acpi_spmc. This
is the device which provides the LPI device D-state constraints and
allows for OSPM to send S0ix/modern standby entry/exit notifications.
This supports the original Intel DSM
(https://uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf,
untested), the AMD DSM (tested), and the Microsoft DSM (tested).

Before entry, acpi_spmc_check_constraints is called to notify of any
violated power constraints. This will use acpi_pwr_get_state to get
current device D-states when that gets added back.

Reviewed by:    olce
Tested by:      jkim, Oleksandr Kryvulia, Matthias Lanter
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48387
c5daa5a4c32c9b1ecb506ddf1a80579c93c3ea6d Aymeric Wibo 2025-06-14 15:30:44

acpi: Add ACPI_SPMC debug layer define

Reported by:    des
Fixes:  https://cgit.freebsd.org/src/commit/?id=c5daa5a4c32c ("acpi_spmc: Add system power management controller driver")
Sponsored by:   The FreeBSD Foundation
49ec19f1e101a079bc3749e25c4c927098f2f67a Aymeric Wibo 2026-01-26 16:54:37

acpi_spmc(4): Fix compilation on 32-bit platforms

Fixes:          https://cgit.freebsd.org/src/commit/?id=c5daa5a4c32c ("acpi_spmc: Add system power management controller driver")
Sponsored by:   The FreeBSD Foundation
149e6c67ca80e72066ff84a0138914a6896559fb Olivier Certner 2026-01-28 09:45:15
riscv: smarter DMAP construction (again)
Extend pmap_bootstrap_dmap() to build the DMAP with 4K-page granularity.

Recently we have been approximating it with 2MB mappings. The motivation
again is the problematic FU540 hardware, which seems to require more
accurate mappings still to avoid triggering its PMP errata.

Although this hardware alone is of little consequence, constructing the
DMAP accurately/correctly may help avoid future surprises.

The implementation contains some repetitive code. This could be
expressed differently, but my guiding principle for these early routines
is that being simple and explicit about what we are doing makes them
easier to comprehend.

See also 762a3224cde6 ("riscv: smarter DMAP construction).

Tested by:      Klaus Küchemann <maciphone2@googlemail.com>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54716
27595bea69400ae71fa778cf1dcb52a793911ad4 Mitchell Horne 2026-01-21 18:58:01
Commit group #13: sym(4)
sym(4): Consistently use device_printf(9) where applicable
48eee744b540ef0413fa1cb543dde6e49e7f2ac4 Marius Strobl 2026-01-21 17:29:35

sym(4): Use memcpy(9) instead of bcopy(9)

The overlap handling of bcopy(9) is not required in these cases.

Obtained from:  BSD-licensed Linux sym53c8xx driver
c8e9479c74a2af0f6c665e930091c163bf760fd5 Marius Strobl 2026-01-21 16:47:50

sym(4): Provide a DEVICE_DETACH(9) method

This also fixes sym_cam_free() to tear things down correctly, i. e. in
opposite order of setup, as well as sym_cam_attach() to not free devq
and SIM twice in the failure case.
518c01b31e96bbe8353a551885a61e7da6aed5f6 Marius Strobl 2026-01-22 09:05:38

sym(4): Employ memory barriers also on x86

In an MP world, it doesn't hold that x86 requires no memory barriers.

This change should also fix panics due to out-of-sync data seen with
FreeBSD VMs on top of OpenStack and HBAs of type lsiLogic. [1]

While at it:
- Improve the granularity somewhat by distinguishing between read and
  write memory barriers as well as refer to existing *mb(9) functions
  instead of duplicating these [2], unless IO barriers are also used.
- Nuke the unused SYM_DRIVER_NAME macro.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270816 [https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=1]
Obtained from:  BSD-licensed Linux sym53c8xx driver [2]
MFC after:      1 week
e769bc77184312b6137a9b180c97b87c0760b849 Marius Strobl 2026-01-26 13:58:57
riscv: Add macro for hfence.gvma instruction
Add an inline function hfence_gvma() for hfence.gvma instruction.

Signed-off-by:  Doongar Singh <doonbsd@gmail.com>
Reviewed by:    mhorne, markj
Differential Revision:  https://reviews.freebsd.org/D54857
972c488bf4117d9eb29e5753c6c5a2250154df3d Doongar Singh 2026-01-26 16:18:22
arm64/vmm: Simplify vmmpmap_remove()
This function handles invalid intermediate PTP entries, but there's no
reason for this: the passed range should be mapped.  In particular, we
assert that all L3 entries encountered are mapped.  So let's simplify
the code a bit.  No functional change intended.

Reviewed by:    andrew
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54738
31e5decb18a6633f5137848b5734310b41fc3bdc Mark Johnston 2026-01-26 21:05:43
bnxt: don't set media status if link is down
When the link is down don't set flags other than IFM_AVALID & IFM_ETHER
This avoids `media: Ethernet autoselect (Unknown <full-duplex>)` on ifconfig

Reviewed by:    zlei, pouria
Approved by:    glebius (mentor)
MFC after:      1 week
Sponsored by:   Stormshield
Differential Revision: https://reviews.freebsd.org/D54573
69de2b4e96794793f04d1b323d354fcde3c480f6 Anaëlle CAZUC 2026-01-26 23:06:02
powerpc: add a best-effort SMP time base sync for G5's that need it
There's no timebase freeze platform routine registered on my dual 2.3GHz
G5 PPC970FX Apple PowerMac.

For platforms without an explicit timebase freeze/unfreeze, we'll have to
make do with what we have - which for now is an explicit hand-crafted
spinlock/rendezvous method.

* For existing platforms, they'll still continue to clock freeze /
  rendezvous; albeit with some stronger atomic bits now (from jhibbits@.)
* Instead of the fallback being "no timesync", implement a
  best-effort one which does a similar rendezvous barrier between
  BSP and APs, but instead of freeze/unfreeze the first instruction
  after the CPUs all register they're ready is to set the timebase.

This has resulted in many reboots of my Powermac G5 dual-socket device
correctly starting and running in SMP mode.

Differential Revision:  https://reviews.freebsd.org/D54821
Reviewed by:    jhibbits
422c8719eab2b8a01b49f748a88dd372db25f888 Adrian Chadd 2026-01-20 02:38:43
powerpc: disable the TLBIE lock, it's not needed for POWER8
According to POWER8_UM_v1.3_16MAR2016 3.8.3 Translation Lookaside
Buffer (TLB), POWER8 supports lockless TLBIE operations.

Locally Tested:

* IBM POWER8 Revision 2.0, dual socket, 160 threads

Differential Revision:  https://reviews.freebsd.org/D54855
Approved by:    jhibbits
9a5baa9c585652fb7bd4ccd45d567204caf349f2 Adrian Chadd 2026-01-23 07:36:00
cxgbe(4): Fix netmap rx behavior with nm_split_rss
The driver should look for active queues and one potential default-queue
in both halves of the split instead of stopping at the first valid
default-queue.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a9f476580eb0 cxgbe(4): fixes for netmap operation with only some queues active
MFC after:      1 week
Sponsored by:   Chelsio Communications
77d71f5f36cc01e7fc2ca0828af00a4478bbf53c Navdeep Parhar 2026-01-27 01:03:05
bnxt_re/libbnxtre: Add RoCE support for BCM576xx controllers
Added RoCE support for BCM576xx controllers with below changes,

1. Update the BAR offsets for handling BCM576xx controllers.
Use the values populated by the L2 driver for getting the
Doorbell offsets.

2. Use msn index instead of tail to pull psn table entry.

3. Temporarily disable dbr pacing feature untill it is
fully implemented.

4. Add support for 400G speed.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54521
MFC after: 3 days
92ba9b2fe58910b1d2cd6cd34b5ec093f0d9f700 Sreekanth Reddy 2026-01-23 16:27:22
bnxt_en/re: Use FW defined resource limit for RoCE
Check FW flags for status of Resource Limits. If bit
FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED
is set, that means FW set the resource limit for L2 and RoCE.
We'll then do the following:

L2 driver would allocate context memory based on what FW reported.
RoCE driver uses FW reported values without capping. These values
are the total FW reported value minus L2 and other components shares.

For example:

FW reported max_qps = 137217 in L2 query, this includes:
5120 for L2
1025 for QP1
131072 for RoCE
L2 will allocate backing store memory for the total.
In RoCE query, we'll get max_qp = 131072 and use it
without further capping.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54522
MFC after: 3 days
913e454f306124c83797bfa71681dcdf806532c6 Sreekanth Reddy 2026-01-23 16:32:51
bnxt_re: Fix active_speed value when two ports are aggregated
Currently driver is not considering the active_lanes while
displaying the speed & width of port and hence it showing
invalid active_speed and active_width values in the ibv_devinfo
command output when two ports are aggregated at hardware level.
Fixed the driver to consider the active_lanes while determining
the active_speed & active_width values.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54523
MFC after: 3 days
b7d6334df61a559e98191f90fd5e611e0d077def Sreekanth Reddy 2026-01-23 16:36:02
bnxt_re: Add support to display board_id in ibv_devinfo output
Added support to display board_id in ibv_devinfo output.
ibv_devinfo util reads the board_id from below sysctl
attribute, so added this sysctl attribute.

sys.class.infiniband.bnxt_reX.board_id

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54524
MFC after: 3 days
3a9565c2a8e4f1b3da698bf6a8af5889dc4fefbd Sreekanth Reddy 2026-01-23 16:38:02
bnxt_re/libbnxtre: Add support for Variable WQE on BCM576xx controllers
Variable size WQE means that each send Work Queue Entry to
HW can use different WQE sizes as opposed to the static WQE
size on the current devices. Set variable WQE mode for BCM576xx
devices. Depth of the Queue will be a multiple of slot which
is 16 bytes. The number of slots should be a multiple of 256
as per the HW requirement.
Initialize the Software shadow queue to hold requests equal to
the number of slots.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54525
MFC after: 3 days
823f158a01330484f83f69c31d695035c607f8ee Sreekanth Reddy 2026-01-23 16:40:13
arm: Make init_proc0 static
This function is not used outside of machdep.c and is already static
on arm64 and riscv.

Reviewed by:    imp
Effort:         CHERI upstreaming
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54838
05609c5eff27ea7b382237bd2a937c01c1ceb59a John Baldwin 2026-01-27 18:30:23
powerpc: Fix alignment of initial PCB on kstack
Commit cc81c44dd806737f98b4fd4094674dd71c8749f3 aimed to consolidate
duplicated code between the Book-E and AIM backends.  For
cpu_thread_alloc cpu_thread_alloc and cpu_fork it used the AIM
functions which used a bogus alignment mask (~0x2f).  The Book-E
functions used a proper alignment mask (~0x3f).  The AIM functions
appear to have been busted since they were first imported in commit
919cb3362fded33aca682a6ac57777f8fff86e36.

To fix, use the Book-E mask which requests 64 byte alignment.
Probably this was harmless in practice since td_kstack is page aligned
and struct pcb is probably a multiple of 32 bytes in size, so the 0x10
bit should have been clear anyway.

Reviewed by:    fuz, jhibbits
Fixes:          https://cgit.freebsd.org/src/commit/?id=cc81c44dd806 ("Unify ABI-related bits of the Book-E and AIM...")
Effort:         CHERI upstreaming
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54839
9272b780626640ce9b9ac378fbdd2783aaa33625 John Baldwin 2026-01-27 18:30:46
sys: Use __is_aligned and __align_down for some kstack alignment operations
Reviewed by:  kib, jhibbits
Effort:         CHERI upstreaming
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54840
093fffa296d009de8cebf713a58ddbf876f05c5c John Baldwin 2026-01-27 18:31:23
ahc(4): Fix a warning on i386 compilation
Fixes:          https://cgit.freebsd.org/src/commit/?id=cd036e891a35 ("ahc_pci.c: If bus_dma...")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
a9f7074e858fd7c8e07c164fc365afc0d0077735 Olivier Certner 2026-01-28 09:31:21
acpi: Use only AcpiGetSleepTypeData() to determine Sx support
Previously, we would first call AcpiEvaluateObject() to execute \_Sx
before calling AcpiGetSleepTypeData().  This was unnecessary, as
AcpiGetSleepTypeData() performs the same call itself.  While doing so,
the latter function logs any other error than AE_NOT_FOUND (which
indicates that a particular sleep state is not supported), which most
probably is an added benefit of this change.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54624
526c09a489295c96662d6c3d428f69672968ab80 Olivier Certner 2026-01-07 13:34:44
acpi: Use AcpiGbl_FACS even on ACPI_REDUCED_HARDWARE
This has been possible since ACPICA 20240827, and is actually
a requirement to get out of S3 on ACPI_REDUCED_HARDWARE (that said, we
don't implement S3 on arm64 yet).

Relevant ACPICA commit:
https://github.com/acpica/acpica/commit/79cd933e7b370e8d3fb490bf36ca5d111a12f96a.

Reviewed by:    obiwac
MFC after:      2 weeks
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54625
0cca6277499febef57149e8999ecd1a42ef1dfd3 Olivier Certner 2026-01-09 09:28:18
vtnet: remove M_HASHTYPE when there is only one pair of rx/tx queue
Summary:
Doing so will let the upper layer know how to deal with software hash,
with benefits like inp_flowid can be set and m_pkthdr.flowid can be set
in output path.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D54929
20285cad7a55ecd0020f51f3daee74db8b1ea5a0 Cheng Cui 2026-01-28 17:27:34
arm, riscv: add a preprocessor symbol indicating missed support of ifunc
in kernel.

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
03d61fe9785793cce9324fd4e6019562586760fa Konstantin Belousov 2026-01-23 21:33:07
amd64/machdep.c: remove extra empty line
Reviewed by:  olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
23266bc9928f16fef292f6ab31d7cd8b7ad2ccdb Konstantin Belousov 2026-01-22 04:39:54
cpu_switch(): unconditionally wait on the blocked mutex transient
It is nop for 4BSD.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
377c053a43f347588ce6800627adb634f87f8cf9 Konstantin Belousov 2026-01-22 12:57:24
x86/cpu_machdep.c: unconditionally fence
For !SCHED_ULE, even if the fence is not needed, it is harmless.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
1c4e16f6db81254376f4919aede03267fe572aea Konstantin Belousov 2026-01-22 13:27:00
powerpc: explicitly cast the timebase printfs
This is causing compilation issues on powerpc:powerpc GENERIC.
03e4cc9fdeb2a6445f13cd41b471927a0f722fff Adrian Chadd 2026-01-30 06:36:33
dpaa2: add support for several interface counters
Add support for IFCOUNTER_IPACKETS, IFCOUNTER_OPACKETS,
IFCOUNTER_OBYTES, IFCOUNTER_OMCASTS, IFCOUNTER_OERRORS, and
IFCOUNTER_OQDROPS.
This allows tools like systat to report the incoming and outgoing
bandwidth.

Reviewed by:            dsl, Timo Völker
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D54893
33596d92555e5b1632fca14eb9af295e4b8f751c Michael Tuexen 2026-01-30 09:58:57
arm64: Fix kernel panic in get_arm64_sve during core dump
The coredump logic calls get_arm64_sve twice: once to get the note size,
and once to get the data. The note size calculation depended on the
volatile `PCB_FP_SVEVALID` flag. If this flag was cleared between the
two calls (e.g., due to a context switch clearing the flag to comply
with the ABI), the second call would expect a smaller buffer size than
the first, triggering a KASSERT panic ("invalid size").

Fix this by ensuring the SVE state is saved to the PCB before we decide
whether to use SVE or VFP.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292195
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D54532
93d3ac1daa0ef3ac54ffcd5cc64a14638d04bd60 Andy Carrel 2026-01-05 07:50:27
ure: improve checksum offloading
This patch fixes three issues:
(1) Initially, set the hwassist flags correctly when enabling
    transmit checksum offload for TCP/IPv6 and UDP/IPv6.
(2) Keep the hwassist flags in sync with the capabilities when
    changing txcsum.
(3) Keep the hwasssit flags in sync with the capabilities when
    changing txcsum6.
Without this patch, transmit checksum offloading for TCP/IPv6 and
UDP/IPv6 is never used and transmit checksum offloading for IPv4,
TCP/IPv4 and UDP/IPv4 is always used, even if disabled via
ifconfig ue? -txcsum.

Reviewed by:            Timo Völker
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D54974
7b6e84c9ac5668134ab2d075019ef0b827d90c84 Michael Tuexen 2026-01-31 10:42:10
ice(4): Handle allmulti flag in ice_if_promisc_set function
In the ice_if_promisc_set function, the driver currently disables the
IFF_ALLMULTI flag, thereby preventing the activation of multicast mode.
To address this issue, implement appropriate handling to ensure the
flag is managed correctly.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>

Tested by:      Gowthamkumar K S <gowtham.kumar.ks@intel.com>
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54186
98bdf63f6e94be42a1787de73608de15bcb3419a Yogesh Bhosale 2026-02-01 17:27:36
ig4: Add support for Lunar Lake-M I2C
this patch adds PCI IDs to the ig4(4) driver:
- Lunar Lake-M (0xa878, 0xa879, 0xa87a, 0xa87b)
These controllers use the Tiger Lake hardware revision of the I2C IP.
Adding these IDs enables support for peripherals connected to the I2C Bus.
Tested on: Intel Lunar Lake (LENOVO_MT_21QX_BU_Think_FM_ThinkPad T14s Gen 6)

Signed-off-by: Defenso-EBO <etienne.bonnand@defenso.fr>

MFC after: 2 weeks

Sponsored by: Defenso

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1995
851dffef532ad9611fcaf02318744c8de9f397b0 Defenso-EBO 2026-01-29 09:47:13
hwpmc_amd: Add support for additional counters.
Rather than provide a static table of counters, this change computes the
number of counters that are available by checking several CPUID leafs
and falling back to defaults on older processors.  The limits are set to
support the maximum number of counters of each type.

Sponsored by: Netflix
Reviewed by: imp, mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/1983
37bba2ad92d8fa81d70f7a8243b2f42981f44454 Ali Mashtizadeh 2026-01-23 05:34:44
e1000: Fix setting the promiscuous mode
The variable reg_rctl stores the value read from reg E1000_RCTL. It
may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control
VLAN hardware filter feature. The promiscuous mode implies all tagged
or untagged packets should be accepted, so the VLAN hardware filter
feature should be disabled when enabling the promiscuous mode.
Calling em_if_vlan_filter_disable() did the task, but later writing
the value of reg_rctl back to the reg E1000_RCTL may restore the
feature.

Move the calling of em_if_vlan_filter_disable() after writing the reg
to fix that.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292759
Reviewed by:    kbowling
Tested by:      vova@zote.me
Fixes:          https://cgit.freebsd.org/src/commit/?id=2796f7cab107 e1000: Fix up HW vlan ops
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54973
e63ee5fedb8dab51f1bd6d24cc650b68d9663db5 Zhenlei Huang 2026-02-02 12:26:31
smartpqi: Update to vendor version 14.4690.0.2008 - 15.2.0.2008
Update to versions:
FreeBSD14 14.4690.2008
FreeBSD15 15.2.0.2008

Included in this update are:
 - Support for new controllers
 - Add code that utilizes the new BIG_IOCTL_Command_struct and allows
   the I/O buffer size for a single passthrough ioctl to be stored as a
   32 bit integer instead of the original 16 bit integer.
 - Update occurrences of Microsemi to Microchip
 - Some format changes including converting comments from C++ to C
   style, remove instances of /* $FreeBSD$ */, and updating copyright
   dates.

Update to versions:
FreeBSD14 14.4690.2008
FreeBSD15 15.2.0.2008

Included in this update are:

- Support for new controllers

_ Add code that utilizes the new BIG_IOCTL_Command_struct and allows
  the I/O buffer size for a single passthrough ioctl to be stored as
  a 32 bit integer instead of the original 16 bit integer.

- Update occurrences of Microsemi to Microchip

- Some format changes including converting comments from C++ to C
  style, remove instances of /* $FreeBSD$ */, and updating copyright
  dates.

Reviewed by:    imp
Approved by:    imp
MFC after:      1 week

Sponsored by: Microchip Technology Inc.

Differential Revision:  https://reviews.freebsd.org/D54787
7f54c65abc67f50363bbd2a68a980d23e69c9ef0 John Hall 2026-02-02 15:44:23
i386: Fix build and remove empty unused macro
When inlining the macro, reg was not substituted with the %ecx argument
previously passed in. One of the definitions was also left behind as an
empty macro.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292883
Fixes:          https://cgit.freebsd.org/src/commit/?id=377c053a43f3 ("cpu_switch(): unconditionally wait on the blocked mutex transient")
MFC after:      1 week
9e0fe126714cc0b2045bec16fe8d06dbcd663144 Jessica Clarke 2026-02-02 17:43:50
sym(4): Map HCB memory as uncacheable also on x86
As part of making the chip-specific mix and match of different accesses
(DMA/bus space) work as desired, the intent is to map the HCB memory as
uncacheable. Prior to VM_MEMATTR_*, the !x86 way of indicating this to
bus_dmamem_alloc(9) was BUS_DMA_COHERENT. Then later on in 2db99100a4,
BUS_DMA_NOCACHE was hooked up to VM_MEMATTR_UNCACHEABLE for x86. As it
turns out, still as of today bus_dmamem_alloc(9) differs in this regard
across architectures. On arm, it still supports BUS_DMA_COHERENT only
for requesting uncacheable DMA and x86 still uses BUS_DMA_NOCACHE only.
On arm64 and riscv, BUS_DMA_COHERENT seems to effectively be an alias
for BUS_DMA_NOCACHE.

Thus, allocate the HCB memory with BUS_DMA_COHERENT | BUS_DMA_NOCACHE,
so we get uncacheable memory on all architectures including x86 and so
loads and stores from/to HCB won't get reordered. However, even on x86
we still need to use at least compiler barriers to achieve the desired
program order.

This change should also fix panics due to out-of-sync data seen with
FreeBSD VMs on top of OpenStack and HBAs of type lsiLogic as a result
of loads and stores getting reordered. [1]

While at it:
- Nuke the unused SYM_DRIVER_NAME macro.
- Remove unused/redundant HCB members and correct a comment typo.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270816 [https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=1]
MFC after:      3 days
b941d1c64e58708c93621cc07ed1c8e5e709cd48 Marius Strobl 2026-02-02 21:30:42
acpi: Post/pre device suspend/resume eventhandlers
These eventhandlers are called after suspending the device tree and
before resuming it. This is useful for PMC (power management controller)
drivers.

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48735
4a71fc3b5cebdf3e6227470d50cf559bab28f26b Aymeric Wibo 2026-02-02 23:46:44
acpi_spmc: Register SPMC suspend/resume routines
SPMC suspend runs after the device tree is suspended using the
acpi_post_dev_suspend eventhandler, and SPMC resume runs before the
device tree is resumed using the acpi_pre_dev_suspend eventhandler.

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48735
fedc9746bd37340a06dfcafea28904cf401127cf Aymeric Wibo 2026-02-02 23:49:23
acpi: add Darwin OSI quirk for Apple Mac hardware
Mac firmware hides the Intel integrated GPU (iGPU) on dual GPU x86
systems, i.e., with AMD/NVIDIA dGPUs, when the Darwin OSI is not
installed via ACPI.

Prior to this change, FreeBSD always used the dGPU. This is fine in
practice, but consumed more power than when the iGPU is used,
resulting in reduced battery life.

Linux handles this in `drivers/acpi/osi.c` by detecting Apple
hardware via DMI, disabling all Windows OSI strings, and
by explicitly installing the Darwin OSI ACPI handler. This change
applies equivalent logic to the acpi(4) driver on FreeBSD.

This feature can be enabled/disabled using the
`hw.acpi.apple_darwin_osi` tunable. Setting this tunable to `0`
restores the previous behavior by explicitly disabling the added
support.

Reviewed by:    obiwac, ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D54762
052a791b00555805f19ccc38a04d42d48b54104b Abdelkader Boudih 2026-02-03 01:43:00
uart: fix sleeping while holding mutex in uart_tty_detach()
Move swi_remove() call before acquiring the tty lock. swi_remove() calls
intr_event_remove_handler() which may sleep via msleep(), causing a lock
order violation when called with the tty mutex held.

The software interrupt handler removal operates on the interrupt event
structure independently and does not require the tty lock. This matches
the pattern used in other drivers such as tcp_hpts.c where swi_remove()
is called without holding other locks.

Reviewed by:    imp, kevans
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54953
ed3a2469a71e0ef48cf8e636c35e64a011756da3 Abdelkader Boudih 2026-02-03 03:21:43
powerpc/pmap: Mark more CPUs as lockless TLBIE
Add POWER10 and POWER11 to the list of lockless TLBIE capable CPUs.
According to Linux, anything POWER5 and later should be able to do this,
but that hasn't been tested with FreeBSD.  POWER10 and POWER11, being
derived after the POWER9, implicitly have this capability per the ISA
spec.

MFC after:      1 week
7f885581d5bb3eff191661f321d3a097acb0f39d Justin Hibbits 2026-02-03 02:50:15
Commit group #14: powerpc/pmap/oea64: Make PV_LOCK superpage sized
powerpc/pmap/oea64: Make PV_LOCK superpage sized

HPT superpages are 16MB, not 2MB.  Taking 8 locks to lock a super page
almost defeats the purpose of using the super page.  Expanding the
PV_LOCK scope to cover 16MB (24 bit shift) reduces this to a single
lock.

MFC after:      3 weeks
1bc75d77e9d45d4ccfe2f146b37c08f41e49a082 Justin Hibbits 2026-02-03 03:48:16

powerpc/pmap: Use a constant for HPT superpage shift

There are no plans to allow multiple sizes of HPT superpages, so just use a
constant for it.

MFC after:      3 weeks
Fixes:          https://cgit.freebsd.org/src/commit/?id=1bc75d77e9 ("powerpc/pmap/oea64: Make PV_LOCK superpage sized")
93450913086e7f0478b609367d5f1d4c740cb941 Justin Hibbits 2026-02-03 15:11:19
tpm: crb: add support for the Pluton startmethod
The Pluton startmethod uses a simple doorbell mechanism to wakeup the
TPM unit after we've issued various forms of state change, with the
registers to use specified in the startmethod-specific segment of the
TPM2 table (up to 12 bytes after the StartMethod).

At the very least, this is the kind of TPM in use by my AMD Zen 4-based
Minisforum machine.

Differential Revision:  https://reviews.freebsd.org/D53683
e6fa918c4a3ebeb4bcae7614dbb281bda35e06e1 Kyle Evans 2026-02-03 04:48:22
Commit group #15: x86
x86: x86_msr_op(): Move setting mode up, delineate logical blocks

No functional changes (intended).

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54996
7acd7ac6385c783699a64216198d7f2e244cc3b4 Olivier Certner 2026-01-22 14:22:01

x86: x86_msr_op(): Simplify assertions

Simplify them by moving them into more natural places, i.e., default
cases of 'switch' statements.

No functional change (intended).

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54996
a1a8bcdfde2e616cffeb4bf4e1968ba55cf409e9 Olivier Certner 2026-01-22 14:37:00

x86: x86_msr_op(): MSR_OP_LOCAL: Disable interrupts on atomic ops

On MSR_OP_LOCAL and non-naturally-atomic operations (MSR_OP_ANDNOT and
MSR_OP_OR), there is no guarantee that we are not interrupted between
reading and writing the MSR, and that interruption could actually
perform some operation on that MSR, which would be lost.

Prevent that problem by temporarily disabling interrupts around MSR
manipulation.

Reviewed by:    kib
Discussed with: markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54996
e5f8cbb86d58f25b5ff168506b78d09dca266fb6 Olivier Certner 2026-01-23 20:52:46
hwpstate_amd(4): Fix BITS_WITH_VALUE()/SET_BITS_VALUE() to obey the mask
While here, rename an argument of BITS_VALUE() to be consistent with the
other macros.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54997
4b0e09a918fbcdb3938ecb8e0efc3313bd3b2308 Olivier Certner 2026-01-29 09:00:02
hwpstate_amd(4): Rename CPPC register macros
To be closer to AMD's official terminology, except for the "Lowest
Non-Linear Performance" field which we label as 'EFFICIENT_PERF' closer
to Intel's ("Most Efficient Performance"), and to clear possible
confusion.

No functional change (intended).

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54998
9ae367d11de8abbdf53884836c9ba30908c5c8db Olivier Certner 2026-01-29 09:08:47
libpmc: Fix the L3 counters for AMD Zen 1-4
On AMD processors libpmc was using the topic field (based on filename) to
determine the counter's subclass.  Unfortunately, the JSON definitions for
AMD Zen 1-4 have the L3 counters in files shared with other counters.

This change has libpmc to use the pmu field (which is derived from the Unit
field in JSON) to determine the correct counter subclass.

Reviewed by:    mhorne
MFC after:      2 weeks
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1984
c215eef345501ce7dda374909b3195d9d69a4e9f Ali Mashtizadeh 2026-01-23 05:34:13
amd64: parse_memmap(): Move comment about size at proper place
While here, declare 'size' only in the relevant block.

No functional change (intended).

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
53bb02015fce72c79498842b898faefc2da3b0fb Olivier Certner 2026-01-30 17:33:12
acpi: Move sysctl tree set up at end of initialization
Setting up the sysctl tree later:
1. Fixes not de-registering sysctl knobs on failure to attach.
2. Avoids having inconsistent knob values exposed during a brief moment.

Reviewed by:    imp, obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54926
7f031c9f6b9ff8af7c901ff2645124a93b9de284 Olivier Certner 2026-01-28 10:07:42
acpi: 'hw.acpi.s4bios' sysctl: Change type to bool, expand description
Another boolean, indicating hardware support, will be introduced in next commit.

Thanks to the previous commit modifying sysctl_handle_bool(), this
change is backwards-compatible with old programs using an integer in and
out of sysctl(3).

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54626
e401e6d3fc91679b16c5cfa4c473dcb8fcadacfa Olivier Certner 2026-01-09 09:53:39
virtio_p9fs: Use VIRTIO_SIMPLE_PNPINFO
This allows us to also use the common VIRTIO_SIMPLE_PROBE and to have
devmatch load the driver when detected.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54684
2f3f5055e7f69567f7aaca2f5b77655df34c4bb0 Andrew Turner 2026-02-03 17:13:35
arm64: Add the Fine-Grained Trap registers
Sponsored by: Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54685
4f82ce5191d550b875f7f760c83e05167728fe69 Andrew Turner 2026-02-03 17:14:03
arm64/vmm: Add HYP_FEAT_FGT{,2}
Add the macros and detection for Fine-grained traps (FEAT_FGT and
FEAT_FGT2).

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54686
095a7871f4320e7667a644e6e34a27e1f526b053 Andrew Turner 2026-02-03 17:14:26
arm64/vmm: Set and use the fine-grained traps
Set the Fine-grained trap registers to trap any features we don't
support. These are expected to be more useful when we support nested
virtualisation, so for now just the base features and GICv3 are not
trapped.

As nested virtualisation will require VHE we only set the fine-grained
trap registers when VHE is used.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54687
a4f0e93c514280bfd0ff3897e5171ec7bbe4796b Andrew Turner 2026-02-03 17:14:44
vmm: Fix a resource leak in an error path
vmmdev_create() increments the VM count as its last step and calls
vmmdev_destroy() if it fails.  However, vmmdev_destroy() unconditionally
decrements the count.

Correct this bug by reordering operations.

Fixes:          https://cgit.freebsd.org/src/commit/?id=1092ec8b3375 ("kern: Introduce RLIMIT_VMM")
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D55068
8cfa6ddcee021adaf9515286e25dd0c961adf8a4 Mark Johnston 2026-02-03 19:09:28
vmm: Remove an unneeded NULL pointer check
sc->vm is unconditionally dereferenced earlier in this function.  No
functional change intended.

Reviewed by:    bnovkov
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55069
2d0564b9daf49c46e0e4ef6c7d162c73fc8b35d7 Mark Johnston 2026-02-03 19:09:44
if_rge: sync with up to date OpenBSD code
e574c2d36cbcacf2556088879be336775e80154b
Add support for RTL8125D revision 0x6890000

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D54922
MFC after: 2 weeks
3f3cc6fd69e4e3abf6b48c242e93b650c00451c1 Brad Smith 2026-02-04 06:25:13
sdt: Enable on 32-bit powerpc and powerpc64le
Reviewed by:  jhibbits, adrian
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54814
6e32e8d7d16148e9bad1e3544363f318582f4c13 Mark Johnston 2026-02-04 14:48:34
pmc: Import Intel Granite Rapids events
Reviewed by:  mhorne
Sponsored by:   Klara, Inc.
Obtained from:  Intel perfmon (JSON event definitions)
Differential Revision:  https://reviews.freebsd.org/D55081
MFC after:      2 days
a3ff85e11925ba1e25465c8ba633356f405f9214 Bojan Novković 2026-02-02 10:13:12
ufshci: Remove UIC error during initialization
This patch removes the UIC error caused by QEMU not supporting certain
UIC command. Additionally, it removes the unused unipro_version.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D54513
0f515c0a97489d8d35aca7f5e28c28b22f217dc9 Jaeyoon Choi 2026-02-04 23:53:01
Commit group #16: Make message added for Darwin OSI quirk more terse
Make message added for Darwin OSI quirk more terse

The verbose message was way too verbose. Make it terse.

MFC after:      1 week
MFC with:       052a791b00 ("acpi: add Darwin OSI quirk for Apple Mac hardware")
Requested by:   kib
9c666de5b339d3c8f9bf3963691e4310e7d159cb Enji Cooper 2026-02-05 02:57:22

Unbreak the build

Add the missing comma in the `device_printf` statement.

MFC after:      1 week
MFC with:       9c666de5b
Fixes:  https://cgit.freebsd.org/src/commit/?id=9c666de5b ("Make message added for Darwin OSI quirk more terse")
cc702c78f70f972cf2f8ea008752d96df1989988 Enji Cooper 2026-02-05 04:38:31
tpm20: fix suspend/resume and entropy harvesting
There were a few problem here:
  - TPM2_Shutdown results in a response that we need to either process
    or ignore, otherwise any tpm20_write or tpm20_harvest call will
    trivially hang on an `sc->pending_data_length != 0`
  - We should have a matching TPM2_Startup upon resume to restore any
    state that should have persisted
  - We must drain the harvest task before we suspend to avoid problems
    there

This commit is sufficient to avoid breaking suspend/resume.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291067
Fixes:  https://cgit.freebsd.org/src/commit/?id=a2d5ed9442bb ("Introduce driver for TPM 2.0 in CRB and [...]")
Fixes:  https://cgit.freebsd.org/src/commit/?id=4ee7d3b0118c ("Allow using TPM as entropy source.")
Co-authored-by: markj (D53835)
Tested by:      garga
Differential Revision:  https://reviews.freebsd.org/D55074
38a4995eb52db21116f8b37ed942e66a8c2f050f Kyle Evans 2026-02-05 03:35:01
powerpc64/pmap: No need to use r0 anymore in tlbie
The only use of `tlbie %rN, 0` is now explicit and covered in the block
above.  Since there's no need for an explicit `tlbie %rN, 0` now, drop
this convoluted piece and let the compiler decide.

While here, a trivial optimization of the old-style tlbie block, by
clearing tlbie_lock and returning, instead of going to the end which
checks again if the lock is needed.  Since it's already known to be
needed, there's no need to check again.
c1a339b4a313ead4122c630ab9ac8f9c54c3e0a2 Justin Hibbits 2026-02-05 03:28:16
arm64: Attach the vgic even if there is no ITS
If there is no ITS device so no memory resources the gicv3 driver would
exit attaching early. This caused the vgic driver to also not be
attached, even if it could.

Reported by:    novel@
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54791
c12d6cc326b70326d776324067bdf07e4fa328aa Andrew Turner 2026-01-19 14:24:14
bnxt: set hardware checksum only if required
The test condition in the bnxt driver for TCP/UDP transmit hardware checksum
offload is invalid: only the TCP / UDP csum bits should be tested

Only the relevant ipi_csum_flags bits are now tested

Reviewed by: tuexen
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D53941
2e94e1631ef517f5495e25d7fa22c95f7dca0dc6 acazuc 2025-11-27 10:29:34
acpi: Fix trying to enter NONE state
In acpi_system_eventhandler_sleep(), I forgot to update
ACPI_STATE_UNKNOWN when switching to new sleep types.

Reviewed by:    olce
Approved by:    olce
Fixes:  https://cgit.freebsd.org/src/commit/?id=97d152698f48 ("acpi: Use sleep types defined in sys/power.h")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55119
d15d6bf83de97bd1742621bc10fe2feeb503cfdd Aymeric Wibo 2026-02-05 00:49:26
powerpc64: Fix disappearing low memory on radix MMU systems (POWER9)
The FreeBSD radix implementation piggybacks on the physical memory
allocation function from the HPT implementation, but did not share
the same state information for number of physical memory ranges.
This led to a situation where the HPT physical memory allocator
would attempt to shift the physical memory ranges in the shared
range table, but would use the wrong number of entries, thus
overwriting the large segment of low memory that should have been
available for e.g. 32-bit DMA.

Incorrect physical memory map:

real memory  = 33997058048 (32422 MB)
available KVA = 34359619583 (32767 MB)
Physical memory chunk(s):
0x0000000000003000 - 0x0000000000002fff, 0 bytes (0 pages)
0x000000000000e000 - 0x000000000000ffff, 8192 bytes (2 pages)
0x0000000000094000 - 0x0000000000ffffff, 16171008 bytes (3948 pages)
0x0000000100000000 - 0x00000007a2042fff, 28487987200 bytes (6955075 pages)
0x00000007d0006000 - 0x00000007fc72dfff, 745701376 bytes (182056 pages)
0x00000007fdc00000 - 0x00000007ff79ffff, 28966912 bytes (7072 pages)
0x00000007ff7d1000 - 0x00000007ff7effff, 126976 bytes (31 pages)
avail memory = 29190103040 (27837 MB)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs

Correct physical memory map:

real memory  = 33997058048 (32422 MB)
available KVA = 34359619583 (32767 MB)
Physical memory chunk(s):
0x0000000000003000 - 0x0000000000002fff, 0 bytes (0 pages)
0x000000000000e000 - 0x000000000000ffff, 8192 bytes (2 pages)
0x0000000000094000 - 0x0000000000ffffff, 16171008 bytes (3948 pages)
0x0000000002000000 - 0x000000000284ffff, 8716288 bytes (2128 pages)
0x0000000004627000 - 0x000000002fffffff, 731746304 bytes (178649 pages)
0x0000000034040000 - 0x00000000efffffff, 3153854464 bytes (769984 pages)
0x0000000100000000 - 0x00000007982ecfff, 28323008512 bytes (6914797 pages)
0x00000007cc20a000 - 0x00000007fc72dfff, 810696704 bytes (197924 pages)
0x00000007fdc00000 - 0x00000007ff79ffff, 28966912 bytes (7072 pages)
0x00000007ff7d1000 - 0x00000007ff7effff, 126976 bytes (31 pages)
avail memory = 32984436736 (31456 MB)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Sponsored-by: Raptor Computing Systems, LLC
1364e7d0921bfd79738dae80748d836730e39056 Timothy Pearson 2026-02-04 05:16:39
cxgbe(4): sysctl to disable/enable the TCB cache
The TCB cache can be enabled/disabled at any time on the T7 and this
commit adds a sysctl to do that.  This is for debug only.

 # sysctl dev.chnex.0.misc.tcb_cache=0
 # sysctl dev.chnex.0.misc.tcb_cache=1

MFC after:      1 week
Sponsored by:   Chelsio Communications
9352d2f6dd55afcf0ac24d2806da7c6febf19589 Navdeep Parhar 2026-02-05 19:52:51
em: remove M_HASHTYPE when RSS is not enabled
Summary:
Since "73fe85e486d2 tcp: store flowid info in syncache", inp_flowid can be set
if the incoming packet is not M_HASHTYPE_NONE. But this can introduce dummy
and duplicated flowid when a virtual interface set M_HASHTYPE_OPAQUE. This
change will let the upper layer know how to deal with software hash, with
benefits like inp_flowid can be set correctly and m_pkthdr.flowid can be set
correctly in output path.

This fix is similar to "20285cad7a55"

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55137
efcc0423d80e4048e11e997abc46bd0343537e1b Cheng Cui 2026-02-05 21:12:15
acpi: New R/O 'hw.acpi.s4bios_supported' sysctl, gate S4BIOS with it
This new sysctl knob indicates whether the ACPI implementation supports
S4BIOS (FACS present with bit S4BIOS_F set, as per the standard).

If S4BIOS is not supported, do not allow 'hw.acpi.s4bios' to be set to
true.

This is also in preparation of probably switching the default for
'hw.acpi.s4bios' to false once OSPM-initiated S4 support is ready, in
which case administrators need some way to determine whether
firmware-initiated S4 support is possible.  For now, we keep the default
of setting 'hw.acpi.s4bios' to true (1) when S4BIOS is supported.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54627
d2aa0a4dace1d0cf8d52614c25b6a8f5cf03fd32 Olivier Certner 2026-01-09 13:43:23
i386 minidump: Remove unused macros
No functional change (intended).

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
584c4e0abbfdbac355601491a695c7a8fd5d8ab3 Olivier Certner 2026-02-05 08:44:28
spibus: Don't leak KVA when freeing a mmap region
Effort:               CHERI upstreaming
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54837
06fd19b5349a1ff27ef338619fdade596986fc2f John Baldwin 2026-02-06 15:30:26
amd64/vmm: Lock global PCI passthrough structures
There is a global list of ppt-claimed devices, accessed via several
vmm ioctls.  The ioctls are locked by per-VM locks, but this isn't
sufficient to prevent multiple VMs from trying to bind a given device.

Add a sleepable lock and use that to synchronize all access to ppt
devices.

Reviewed by:    corvink, jhb
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55065
36b855f1892575cbfe1cd5455b989bfc8ae07502 Mark Johnston 2026-02-06 15:29:22
thunderbolt: Fix tb_pcib device matching to check PCI class
Light Ridge and earlier Thunderbolt controllers reuse the same device ID
(0x1513) for both the NHI (class 0x088000) and PCI bridges (class
0x060400).

Without checking the PCI class, tb_pcib would incorrectly match NHI
devices, causing a panic when trying to attach bridge code to non-bridge
hardware.

Add PCI class check to tb_pcib_find_ident() to only match actual PCI-PCI
bridges (PCIC_BRIDGE/PCIS_BRIDGE_PCI).

Reviewed by:    obiwac, jhb
Approved by:    obiwac, jhb
Fixes:  https://cgit.freebsd.org/src/commit/?id=2ed9833791f2 (thunderbolt: Import USB4 code)
Differential Revision:  https://reviews.freebsd.org/D55102
067ad8b31bf68b6dcf1ad571746349ed88d63d00 Abdelkader Boudih 2026-02-06 16:12:56
Commit group #17: hwpstate{_amd,intel}(4): Move common knobs to a separate file
sys/sysctl.h: Make it self-contained when included from the kernel

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
1a446f765d9cb34e8137ffa6dbb71ce551560cc1 Olivier Certner 2026-02-06 15:02:39

hwpstate{_amd,intel}(4): Move common knobs to a separate file

Reason for doing this right now is to resolve the conflict on
'machdep.hwpstate_pkg_ctrl' between the Intel and AMD drivers, even
though I expect to remove it for hwpstate_amd(4) at some point.

More generally, this is going to be useful for some future code
factorization.  Also, the 'debug.hwpstate_verbose' knob was moved there,
as we'll likely want to use it for the Intel driver as well (which is
currently not the case).

Note for MFC: Will be partial, since `hwpstate_amd(4)` does not support
CPPC in stable/15 nor stable/14.

Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate driver on AMD")
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54528
8043295875083b57a6b7b2dc6826fde4cf4e1ba1 Olivier Certner 2026-02-06 10:58:07

sys/sysctl.h: Add missing <sys/kassert.h> include

Hopefully, 'sys/sysctl.h' is really self-contained now.

This fixes the GENERIC-NODEBUG compilation error in 'hwpstate_common.c'
after commit 804329587508 (see below).

Fixes:          https://cgit.freebsd.org/src/commit/?id=1a446f765d9c ("sys/sysctl.h: Make it self-contained when included from the kernel")
Fixes:          https://cgit.freebsd.org/src/commit/?id=804329587508 ("hwpstate{_amd,intel}(4): Move common knobs to a separate file")
Sponsored by:   The FreeBSD Foundation
bfd50a32ff26067552220c6f08e6025be3603962 Olivier Certner 2026-02-06 20:46:48
Commit group #18: hwpstate_amd(4)
hwpstate_amd(4): Factor out printing CPPC registers, fix CPPC_REQUEST's

Factor out these printing, so they can be called from other places than
just the register dump handler.  This also makes surrounding code
clearer.

Fix inverted printing of minimum and maximum performance.

For better diagnostic, print the full raw content of each register
before printing the value of fields we know about.

As fields are printed in decimal, remove 0-padding, which could give the
impression that the numbers are printed in octal or hexadecimal.

While here, remove superfluous blank lines when printing (we use TABs
for the different registers' fields).

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54999
73c9d843ffb9d816737aa2cef7551923e68e6eaf Olivier Certner 2026-01-29 10:16:27

hwpstate_amd(4): Rename register dump sysctl handler

While here, rename the callback function and structure to a more
immediately informative name.

While here, remove a superfluous cast and rename the variable containing
the callback data to just 'data' instead of 'req' which can be confusing
(because of CPPC_REQUEST but also the fact that 'req' is a parameter of
sysctl handlers).

No functional change intended.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55000
e938d57e0a8852e956a16dd4fc041047fd1b2c35 Olivier Certner 2026-01-29 10:43:53

hwpstate_amd(4): Assert PSTATE_CPPC is on in corresponding sysctl handlers

No functional change intended.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55001
fa0512f7156d1851a7d498d42c32655e390399cf Olivier Certner 2026-01-29 10:48:55

hwpstate_amd(4): Rename EPP handler, convert to unsigned int

'val' is supposed to be the storage for a sysctl knob of an 'unsigned
int', so consistently don't specify its width.

While here, rename variables in the handler.  The new names feel
clearer, and the 'ret' => 'error' rename is to be more in line with our
tradition.

No functional change intended.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55002
461bac05a1454e8a1656cc35f1308cbd6b374f51 Olivier Certner 2026-01-29 14:06:08

hwpstate_amd(4): Register dump: Fine-grained error reporting

If some of the registers cannot be read, report that but continue trying
reading the others.  This also has the side benefit of simplifying code.

While here, use sbuf_new_for_sysctl(), and rename 'res' and 'ret', which
are to contain error values, to 'error'.

While here, remove the test on getting the per-cpu structure, as if it
is not present we would have already crashed on device attach.

While here, fix format for printing the CPU ID.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast (older version)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55005
8aac1e9b028e5bd2e249023687effd98739358a6 Olivier Certner 2026-01-29 16:23:54

hwpstate_amd(4): attach(): More diagnostic on CPPC enable

When the 'debug.hwpstate_verbose' tunable/sysctl knob is set, dump the
initial content of the CPPC_CAPABILITY_1 and CPPC_REQUEST registers.

If, after enabling CPPC, reading/writing some MSR fails during the attach
sequence, print a diagnostic.  However, once CPPC is enabled, we cannot
go back (disabling it is impossible), so we'll attach even if fiddling
with other MSRs failed.

While here, move diagnostic printing on attach out of the callback that
is executed on (potentially) another CPU and with interrupts disabled,
putting it into the attach routine itself.

While here, fix format for printing the CPU ID.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast (older version)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55006
bd58239d3653dab7cd3999cad222f695a49a7e3b Olivier Certner 2026-01-29 17:37:20

hwpstate_amd(4): Sane defaults for min/max perf on insane capabilities

If the CPPC_CAPABILITY_1 register stays at its reset value (0) even
after enabling CPPC, as observed in the field (see the referenced PR
below), use sane min/max performance limits as hinted by the ACPI spec,
i.e., all 0s for the minimum value and all 1s for the maximum one.

While here, let's cope upfront with some more insane situations, where
the minimum value would be greater than the maximum one, but also if
they would be equal which does not seem to make sense at all in the CPPC
frame (and, anyway, in this case, the actual minimum and maximum values
we program should have no effect at all).  That last case actually also
covers the one exposed in the previous paragraph.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55007
df7b4dcdb8ff32a735916b50a473424b543c1e5e Olivier Certner 2026-01-29 21:14:48

hwpstate_amd(4): Factor out setting the CPPC_REQUEST register

In preparation for creating other knobs to tweak values in this register
beyond just the EPP (Efficiency/Performance Preference).

While here, add a herald comment before the softc structure indicating
how we achieve atomicity when modifying the softc.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55008
6db204dc2de0f52e9a6842af29f026a8a2951e3c Olivier Certner 2026-01-27 11:30:48

hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values

We were using percents, for compatibility with hwpstate_intel(4), but
this looses granularity that might be important in some scenarios or
with specific CPU models.

For consistency, hwpstate_intel(4) should be changed accordingly, at the
expense of breaking compatibility.

For release notes: Introduction of hwpstate_amd(4) deserves a release
note, even if the original commit was not tagged.  Functionality
introduced by recent commits tagged with "Relnotes" should be mentioned
along that one.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55009
951788e3733e415ca4721c0a63454937dcb29b2c Olivier Certner 2026-01-27 11:44:29

hwpstate_amd(4): Add knobs to get/set all fields of CPPC_REQUEST

This will allow experimentations and finer-grained tuning to the full
extent allowed by the hardware, which is especially important given that
the spec leaves to hardware implementors an important leeway in
interpreting CPPC's numeric parameters, causing the same settings to
have different effects on different CPU models.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292615
Reviewed by:    aokblast (older version)
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55010
7689e68506a900de4ba79924d781f092bb9d0335 Olivier Certner 2026-01-27 12:39:40

hwpstate_amd(4): Consistency of cached CPPC_REQUEST value

If writing to the CPPC_REQUEST MSR fails, make sure we do not set the
softc's 'cppc.request' field to the intended new value.  Both
set_cppc_request_cb() and enable_cppc_cb() were changed to this effect.

In case enable_cppc_cb() could not read CPPC_REQUEST, mark that through
a new softc flag, HWPFL_CPPC_REQUEST_NOT_READ, so that we do not keep
and use a wrong value when the content of CPPC_REQUEST is read/written
through sysctl(9) knobs, but instead retry reading the MSR (this is the
purpose of the new get_cppc_request() sub-function).

When setting CPPC_REQUEST has failed, distinguish the case where it
could not be read at all from the case where it could not be written, by
respectively returning EIO and EOPNOTSUPP in these cases.  The previous
return value of EFAULT was confusing as sysctl(3) documents it as
happening if the passed arguments are invalid.

While here, add some herald comment before sysctl_cppc_dump_handler()
clarifying that the intent of this function is to always query the
hardware directly, bypassing any cached value in the softc.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55251
7f36d7a9505ab21f67ed806b18fbbe365043ed50 Olivier Certner 2026-02-09 16:21:57

hwpstate_amd(4): CPPC: Allow attaching even if CAPABILITY_1 cannot be read

If that MSR cannot be read, we fallback to defaults specified by the
ACPI specification, as we are already doing when the minimum and maximum
values in there look bogus.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55252
b69a396de211feb1dcfe6a7e95d1b23ae53f916a Olivier Certner 2026-02-09 17:19:51

hwpstate_amd(4): CPPC: Switch the default to maximum performance

Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55253
80d32a6b1d73e0c81303417fa280ac74ef1f417a Olivier Certner 2026-02-09 17:45:07
hwpstate_amd(4): Revamp the softc
As the new CPPC and old P-states modes are exclusive, put their
respective data in a union.

Rename the field containing the content of the CPPC_REQUEST register.
It it now to be accessed using 'cppc.request'.

Use an 'unsigned int' instead of 'uint32_t' for 'flags'.  This is an
internal field whose width could be changed at will.  We only have one
flag at the moment.

No functional change intended.

Reviewed by:    aokblast
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55004
7bc7692b940b0c2af0f4a89ae2ef6fbba0bc3381 Olivier Certner 2026-01-29 16:01:43
Commit group #19: qlnxe
qlnxe: Remove a pointless copy back from the link-layer address

On ifnet attaching, ether_ifattach() makes the link-layer address by
shadow copying the ha->primary_mac. Well, the link-layer address will
not be altered during attaching, thus it is pointless to copy it back.

No functional change intended.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54883
4ac3081b282800158df7abe93f307d76e1b5b808 Zhenlei Huang 2026-02-06 17:52:53

qlnxe: Avoid memcpy with same source and destination

In case the device is VF, qlnx_get_mac_addr() returns ha->primary_mac
hence it ends up memcpy with same source and destination. Refactor
slightly to avoid that.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54884
3aeeedc7e0dc231c16406ff64f4a08a716964c40 Zhenlei Huang 2026-02-06 17:52:53

qlnxe: Fix setting the unicast MAC filter of RX path

When an Ethernet interface is added to lagg(4) as a child interface, its
type, aka if_type, is changed from IFT_ETHER to IFT_IEEE8023ADLAG. Well
changing the link-layer address of the lagg(4) interface will be
propagated to all child interfaces, hence the drivers of child interfaces
shall not presume the type of the interface will not be changed.

Meanwhile, on initializing, an ifnet has been fully attached and it is
guaranteed to have non-null link-layer address so stop NULL checking for
it.

Reviewed by:    kbowling
Fixes:          https://cgit.freebsd.org/src/commit/?id=792226e53023 qlnxe: Allow MAC address override
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54885
f250852c9a0c1021c3be4b498e27cfc7b42a81db Zhenlei Huang 2026-02-06 17:52:53

qlnxe: Prevent potential concurrency between ioctls

The driver-managed status flags should be lock protected to be touched.
Also this can serialize ioctls those check the IFF_DRV_RUNNING status.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54886
0df8a998a9fe28af659cb401c537c6d785e55f81 Zhenlei Huang 2026-02-06 17:52:53

qlnxe: Avoid reinitializing the interface when it is already initialized

qlnx_init_locked() unconditionally uninitialize the interface thus is
actually reinitializing the interface. Well the init routine qlnx_init()
is to initialize the interface by net stack when assigned with the first
inet or inet6 address. The ioctl SIOCSIFADDR for the first inet6 address
is handled by ether_ioctl() thus the interface is reinitialized no matter
it was initialized or not.

Add a driver status check for that to avoid reinitializing. Further plan
is removing SIOCSIFADDR ioctl from the driver and let ether_ioctl() handle
it.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54887
c10e6bc0f0079e90cb484323ad71d437f1882422 Zhenlei Huang 2026-02-06 17:52:54

qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Since the change [1], the init routine qlnx_init() works as intended.
Let ether_ioctl() handle SIOCSIFADDR to simplify the code.

Combined with the change [1], this shall be a better fix for PR 287445.

[1] c10e6bc0f007 qlnxe: Avoid reinitializing the interface when it is already initialized

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287445
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54888
4012b63889e40bb877bc0e4c8da1792bce472c08 Zhenlei Huang 2026-02-06 17:52:54
Commit group #20: qlnxe
qlnxe: Refactor setting the promiscuous and allmulti mode

There are two entry points to set the promiscuous and allmulti mode.
One is ioctl, and another is the init routine. Given they share almost
the identical logic, refactor a little to make the code more clear.

While here, for the ioctl, translate the error to EINVAL to avoid
confusing the net stack.

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54890
45b1718fadae7d56051ba04ef9d7a175a602a226 Zhenlei Huang 2026-02-06 17:52:54

qlnxe: Allow tapping the TX packets

Currently only the packets in the RX path can be captured by tcpdump
as the ETHER_BPF_MTAP call in the TX path is missing. Add it so that
packets in both directions can be captured.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290973
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54891
968647502ec21464ad3aecc7577ff0e8dfd41693 Zhenlei Huang 2026-02-06 17:52:54

qlnxe: Overhaul setting the multicast MAC filters

When operating the multicast MAC filters, the current usage of
ECORE_FILTER_ADD and ECORE_FILTER_REMOVE are rather misleading.
ECORE_FILTER_ADD reads "adding new filter", but it actually removes
any existing filters and then addes a new one. ECORE_FILTER_REMOVE
reads "removing a filter", but it actually removes all filters.
Let's use ECORE_FILTER_REPLACE and ECORE_FILTER_FLUSH instead to
avoid confusion.

In the current implementation, only one MAC address is passed to
ecore_sp_eth_filter_mcast() and any previously installed filters are
removed, hence it breaks the multicast function. That can be observed
via either assigning new IPv6 addresses to the interface or putting
the interface as a member of lagg(4) interface with LACP aggregation
protocol. Fix that by calculating the multicast filter bins directly
from multicast MAC addresses and replace the filters every time
the bins changes.

Due to the nature of the multicast filter, which is hash based, a
full 1's multicast filter bin means all multicast packets are to be
accepted. Thus there's no need to make the vport into allmulti mode
when the number of multicast MAC addresses exceeds the limit
(ECORE_MAX_MC_ADDRS, 64).

Tested with a FastLinQ QL41212HLCU 25GbE adapter, both MFW_Version
8.35.23.0 and 8.59.16.0 are tested.

Note: Currently the VF port is set to promiscuous mode unconditionally,
and the setting of the multicast MAC filters for VF ports is
short-circuited, so the VF port functions as it did.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265857
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290973
Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54892
70256d2b86d95a678a63c65b157b9c635f1f4c6a Zhenlei Huang 2026-02-06 17:52:55
igb: remove M_HASHTYPE when RSS is not enabled
manually cherry-pick efcc0423d80e

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55143
21dd554d16971a9cce36bb48ebbf5219297995b4 Cheng Cui 2026-02-06 14:43:41
nvme: Use __diagused instead of __unused
Reviewed by:  imp
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
1c09ae2be059da0b945a2543ac7dd0bd5198d0e3 Dag-Erling Smørgrav 2026-02-05 16:09:30
chore: asmc: minor code cleanup
- Use symbolic names in Mac definitions in lieu of the unrolled values
  they represent.
- Delete trailing whitespace.
- Fix indentation.

No functional change intended.

MFC after:      1 week
a8f3c3b5d4d9dac1dafe4094fe35b30ffdf26178 Enji Cooper 2026-01-01 06:43:05
ifinfo: improve output of hwassist value
In addition to print the hexadecimal number hwassist, also print
the symbolic names of the corresponding CSUM_* flags.

Reviewed by:            tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55055
d84870d90bafe75eb87759df0ab41ff0214c866e Timo Völker 2026-02-08 20:02:58
ure: improve transmit checksum offloading
Apparently, the name of the variable l4off was correct. Providing the
offset to the TCP or UDP header allows the transmit checksum offload to
work for TCP/IPv4, TCP/IPv6, UDP/IPv4, and UDP/IPv6.

Reported by:            vishwin
Reviewed by:            vishwin
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55187
7266121ce985a1a895441357c20b0e9d56b4e5f5 Michael Tuexen 2026-02-08 20:11:18
x86: Note that trapframe is used by kernel debuggers
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D55189
2088e742013bb1b9ca237a79767362efe92d9da8 Minsoo Choo 2026-02-09 01:21:00
aw_rtc: Add H616 compat string
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54908
063244ff95a2fd62054725d59f3856645f539dea Tom Jones 2026-02-09 10:04:38
aw_mmc: Add H616 mmc and emmc config
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54909
998c46ac2afb99bb17d9399bb8e897e8d621d6d4 Tom Jones 2026-02-09 10:05:10
aw_cir: Add H616 compat string
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54910
5e51e670cc3bf670240a0d9b919b92f9bccb955e Tom Jones 2026-02-09 10:05:19
aw_rsb: Add H616 compat string
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54911
c5c183a97dc18951a90af79ee0e7e4a1f8662d06 Tom Jones 2026-02-09 10:05:26
aw_usbphy: Add H616 compat string and configuration
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54912
84bc16a587fe69eaf50b6b012c5781f99a14c449 Tom Jones 2026-02-09 10:05:41
aw_wdog: Add support for H616
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54913
ccb0e6e15f3dd00288d1823ffaf6920916ae457c Tom Jones 2026-02-09 10:05:46
a10_twsi: Add H616 compat string
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54914
20615f714b5095a212dba63b803ffbdb13f90d7a Tom Jones 2026-02-09 10:06:03
aw_sid: Add H616 configuration and compat string
Reviewed by:  manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54916
8923d1c9e25c5bc29d13edf8a55ae6b6b8bd9f6e Tom Jones 2026-02-09 10:06:37
aw_ccu: Add clocks for H616
Reviewed by:  manu, adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54927
245cdec79249957e318dac21f9208a9117a98f31 Tom Jones 2026-02-09 10:06:53
if_awg: Add H616 compat string
Reviewed by:  manu
Sposored by:    The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54907
f8a3876e90d0bd7250664ccce36b485a91f4c51c Tom Jones 2026-02-09 10:28:18
aw_mmc: Reset card
On H616 (and I think H6, but this isn't verified) we need to reset the
card to have a functioning device.

With this commit all my pending patches for H616 are in tree. We run
well on my test device (Orange Pi Zero3), however there is an
uninvestigated issue with ethernet and graphics are an open question.

Reviewed by:    manu, adrian
MFC After:      1 week
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55097
ec5d4664915f51ae62daec09fa4f9765c969adab Tom Jones 2026-02-09 15:48:24
sdhci_fdt_rockchip: Move ofw_bus_status_okay check
This fixes a warning from GCC:

sys/dev/sdhci/sdhci_fdt_rockchip.c: In function 'sdhci_fdt_rockchip_probe':
sys/dev/sdhci/sdhci_fdt_rockchip.c:120:14: error: statement will never be executed [-Werror=switch-unreachable]
  120 |         if (!ofw_bus_status_okay(dev))
      |              ^~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by:    bnovkov, imp, emaste
Differential Revision:  https://reviews.freebsd.org/D55158
efdd30c94e0ac4007b52b6f40afdab52fecf2aa5 John Baldwin 2026-02-09 16:27:04
sdhci_fdt_rockchip: Don't return 0 from probe routine
The only write to the softc is a no-op (softcs are initialized to all
zeroes), so remove that and just use BUS_PROBE_DEFAULT.

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D55159
3f18463745c9c75e1fdcfacc710799838ef5c9d9 John Baldwin 2026-02-09 16:27:23
arm64: Move creating the ID register views earlier
These are needed when enabling CPU features so should be processed
earlier in the boot.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55103
0ea31fe851344af022103fa81dcdf00ef0dddc1d Andrew Turner 2026-02-09 17:24:26
arm64: Panic if the ID register isn't known
This will allow for callers to be simplified & not need to check the
return status.

Keep the return type for now so this can be MFCd without breaking the
KBI.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55104
3b0b6aa2cd05b516ecf4b72f9a3c2aadddf3c94e Andrew Turner 2026-02-09 17:24:27
arm64: Have get_kernel_reg return void
It now panics when it's unable to find the register, so doesn't need
to return a status.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55106
1c41e411b5545a9e68f83b445f67030cb0e79010 Andrew Turner 2026-02-09 17:24:28
amd64: define and use STACKALIGN and REDZONE_SZ
Reviewed by:  brooks, emaste, jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55151
97ce8f7d2b8eff42460f60e8c49d9849b58b6e81 Konstantin Belousov 2026-02-07 00:36:44
ahci: Restrict NVMe redirection by BAR size
Attempts to access vendor-specific registers on emulator of older
Intel hardware was reported to confuse one.  Since the redirection
obviously require BAR size bigger than normal 2KB of AHCI, add
the condition, similar to what Linux is doing.

Requested by:   kib
MFC after:      2 weeks
b9d3945831fc7a60f2065c7a0afc747dc5653c9f Alexander Motin 2026-02-09 19:23:26
amd64/acpica/acpi_wakeup.c: do not store to WARMBOOT_OFF in efi_boot case
Split acpi_wakeup_cpus() into acpi_wakeup_cpus_bios() and
acpi_wakeup_cpus_efi().  The former needs to manipulate zero page and
CMOS state, the later does not.

Referenced commit left the write to WARMBOOT_OFF in case of
acpi_wakeup_ap() failed.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e99255c8a6cae324aeede7f5013d080a2d361e3f
Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55205
5f3192b3fddd974db36af0279403aba1371c68ec Konstantin Belousov 2026-02-10 01:37:18
dev/mfi: include sys/abi_compat.h unconditionally
not only for COMPAT_FREEBSD32 case.  The driver uses INPTR() for
non-compat32 code.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
bf603dbbb2c9964bba3d5bf2ba2371a75a0cc521 Konstantin Belousov 2026-02-10 04:17:53
pci_iov: Reuse downstream bridge bus window if it already covers VF bus
If the parent bridge's [secondary, subordinate] window already covers
the VF bus (e.g., programmed by BIOS or a prior PF), skip allocating
PCI_RES_BUS. This avoids a duplicate rman allocation in the multi-PF
case while still allocating when growth is actually needed.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D52163
MFC After: 1 week
feb0a7e19f3c2e4c7eb90668b1e3dc34b5bb6dd6 Chandrakanth Patil 2026-02-10 09:23:16
pci_vendors: update to 2026-02-10
1acfc913e6b936dec3effc7d1e902a50e5432406 Baptiste Daroussin 2026-02-10 13:33:11
usb_vendors: update to 2025.12.13
8d4c1043bb0630710cbea9f744cdaef499c0ed79 Baptiste Daroussin 2026-02-10 13:38:37
Commit group #21: arm64
arm64: Enable MOPS usage in the kernel

Support handling kernel-side MOE exceptions.

Reported by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54943
18af5a180b29f425b8427263be5517d3573ca220 Sarah Walker 2026-02-09 20:39:53

arm64: Add MOPS implementations of memset(), memcpy() and memmove()

Enable the use of MOPS implementations of memset, memcpy and memmove within
the kernel. Fix pre-ifunc resolution uses of these functions.

Reported by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55051
2ccbf06c0285ca1c06681e7212da8e7d1e87fe19 Sarah Walker 2026-01-28 16:22:50

arm64: Add MOPS implementation of pagezero()

Reimplement pagezero() as ifunc. As pagezero() is only used in pmap.c,
move ifunc to that file.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54946
7d7295df9b13b98ac395b206667e7586c602862b Sarah Walker 2026-01-29 17:43:45

arm64: Add MOPS implementations of copyin/copyout

Reimplement copyin() & copyout() as ifuncs.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54947
1224347817c450596797ae6bcbfcc81927cb1f88 Sarah Walker 2026-01-29 18:08:49
vtgpu: Support virtio gpu on Parallels Desktop
The Parallels Desktop Virtio GPU implementation doesn't handle
enqueuing the VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING request and
memory list together.

Work around this by splitting them before sending them to be enqueued.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55147
1ea0721e1a566fdb552b0a919c22667844a894d9 Andrew Turner 2026-02-10 17:06:31
ure: improve receive checksum offloading
Let the receive checksum offload for TCP/IPv6 and UDP/IPv6 be
controlled by ifconfig rxcsum6 and not by ifconfig rxcsum.
While there, make the code more compact and improve stlye.9
conformity.

Reviewed by:            Timo Völker
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55188
378577393e407fa2cd9677392da2287e37b4dd33 Michael Tuexen 2026-02-10 17:08:07
psm(4): Add middle button support for Elantech V4 touchpads
based on firmware version.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291262
MFC after:      1 month
3d85dcd1a9aa2e1b903935062500cb15b1a700f8 Vladimir Kondratyev 2026-02-10 22:59:06
evdev: Drop comments from input-event-codes.h
They were copied intact from the Linux GPL-only file.

Requested by:   imp, glebius
MFC after:      1 week
89aa8a94053fdd22ed716fdf424a2d10e70b3188 Vladimir Kondratyev 2026-02-10 22:59:06
run: rum: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Locally tested:

 * STA mode - run0: MAC/BBP RT2860 (rev 0x0101), RF RT2820 (MIMO 2T2R), address 00:0e:2e:e5:ae:3a

Differential Revision:  https://reviews.freebsd.org/D54462
f064d44badfa9eee3e62d2d7dacd77a968f0a6dd Adrian Chadd 2025-12-29 18:55:52
iwx: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Locally tested:

 * STA mode - iwx0: <Wi-Fi 6 AX210> mem 0x84c00000-0x84c03fff at device 0.0 on pci4

Differential Revision:  https://reviews.freebsd.org/D54463
c08ee1eba989b49c7c30945a551760eaeb2e3e15 Adrian Chadd 2026-01-02 04:32:39
amd64: add LASS support
In short, LASS enforces all kernel memory accesses to have bit 63 set to
1, and all userspace accesses have bit 63 set to 0.  Violations of these
rules cause #GP. There are natural loopholes, like SMAP with rflags.AC=1
allows kernel to access userspace.

Enablement is simple, we need to set CR4.LASS bit on all CPUs.  There
are complications when kernel has to execute code at low addresses, e.g.
for la57 trampoline, or calling into EFI RT.  The patch turns CR4.LASS
off around these regions.

LASS is officially documented in SDM, since at least rev. 085, October
2024.  Tested in simics.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55218
89589b6d3fbac43eb7c6b3cdbdd6f077888b2142 Konstantin Belousov 2024-10-24 02:12:25
hwpstate_amd(4): Update copyright
Sponsored by:   The FreeBSD Foundation
a78e7c22c5d7463577e87a31024df079f7282d01 Olivier Certner 2026-01-29 22:26:19
Commit group #22: hwpstate_amd(4)
hwpstate_amd(4): Rename PSTATE_CPPC internal flag

While here, also rename check_cppc_enabled() => check_cppc_in_use().

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
ebcd80f76ed117afa90419e5ac60cd558715f584 Olivier Certner 2026-02-09 09:21:28

hwpstate_amd(4): Rename '*set_autonomous_hwp*()' => 'enable_cppc*()'

This is to better reflect that we are really enabling CPPC in these
functions and because we are likely to stop activating CPPC autonomous
mode by default in the near future.

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
c6a0eb7ada62c7d6e7d4686b2fe32e009311c1aa Olivier Certner 2026-02-09 09:30:53

hwpstate_amd(4): Move 'struct get_cppc_regs_data' & co. closer to use

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
2b728d3bbfbc61e014cdfa7940227e46027329b9 Olivier Certner 2026-02-09 10:39:53
igc: remove M_HASHTYPE when RSS is not enabled
Summary: manually cherry-pick 21dd554d1697

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55256
9778537b6738d8693e887c3b0c8bc4d5a0aa28ce Cheng Cui 2026-02-11 22:21:32
cxgbe(4): Fix assertion in timer calibration
The calibration callout is stopped when the adapter is marked off limits
but not when the adapter is merely stopped.

MFC after:      1 week
Sponsored by:   Chelsio Communications
afe55ae68e742ea5e5eb9e78cf68d570d458cd0d Navdeep Parhar 2026-02-10 19:07:43
asmc: Convert driver to CTLFLAG_MPSAFE
Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all sysctls.
The driver already uses spin mutexes (sc->sc_mtx) for hardware
access protection and does not require the Giant lock.

This improves scalability by allowing concurrent sysctl access
without Giant serialization.

Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D54613
1a6bdd6266e3b53c8b6b597a77a100353b7ae13a Abdelkader Boudih 2026-02-13 03:00:22
e1000: Increase FC pause/refresh time on PCH2 and newer
This corresponds to Linux f74dc880098b4a29f76d756b888fb31d81ad9a0c

That commit does not provide any public background detail, but it's been
in use for over 5 years and corresponds to previous chip bugs w.r.t.
automatic generation of PAUSE frames.

Reviewed by:    kgalazka
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54555
2bdec2ee73be7dbafce9982b0dc5c273918a5443 Kevin Bowling 2026-02-13 06:30:22
x86: add a safe variant of MSR_OP_SCHED* operations for x86_msr_op(9)
The modifier executes the operation using msr{read,write}_safe()
functions instead of plain msr reads and writes.  Returns EFAULT if any
MSR access caused #GP.

Reviewed by:    markj, olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55045
af99e40af1dd4e8b39ca986240ee8b9aea722958 Konstantin Belousov 2026-02-01 23:43:50
x86_msr_op(9): consistently return the value read from MSR
If the operation is executed on more than one CPU, a random instance of
the read value is returned.

Reviewed by:    markj, olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55045
36ceb5509d01ff2e6482a78ca809c344574e9a25 Konstantin Belousov 2026-02-04 00:24:58
x86: provide extended description for x86_msr_op(9)
Reviewed by:  markj, olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision: https://reviews.freebsd.org/D55045
cb81a9c18db93a2046c47b0c7dc0bd6adcdd2495 Konstantin Belousov 2026-02-04 00:22:08
nvme: Change fail_on_reset to bool
This is safe since sysctl_handle_bool() handles ints transparently.

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55263
1e2eea55c4559544b68c99e95641097983230611 Dag-Erling Smørgrav 2026-02-13 12:34:42
nvme: Use size_t for payload size
Using uint32_t here can cause spurious compiler warnings.  I assume it
was done to constrain the range; use a KASSERT instead.

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55279
be7e4dc878eab090cd411c9ef28880e4f62116f5 Dag-Erling Smørgrav 2026-02-13 18:37:07
cxgbe(4): Show correct range of tids in sysctl_tids
The highest valid tid has to be adjusted for the hi-pri filter region.

MFC after:      1 week
Sponsored by:   Chelsio Communications
605af0640769b1d77d0d38bebee93fb35ee4101e Navdeep Parhar 2026-02-13 18:30:03
ichsmb: Add Intel Raptor Lake SMBus controller support
Add PCI device ID 0x7a23 for Intel 700 Series (Raptor Lake) chipset SMBus controller.
This enables hardware monitoring functionality on 13th and 14th generation Intel Core platforms.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D54957
e4bcfe4ebf03e321a5f8317491cdeea49e4f6357 Abdelkader Boudih 2026-02-16 03:58:41
powerpc: enable HPT superpages by default
It's time to flip these on and see if anything happens in -HEAD.
It can be turned back off before 16.0-RELEASE if there are problems.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D55071
f412a5c565dedf5b6ea7cf3e43b57766ec0da63c Adrian Chadd 2026-02-16 17:49:46
powerpc: document the magic constants for 16MB page size
After discussion with jhibbits@, we pulled out what is supported here
and how it's supported.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55093
995090202cae47567cc5b0d92301692d49c1c035 Adrian Chadd 2026-02-16 17:49:52
mfi(4)/mrsas(4): Print driver versions consistently
Reviewed by:  ziaee, des
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54519
93122ead724b3ba0ccdaedadcd371ec53f9a9844 Michael Osipov 2025-12-21 17:13:21
acpi_gpiobus: Reuse the existing IVAR index for an ACPI handle
ACPI_IVAR_HANDLE is a global index shared across multiple busses,
there is no need for a unique constant here.

Reviewed by:    vexeduxr, imp
Differential Revision:  https://reviews.freebsd.org/D54155
b9f1e45e685b5e007d0c3a9513ac13e6d82e9518 John Baldwin 2026-02-17 20:44:58
bus: Drop a couple of unused IVAR indices
This changes the in-kernel ABI, but that is permitted across major
versions and is cleaner than leaving these around forever.

Differential Revision:  https://reviews.freebsd.org/D54160
824ce81f74b5aece73620c94693dcf3c718e96c4 John Baldwin 2026-02-17 20:45:38
arm64: Explicitly use movz
This appeases GNU as which doesn't map the mov alias to movz.

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D55160
4092df8820ea01951ab6df6cfd4fdc5b239e636e John Baldwin 2026-02-17 20:46:35
arm bcm2835: Appease a warning from GCC
No code currently uses the vc_audio_msg_type_names array of strings.

Reported by:    -Wunused-variable
Differential Revision:  https://reviews.freebsd.org/D55162
c7f7b67411b2ac325b548422191896cfa66d15cb John Baldwin 2026-02-17 20:46:48
arm64: Fix the ESR_ELx_EC_MASK definition
Sponsored by: Arm Ltd
f4d1a3ab0271216df05bab14c641d8023cc43a04 Andrew Turner 2026-02-18 15:10:44
arm64: Add more HWCAP values
Sponsored by: Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55219
3a960425df759a7bb8f946d23f035c63f3a5de7a Andrew Turner 2026-02-18 15:28:14
pcib: Assume a window where both the base and limit are 0 is uninitialized
Since the low bits of a window's limit are hardwired to 1, this
configuration looks like a minimally sized window at address 0.
However, PCI resources are not generally at address 0 (see the
__PCI_BAR_ZERO_VALID macro that was only defined on sparc64), and some
PCI-PCI bridges report these register values after a reset.  The
result today is a lot of spam in dmesg as the minimally-sized windows
fail to allocate.  By ignoring these windows and treating them as
closed the end result is the same, but there is less spam during boot.

Reported by:    jrtc27
Differential Revision:  https://reviews.freebsd.org/D43922
349808d8bd197165390a286bccdaa29a1d77c7ab John Baldwin 2026-02-18 16:04:54
nvme: fix panic if we boot w/o a namespace
If we format a drive, and then crash, we'll come back up. nvme_sim_ns
device won't attach because we don't have a namespace. Some drives (all?
I couldn't find it in the standard) send an AER with a namespace change,
which causes a NULL dereference because s_sim wasn't initialized because
we didn't attach. So, if we get into the ns_changed routine, bail early
if we didn't attach. We'll attach later, and deal with the ns correctly
if it's really there, or not attach one if it's not.

Sponsored by:           Netflix
c8d63d63679fc0d8a67b33499a2a2edd444c8e2e Warner Losh 2026-02-17 08:00:34
nvme: Fix sim unit number to match nvme device
The CAM sim unit numbner should match the nvme device number. We need
this to match unit numbers in some wiring scenarios. For example:

hint.nvme.0.at="UEFI:PciRoot(0x3)/Pci(0x1,0x1)/Pci(0x0,0x0)"
hint.nvme.1.at="UEFI:PciRoot(0x3)/Pci(0x1,0x2)/Pci(0x0,0x0)"
hint.nvme.2.at="UEFI:PciRoot(0x3)/Pci(0x1,0x3)/Pci(0x0,0x0)"
hint.nvme.3.at="UEFI:PciRoot(0x3)/Pci(0x1,0x4)/Pci(0x0,0x0)"
hint.scbus.33.at="nvme0"
hint.nda.0.at="scbus33"
hint.scbus.34.at="nvme1"
hint.nda.1.at="scbus34"
hint.scbus.35.at="nvme2"
hint.nda.2.at="scbus35"
hint.scbus.36.at="nvme3"
hint.nda.3.at="scbus36"

If the devices that are nvme0 and nvme3 are the only ones populated, you
still want them associated with nda0 and nda3.

The nvme_sim device changes meant we were passing the wrong device's
unit number to cam_sim_alloc. This fixes the problem.

Sponsored by:           Netflix
8aa560491cfad7953c7c089f4847951e867ef47c Warner Losh 2026-02-17 21:08:46
acpi: Factor out message printing on failure of AcpiEnterSleepStatePrep()
To this end, create a small wrapper, acpi_EnterSleepStatePrep(), which
itself prints the failure message.

While here, when trying to power down (acpi_shutdown_final()), and
AcpiEnterSleepStatePrep() failed, print an additional message more
explicit about the power down request having failed.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55225
781c9b0a595f9af501ad836a120aedba91c13a0b Olivier Certner 2026-01-28 16:06:30
acpi: Factor out the power off code into acpi_poweroff()
While here, make it print that we are trying to power off upfront, not
really treating differently power off preparation via
acpi_EnterSleepStatePrep() and actual power off via
AcpiEnterSleepState(), which the user does not care about.

While here, capitalize the messages.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55226
ffdfca5982b60cb4145a53f965b8c51600d2f323 Olivier Certner 2026-01-28 16:40:51
iommu_gas: Fix assertion.
placeholder entry end changed to 0 in f591287756368
("iommu_gas: make placeholder entry at the start of the GAS zero size")

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55326
7e8284c6ad95bb7a0fc84d4d945ee98737efdd36 Ruslan Bukin 2026-02-19 13:56:36
riscv: GENERIC: enable KERN_TLS
This unskips 585 sys/kern/ktls_test testcases[0] in CI. All 585 tests currently pass.

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/sys.kern/

Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55376
1e649491b8567151270095fda3bce8faea394952 Siva Mahadevan 2026-02-19 17:37:44
asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1
The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0Sf failed 10 times, giving up
```

Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop
"fansafespeed" checks in the driver for the model as it doesn't support
that hardware feature.

MFC after:      1 week
Reported by:    @probonopd
Closes:         https://github.com/helloSystem/ISO/issues/357
7b862cf8a252d80ab1fb90fa5371fd8462c7c16f Enji Cooper 2026-02-20 05:43:37
asmc: use symbolic names with the MacPro3,1 model
Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the underlying macros/fields for
`struct asmc_model`.

No functional change intended.

MFC after:      1 week
90edc16166a6fef03d2384247d07d64656f03309 Enji Cooper 2026-02-20 06:24:38
chore: asmc: use designated initializers in macros
This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify
what the macros actually do under the covers, without introducing
potential human errors.

No functional change intended.

MFC after:      1 week
ef1cde51032d395492caae302fedf183c58a482b Enji Cooper 2026-02-20 06:31:21
hwpstate_amd(4): Fix punctuation in 'desired_performance' knob's description
To be consistent with that of the others.

No functional change.

Sponsored by:   The FreeBSD Foundation
f1b93fc50f019c122636d6f8780f109d7be26862 Olivier Certner 2026-02-20 09:17:24
i386,amd64: Explicitly set ECX=0 in do_cpuid() to be future-proof
In principle, do_cpuid() should only be used for CPUID leaves without
sub-leaves.  Even accessing sub-leaf zero (ECX=0), one must use
cpuid_count(ax, 0) rather than cpuid(ax).

However, one might assume do_cpuid(ax) is equivalent to
cpuid_count(ax, 0), but the old do_cpuid() did not initialize ECX before
executing the CPUID instruction.  If ECX contained a non-zero value, the
instruction could return unexpected results, potentially leading to
subtle and hard-to-debug issues, especially in ported code.

To be future-proof and to help port code, adjust do_cpuid(ax) to be
cpuid_count(ax, 0) to explicitly set ECX=0.

It's believed that this change does not fix any real bugs in FreeBSD.

See also the DragonFly commit:
https://github.com/DragonFlyBSD/DragonFlyBSD/commit/0087a1d163488a57787a9a6431dd94070b1988d4

Signed-off-by: Aaron LI <aly@aaronly.me>
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/2027
89d7b30c652c98ea12abc5eb9424464cbfb45953 Aaron LI 2026-02-16 04:00:12
nvmf: Limit the default I/O queue size to 128 entries
Previously the size defaulted to the maximum supported size reported
by the remote host.  The value of 128 matches the default on Linux and
avoids excessive resource usage for I/O queues.

Sponsored by:   Chelsio Communications
1602f0013bddc7b59b0b8de94c0e6cd742ffc9be John Baldwin 2026-02-20 19:21:18
sound: Detect unsupported formats
This way we can avoid edge-cases like
8af6aee96ed609456900c6dd92dafabac5e89c0a ("virtual_oss(8): Remove
floating point formats from preference list").

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55403
3deae7b786743193531f4e69527e789de52644c5 Christos Margiolis 2026-02-21 11:36:58
asmc: resource cleanup simplifications
This change makes `asmc_detach(..)` reentrant by setting freed resources
to known invalid values when done, and makes `asmc_attach(..)` call
`asmc_detach(..)` instead of attempting to the semi-equivalent way of
cleaning up the driver resources allocated in `asmc_detach(..)`.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55413
eda36ae09dd1fab78bd377739fc5d6c65c61f5d7 Enji Cooper 2026-01-30 06:55:08
powerpc64: initial conversion of oea64 to rwlocks
Convert the oea64 mmu code to rwlocks.

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D54936
19a18bb750e8ed88207664b4959e433b7e68e926 Adrian Chadd 2026-02-22 02:22:46
rsu: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Differential Revision:  https://reviews.freebsd.org/D54483
6a6152bc292fbd86015507978c6d3556ef3915a1 Adrian Chadd 2026-02-22 03:29:44
HYM8563: Add support for clock output.
The RTC contains a configurable clock output.

MFC after:      3 weeks
6b77d34f449128e6591131ec3d1822e2df3d8d8a Michal Meloun 2025-11-06 19:19:37
OFW: Improve OFW_CPU.
Accept the assigned clock on the CPU node.
Don't report a missing "clock-frequency" property if the CPU node has
a "clocks" property.

MFC after:      3 weeks
4840558e521934345793ef83b0d45a72fd615a7b Michal Meloun 2025-11-06 19:01:18
TCA64xx: Convert mutex to SX lock.
I2C devices are permitted to sleep during transfers.

MFC after:      3 weeks
2ade7208068d1d215f8b9754b448566354d6944c Michal Meloun 2025-11-06 19:11:17
fdt,simple_mfd: Map memory as shareable.
It may be submapped in child drivers.

MFC after:      3 weeks
f40ed4881e2581d56b1a63ffb0122e017b2139f3 Michal Meloun 2025-11-06 19:21:49
pci_dw: improve pci_dw
Add support for 64-bit ranges.
Process 'bus-range' property.
Add some debug prints.

MFC after:      3 weeks
92c66dc5f8723083530efbbc5cfa4068105f472c Michal Meloun 2024-10-07 16:50:10
regulator_fixed: add support for 'gpios' property
This is a newer version of the "gpio" property.

MFC after:      3 weeks
9de43130f989896d92dda22ed73ca3033863efd7 Michal Meloun 2025-11-06 19:37:14
rge: fix callout setup/teardown; handle invalid ethernet address
* Do the callout init early; since some of the teardown path expects
  the callout to be valid

* Handle an invalid ethernet address by generating a local one.

PR:     kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293307

Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D55419
d5ca52182e522a192d0c8fbdaa438f50e200082f John 2026-02-22 18:06:39
rge: correctly free busdma memory / zero things out only if allocated
* Only free busdma memory that was allocated
* Don't free tx/rx rings until their buffers have also been freed

PR:     kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293307

Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D55420
d1947d0a1a55f905e5ed076d46d4f75a00c6f823 John 2026-02-22 18:06:44
rge: log silicon revision during attach
The initial import from OpenBSD contained chip revision printf() calls
commented out, as OpenBSD's bare printf() style does not translate to
FreeBSD's device_printf() idiom. The result is that users cannot
distinguish RTL8125 from RTL8125B, RTL8125D_1, RTL8125D_2 etc. via
dmesg alone, even though all variants show as '<RTL8125>' from the PCI
probe string.

Add proper device_printf() calls including the raw hwrev value,
consistent with how re(4) reports chip revisions.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    zlei, imp, adrian
Differential Revision:  https://reviews.freebsd.org/D55402
acbf7498f5e11b00ffcd6c12bdb8bd1eddeb6d7f Christos Longros 2026-02-22 18:06:50
acpi_panasonic: Clear wireless RF_KILL on boot and resume
On Panasonic FZ-Y1 and similar models, the EC latches RF_KILL on
shutdown and suspend when battery is at certain level, causing wireless
to boot with hard block.

Call WLSW.SHRF during attach and resume to clear the block.

Tested on Panasonic FZ-Y1 with Intel Wireless 7265.

Reviewed by:    adrian, obiwac
Approved by:    adrian, obiwac
Differential Revision:  https://reviews.freebsd.org/D55265
16822dac32ab8955539ffa4eda05145df8638154 Abdelkader Boudih 2026-02-23 16:11:10
sdiob: Forward-declare struct sdio_func
Currently this happens as a side effect of the return type of
sdio_get_function() in the expansion of __BUS_ACCESSOR, but this is
fragile and can break if __BUS_ACCESSOR changes to define other
functions first.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55351
82b293ea6987ebcadf1142acd2218f50ab5e3fc8 John Baldwin 2026-02-24 20:26:55
acpi: Use __BUS_ACCESSOR_DEFAULT and __BUS_ACCESSOR for IVARs
- Use __BUS_ACCESSOR_DEFAULT for the global handle IVAR to preserve
  existing behavior for acpi_get_handle.

- Use __BUS_ACCESSOR for the private ACPI IVARs as these are only used
  with direct children of acpi0.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55355
591127bd4839d00fc218d74096ca07088ad30703 John Baldwin 2026-02-24 20:30:36
qoriq: fix spelling in device_set_desc()
The product series is called NXP QorIQ Layerscape.  Remove the extra 'e.

MFC after:      3 days
Reviewed by:    mmel, emaste
Differential Revision: https://reviews.freebsd.org/D55388
a4e30909ec983f7986954e6c509ea21422561d84 Bjoern A. Zeeb 2026-02-19 23:10:34
qoriq / nxp: Fix spelling take II
Fix spelling of NXP, which is not NPX, in two places.

Improves:       a4e30909ec98
Reported by:    Kevin Bowling (kevin.bowling kev009.com), qoriq_dw_pci.c
MFC after:      3 days
c3ed2f3e414497ab3cf6ade17e52a87f07a547e6 Bjoern A. Zeeb 2026-02-24 23:12:46
sys: Declare 'end' as an extern char[]
While here, remove an unused declaration.

Reviewed by:    jrtc27
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D53898
6513c2845f8912c30749cf64704d3dfeeeb9a47a John Baldwin 2026-02-25 02:20:59
cxgbe tom: Use the same WRs as iSCSI to send PDUs for NVMe
Reviewed by:  np (earlier version)
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55470
e43730e585fab3385c5b774b83e95e16c984dacc John Baldwin 2026-02-25 02:23:39
chore: replace {0, 0} with {DEV,KOBJ}METHOD_END
Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.

Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END`
and `KOBJMETHOD_END` as appropriate. This helps ensure that
future adaptations to drivers following patterns documented
in driver(9) can be made more easily/without issue.

MFC after:      1 week
Differential Revision:   https://reviews.freebsd.org/D55414
0fc6c3f731a2cca3120798806c330a3081c9424b Enji Cooper 2026-02-21 06:14:46
asmc: add Wake-on-LAN control via sysctl
Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.

This change adds a convenience sysctl, `dev.asmc.0.wol`. This can be
disabled if set to 0 and enabled if set to 1.

The AUPO key is volatile and resets to 0x00 on every boot, so WoL must
be manually enabled before each shutdown to work from powered-off state.
Users need to run: `sysctl dev.asmc.0.wol=1` before shutting down the
system. The sysctl is best set to persist in `/etc/sysctl.conf`.

MFC after:      1 week
Reviewed By:    markj, ngie
Differential Revision:  https://reviews.freebsd.org/D54439
94db365042d35ff7e3ee7365a87a89bab1560030 Abdelkader Boudih 2026-02-25 06:32:42
asmc: introduce the concept of generic models
Having to enter in each of the models for Apple hardware, recompiling,
etc, is tedious. Provide generic models so end-users can leverage some
of the capabilities provided by the driver, i.e., common features like
minimal fans and lights (if present on the generic model) support.

The generic models are as follows:
- Macmini
- MacBookAir
- MacBookPro
- MacPro

This sort of follows the pattern established by the `applesmc` driver in
Linux.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55395
3023bb49e115b4149f9fc0683dabde172ecb1336 Enji Cooper 2026-02-20 06:37:05
mlx5: report IPSEC offload capabilities whenever IPSEC_OFFLOAD is configured
Do it always for bootverbose if offload was enabled in the kernel
config, not only if the device actually supports all required
capabilities to do the offload. Otherwise, having the code to print the
caps is pointless.

Reviewed by:    slavash
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   NVidia networking
MFC after:      1 week
de29fd0322254127c3ebaedbc91ee4f9620f5fdf Konstantin Belousov 2026-01-28 05:32:53
mlx5: convert GET_TRUNK_IF() to function
Reviewed by:  slavash
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
87ca74de89e0ae96774674f7ae14d303fad5b780 Konstantin Belousov 2026-01-29 00:25:01
ath: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Differential Revision:  https://reviews.freebsd.org/D54479
a54a36c40f07092ace706ccec8c3db6f6a1877c1 Adrian Chadd 2026-02-26 03:49:27
ipw: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Differential Revision:  https://reviews.freebsd.org/D54480
fec9453dcea41f2716baa350c7e0fe33cdeb4d4b Adrian Chadd 2026-02-26 03:49:34
iwi: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Differential Revision:  https://reviews.freebsd.org/D54481
76a20323fcfb9df34cd8529129cad0c4317115fb Adrian Chadd 2026-02-26 03:49:38
wpi: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Differential Revision:  https://reviews.freebsd.org/D54482
70786de406b62bed55566ec95c932e150c25c3b3 Adrian Chadd 2026-02-26 03:49:43
mwl: migrate to new net80211 encryption key API
Migrate to the new encryption key API rather than poking at the
key struct directly.

Notably this driver was very clear about its expectation the net80211
key layout w/ key, TX MIC and RX MIC matches the firmware layout
and just memcpy()'ed it.  That has been refactored.

Differential Revision:  https://reviews.freebsd.org/D54484
8ebc054acacc70de6b95fc171ff724f344374172 Adrian Chadd 2026-02-26 03:49:59
xen/acpi: implement hook to notify Xen about entering sleep state
This is required so that ACPI power-off (entering S5) works as expected, as
the ACPI PM1a and PM1b blocks might not be accessible by dom0 directly.
Additionally, Xen also needs to do cleanup before entering a sleep state,
so it needs to be notified about it.

With this patch FreeBSD dom0 now powers off the host correctly:

acpi0: Powering system off...
(XEN) [   85.686598] arch/x86/hvm/emulate.c:415:d0v0 fixup p2m mapping for page fedc6 added
(XEN) [   85.687606] arch/x86/hvm/emulate.c:415:d0v0 fixup p2m mapping for page fbc10 added
(XEN) [   85.692357] Preparing system for ACPI S5 state.
(XEN) [   85.692702] Disabling non-boot CPUs ...
(XEN) [   85.694471] Broke affinity for IRQ9, new: {0-7}
[...]
(XEN) [   85.903118] Entering ACPI S5 state.

Should be a non-functional change when not running as a Xen dom0.

Reviewed by: kib
Sponsored by: Citrix Systems R&D
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D55504
db16856110cbdbdfdc3c8d44edae1b3a7463198e Roger Pau Monné 2026-02-24 20:23:08
dpaa2: improve error messages and log requested cluster size
If m_getjcl() fails we want to know the size we requested in order to
have a chance to evaluate the problem better.

MFC after:      3 days
Reviewed by:    tuexen
Differential Revision: https://reviews.freebsd.org/D55555
c3577fcf3fd0494cc992021d4debbca09241a49e Bjoern A. Zeeb 2025-08-20 21:04:49
asmc(4): pull 32-bit support for the driver
The asmc(4) driver should work for 32-bit Intel-based Macs, in theory, if
the model details were added to the detection list. That being said,
32-bit Intel Macs were only released and available to the general public
for 8 months [1], so the value in maintaining i386 support in the driver is
reduced due to limited hardware access.

Remove 32-bit support for the driver officially to make it clear its use is
not supported.

This should fix building `NOTES.i386` by proxy as well.

Relnotes:       yes
MFC after:      2 weeks
Fixes:          https://cgit.freebsd.org/src/commit/?id=f224591746b ("Add ASMC_DEBUG make option")
Fixes:          https://cgit.freebsd.org/src/commit/?id=8342d9f7b5f ("asmc(4): Stop building it on i386, as...")
Differential Revision:  https://reviews.freebsd.org/D55544
1f2f5eba24aa53e180a4eb46b772410e5a782469 Enji Cooper 2026-01-05 03:36:55
hwpmc: Fix PMC flags for AMD Zen cores
The PMC flags available for DF and L3 counters were not all implemented.
More importantly, the field encodings for the L3 counters changed in an
incompatible way between Family 17h and Family 19h.  Similarly, the
field encodings for the DF coutners changed between Family 19h and 1Ah.
I also added the precise retire flag for the 3rd core counter.

Lastly, I added a warning in the jevent parser because ignoring the
unknown fields results in counters incorrectly programmed.  We should
not just ignore that.

Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2040
00c0a1f0bf6c07e63384a389060dfc10924c0ed6 Ali Mashtizadeh 2026-02-21 19:07:26
hwpmc: Initial support for AMD IBS
This patch adds support for AMD IBS.  It adds a new class of performance
counter that cotains two events: ibs-fetch and ibs-op events. Unlike
most existing sampled events, IBS events provide a number of values
containing extra information regarding the sample.  To support this we
use the existing callchain event, and introduce a new flag for multipart
payloads.  The first 8 bytes of the pc_sample contains a header that
defines up to four payloads.

Sponsored by: Netflix

Reviewed by: imp,mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/2022
e51ef8ae490fc9f73191f33e7ad388c2511c454a Ali Mashtizadeh 2026-01-30 09:12:17
libpmc: Update event definitions for AMD Zen
The pmu event definitions for AMD Zen 5 was updated since it was
imported into the tree.  As a bonus I also updated the recommended json
counters for Zen 1-3 even though we do not use that file yet.

Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2048
3ce3e896acf6cd504514ee44fc3aedcdc48a199c Ali Mashtizadeh 2026-02-24 15:36:03
libpmc: Import AMD Zen 6 PMU events.
Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2049
178d0b5b8da7480f455273aedf40dd8f1e785d3f Ali Mashtizadeh 2026-02-24 15:52:00
amd64 initializecpu(): use 64bit type for rcr4() result
Right now %cr4 defined bits fit into the low word, but this is not true
with FRED.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
6099b4600256552fc6f664c82b7dd0325a4b5b19 Konstantin Belousov 2026-03-01 01:00:28
asmc: output the SMC firmware revision on attach
The SMC firmware revision can prove helpful when determining why the
behavior of a given controller varies from the maintainers' expected
behavior.

This should be a sysctl (eventually), but for now dumping out the
information via `device_printf(..)` suffices, given that only one
asmc(4) compatible device can exist in an Apple platform at any
given point in time. This will become a sysctl in the future after
additional improvements are incorporated from OpenBSD and NetBSD.

MFC after:      1 week
Obtained from:  https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064)
Differential Revision: https://reviews.freebsd.org/D55577
e81e724358e43dcf951e244a9df9df3eaa983fe9 Enji Cooper 2026-03-01 18:54:56
arm64/pmap: fix pmap_is_valid_memattr()
The function pmap_is_valid_memattr(pmap, mode) checks whether the
given variable mode is between the two constant values
VM_MEMATTR_DEVICE and VM_MEMATTR_WRITE_THROUGH.
After the code for this function was written, the value of
VM_MEMATTR_DEVICE changed from 0 to 4. Since VM_MEMATTR_WRITE_THROUGH
is still 3, the condition is always false.
This patch changes the condition to check whether mode is equal to any
of the VM_MEMATTR* constants.

Reviewed by:            andrew, tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55534
0272359ada144aa540c28fefaf996afa30dc0aa5 Timo Völker 2026-03-02 17:59:45
virtio: add loader tunables to sysctl
virtio_pci uses two loader tunables that should be more visible.
This patch adds these loader tunables to sysctl and describes them
in the virtio(4) man page.

Reviewed by:            imp (erlier version), tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D55533
c70755bc0d8f703dbaa1520c15e8213a95847dd5 Timo Völker 2026-03-02 18:15:37
sound: Notify devd on hw.snd.default_unit change
If we have virtual_oss running, this devd notification will make sure to
automatically transfer sound to the new default unit, while also making
sure that we switch to it only for the supported directions (recording
and/or playback).

For more information, please refer to 2ffaca551eaf ("snd_hda: Implement
automatic redirection between associations").

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55530
d40189f8259e3565c69a40194f7b603d0ca648de Christos Margiolis 2026-03-03 11:32:32
sound: Notify devd when no devices are connected
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55531
428517a7712e44b58e0687fbee4037a8ebe5bf5a Christos Margiolis 2026-03-03 11:32:38
virtio: Use bus_dma for ring and indirect buffer allocations
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

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

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54959
c499ad6f997c8c5f61c88925e6d1e826d0c0f6c4 Sarah Walker 2026-03-03 16:08:11
virtio_blk: Use bus_dma for command/ack buffer allocations
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

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

Reviewed by:    andrew, br
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54960
c8c37141a661cc9a6a51e43599d1afc8a3f0ef46 Sarah Walker 2026-03-03 16:27:38
nvme_sim: Fix a cut and paste error
Fix the error message in nvme_sim_ns_removed that was cut and pasted
from nvme_sim_ns_changed to reflect its new home.  No functional change.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55522
244ae85eb97548fd81783f079ee26e0aa9f4b984 Warner Losh 2026-03-03 17:59:42
acpi_spmc: fix revision check reading name as integer
In acpi_spmc_get_constraints_spec(), the revision of the device
constraint detail package was mistakenly read from
constraint_obj->Package.Elements[0], which is the device name
(a string), instead of from the detail sub-package's first element.

Move the initialisation of 'detail' before the revision check and
read the revision from detail->Package.Elements[0] as the comment
already states

Approved by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D55639
Sponsored by:   Netflix
4d876fc5fc427f9e4a110da5cc2ce62a21998b6c Olivier Cochard 2026-03-03 23:05:04
amdsmu: Sleep entry/exit hints for PMFW
amdsmu_suspend() and amdsmu_resume() for sending hints to the AMD SMU
power management firmware (PMFW) that we are entering and exiting
s2idle. We also dump sleep metrics once we tell it we're exiting sleep,
so the relevant metrics are updated.

Register these as acpi_post_dev_suspend and acpi_post_dev_resume
eventhandlers.

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48721
2c60fce365f4398ff02a86b46e2862905f88fa97 Aymeric Wibo 2025-06-14 15:33:24
arm64: Treat the PMUVer field of ID_AA64DFR0 as unsigned
The PMUVer field of ID_AA64DFR0 contains an unsigned version of the
Performance Monitors Extension, but it is currently treated as signed.
Change it to unsigned.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Kajetan Puchalski <kajetan.puchalski@arm.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2062
e40e5458616d13b44cd407aa1afff620f8ff8766 Kajetan Puchalski 2026-03-04 15:16:35
arm64/vmm: Support PMU v3p9
The only new register is read-only. As the kernel just passes the
registers to the guest directly no further change should be needed.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D51764
d1650d226205cdf07fb19e0c9b10b47b941e8747 Andrew Turner 2026-03-04 16:35:57
acpi: Treat ACPI_IVAR_FLAGS as a global IVAR
The ACPI bus uses the flags IVAR for any device with a _PRW method
including devices such as PCI bridges/devices that are not direct
children of acpi0.

Reported by:    ngie
Reviewed by:    ngie
Fixes:          https://cgit.freebsd.org/src/commit/?id=0bb867e9f565 ("acpi: Split ACPI IVARs into global and private sets")
Differential Revision:  https://reviews.freebsd.org/D55561
00ff89c1e0c8d92fe644ea97b521ceb66d46e170 John Baldwin 2026-03-04 20:19:48
static dtb: add BTI note
Add BTI note to fdt_static_dtb.o
- resolves "Branch Target Exception" panic on FDT systems with static DTB
  due to missing landing pads (bti note has to be in all object files used
  for linkage)
- also required by bti_report linker feature

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D55636
dff2758b5fa7d4987b03f3a04e1b02b367fe9b73 Ruslan Bukin 2026-03-05 08:50:18
riscv: save FPE state in cpu_fork().
Save the Floating Point Extension (FPE) state before copying struct pcb.

Reviewed by:    br
Differential Revision:  https://reviews.freebsd.org/D53804
d3eaa40282c7734385d028b6a4fb9574d17255e3 Jari Sihvola 2026-03-05 08:57:22
arm64: Use a canonical address when TBI is enabled
When Top Byte Ignore (TBI) is enabled in a processor we need to pass
a canonical address to the vm subsystem.

Reviewed by:    alc, kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55619
570b8b25753c2be7657f0e906cb5a89c7f35b56e Andrew Turner 2026-03-05 14:27:37
arm64: Optimise the repeated TLBI workaround
It has been reported that the overhead of repeating all TLBI
instructions is too large [1]. The Software Developer Errata Notices
(SDEN) for the relevant Arm CPUs have been updated so a single
"tlbi vale1is, xzr" followed by "dsb ish"  is sufficient to work around
the issues.

Replace the places we repeat TLBI instructions with the new sequence.

[1] https://lore.kernel.org/linux-arm-kernel/20260218164348.2022831-1-mark.rutland@arm.com/

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55646
80b4129bef8b908eb19fe47853cb6e45e4513d76 Andrew Turner 2026-03-05 14:28:01
acpi: Don't attach a "wake" sysctl node to devices without the ACPI flags IVAR
Not all bus drivers for ACPI-aware devices implement the ACPI flags
IVAR used by the acpi_wake_set_sysctl handler.  In some cases this may
be a feature as some new-bus devices share the same ACPI handle (e.g.
a pcibX device and its child pciY device) which can lead to confusing
results (e.g. setting the sysctl on pciY changes the behavior of the
parent pcibX device, but the "wake" sysctl for pcibX won't reflect the
new behavior, or reflect the device's state).

Reviewed by:    obiwac, ngie, imp
Differential Revision:  https://reviews.freebsd.org/D55562
d19f2af2b7f9c964622fd2eba7d077c6f221b652 John Baldwin 2026-03-05 19:07:09
Commit group #23: iwx: Fix 32-bit compilation
iwx: Fix 32-bit compilation

- Avoid shifts wider than integer types, by wrapping the corresponding
  checks into '#if __SIZEOF_SIZE_T__ > 32' blocks.  'bus_addr_t'
  currently has the same width as 'size_t' on all architectures (and
  this is not going to change for 32-bit architectures).
- Use appropriate printf(3) format for 'wk_keytsc'.

Reviewed by:    adrian
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55667
35da55c28dbb56dd7056b7863efc5b547950d885 Olivier Certner 2026-03-05 12:31:51

iwx: Re-activate the 32-bit boundary cross check on 64-bit architectures

__SIZEOF_*__ is in bytes, not in bits...

Reported by:    brooks
Fixes:          https://cgit.freebsd.org/src/commit/?id=35da55c28dbb ("iwx: Fix 32-bit compilation")
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
c1567d49a8320fd23dff9dbce1186f2331538253 Olivier Certner 2026-03-06 16:33:21
amd64: align stack on 16 bytes when calling into a EFIRT method
Reported by:  Abdelkader Boudih
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
347cec10e25eacb2906a0a8105eff036850db766 Konstantin Belousov 2026-03-05 08:37:23
amd64: extract uprintf_signal printing into a helper
3e8a9995e9541a0bdd707f111e51ef46a544ee3e Konstantin Belousov 2026-02-18 19:04:39
amd64: print userspace fsbase and gsbase for uprintf_signal
272ea451199462dffd55dd580532eb28ddc92174 Konstantin Belousov 2026-03-04 03:22:26
nvme: Don't active memory space until all BARs are configured
In the current current behavior the 2nd and 3rd BARs can be activated
when they're configured with address zero. This change defers the
activation of all BARs until after they've all been configured with an
address.

This enables FreeBSD on Google Compute Engine C4-LSSD Machines.

Sponsored by:           Google
Tested by:              NetApp (previous version)
Reviewed by:            gallatin, imp
Discussed with:         jrtc27 (improved error reporting)
Differential Revision:  https://reviews.freebsd.org/D55541
b3d9e5013f3e5016ffbd3d3d6091194658af2b92 Matt Delco 2026-03-06 17:23:03
sys: Don't pass RF_ALLOCATED to bus_alloc_resource*
This is a nop as eventually these flags are passed to rman_reserve_resource
which unconditionally sets RF_ALLOCATED in the new flags for a region.
However, it's really a layering violation to use RF_ALLOCATED in relation
to struct resource objects outside of subr_rman.c as subr_rman.c uses
this flag to manage it's internal tracking of allocated vs free regions.

In addition, don't document this as a valid flag in the manual.  I
think the intention here was that if a caller didn't want to pass
RF_ACTIVE or RF_SHAREABLE, they could pass RF_ALLOCATED instead of 0,
but given the layering violation, I think it's best to just pass 0
instead in that case.

NB: The bhnd bus uses RF_ALLOCATED (along with RF_ACTIVE) in a
separate API to manage resource regions that are not struct resource
objects (but a separate wrapper object).  It would perhaps be cleaner
if the chipc_retain_region and chipc_release_region functions used
their own flag constants instead of reusing the rman(9) flags.

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D55683
1e4086d05297b711081fe06933677925c5ee6232 John Baldwin 2026-03-06 21:32:33
x86: change signatures of ipi_{bitmap,swi}_handler() to take pointer
to the frame instead of the frame itself. It is some stretch of the
amd64 ABI, and is not easily fullfilled when handlers are called from C
and not asm. In particular, the struct frame is passed by value but is
modified by callees, with the expectation that the caller will see the
modifications.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55679
fdc1f34506346fd26db8bfb80ba69d1af844c53a Konstantin Belousov 2026-02-27 03:54:06
use ASMC_FAN_FUNCS2 to avoid trying to read non-existent keys
Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2051
cecd12ac3b4d98bd52dc0e802a4a38bc72f50e2c tslight 2026-02-26 07:44:44
Add ASMC support for Macbook Pro 8,3
Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1992
16c82e28404ec959a7335ceae1d4f43881a50d9e tslight 2026-01-27 16:44:40
hwpmc: Remove left over k7, xscale and p4 references pmc
Support for these processors was removed a few years ago, but a few
references remain that should be removed.

Sponsored by: Netflix
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2039
e409e51f83963beaeb95eec82c5f43e44545d6b9 Ali Mashtizadeh 2026-02-20 21:05:41
Commit group #24: acpi_system76: Support for acpi-controlled buttons on System76
acpi_system76: Support for acpi-controlled buttons on System76

Add acpi_system76 for handling acpi-controlled buttons
on System76 Laptops.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55694
cdad55809ef59239c3bbdc841ed307db68bb3971 Pouria Mousavizadeh Tehrani 2026-03-06 17:15:49

acpi_system76: unbreak LINT

Reported by: tinderbox
Fixes: https://cgit.freebsd.org/src/commit/?id=cdad55809ef5 ("acpi_system76: Support for ...")
Differential Revision: https://reviews.freebsd.org/D55694
fa4f625ed854cec2d7657783b955426fce8ff9ba Pouria Mousavizadeh Tehrani 2026-03-07 19:15:40
cxgbe: Shrink the size of csum_types
The checksum types fit in 4b and don't need a full 32b int.

MFC after:      1 week
Sponsored by:   Chelsio Communications
164bddf01b5718c6aec73be112b4dada78934c68 Navdeep Parhar 2026-03-08 19:34:32
cxgbe(4): minor changes in code dealing with ncores
1. ncores and devlog information is read as a combination so it makes
   sense to validate them in the same routine (and nowhere else).
2. ncores is never 0 and idx % ncores is always a valid coreid.

MFC after:      1 week
Sponsored by:   Chelsio Communications
8f72d933cd18664c73b92f282503017bc6c87cf9 Navdeep Parhar 2026-03-08 19:59:07
acpi_system76: Add support for battary charge thresholds
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D55710
f87ba4522ec9e7b2227b8f20f3a4d7c6a129da1c Pouria Mousavizadeh Tehrani 2026-03-07 18:33:43
acpi_system76: Add backlight(9) support for keyboard
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D55716
105869a2c78d21f310a8f271eaa510acea045805 Pouria Mousavizadeh Tehrani 2026-03-07 22:40:21
usb: umass: add SCSIEJECT quirk and fix RTW8821CU_CD (USB mode switch)
Several Realtek (and lots other) USB dongles present themselves as
CDROM device first.  Upon eject they do a mode switch and suddenly
are a different kind of device (sometimes even with different IDs),
e.g., a wireless dongle.

In order to avoid the CDROM stage and rather than adding the quirk
handling to more drivers, add support to umass and if enabled
automatically eject the "CDROM" to make it the real device.

Longer-term some other drivers could stop using their hand-rolled
support for this.  It is unclear as-to how much we need the list of
(eject) quirks from u3g here, or if these are very specific to that
kind of devices.

Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=b3b6a959c85a, https://cgit.freebsd.org/src/commit/?id=9c0cce328363
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D54901
b4daeded66b5e950ed8e618d66915b863c2414b1 Bjoern A. Zeeb 2026-01-26 13:19:37
virtio: Restore mb() calls
Until an issue seen on amd64 can be investigated restore two mb() calls
to virtio.

Reviewed by:    andrew
Fixes:  https://cgit.freebsd.org/src/commit/?id=c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations")
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55766
1a92fc9c1210f9c99a19fda5a86682a78d39872f Sarah Walker 2026-03-10 19:08:38
ena: Minor changes
1. Move parenthesis to correct place in switch and fix include order
2. Add comment at the end of an ifdef for clarity
3. Change include order.

MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D55696
2667a8454cff5896c7b467c78cd4ace5ad40f5eb Arthur Kiyanovski 2026-02-13 22:27:59
ena: Verify that an ENA ring is in netmap only in native mode
netmap operates in two modes:
1) Emulated - netmap handling is done by the network stack, the
NIC driver operates transparently to netmap.
2) Native - netmap management is done by the NIC driver.

When checking whether a specific ENA ring is running in netmap
mode, only the following checks were done:
1. IFCAP_NETMAP - Check whether netmap capability is enabled on
the device.
2. NKR_NETMAP_ON - Check whether netmap is actively using this
ring.

The above checks implied that the netmap mode is native and the
ENA driver needs to handle the netmap logic.
The code was missing an explicit check on whether native mode
is actually on (NAF_NATIVE).
This led to a case where though emulated mode was used and
a netmap application was turned on, the ENA driver still managed
netmap logic partially and caused missing buffers and lack of
refill as part of the datapath.

Note: Enabling netmap emulated mode is insufficient and there's
a need to load a netmap program in order to trigger this use-case.

Add an explicit check of whether NAF_NATIVE mode is set.

The issue was reported in [1].

[1]: https://github.com/amzn/amzn-drivers/issues/361

Fixes: https://cgit.freebsd.org/src/commit/?id=358bcc4c6cde ("Add support for ENA NETMAP partial initialization")
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D55697
97e84c587d6f86aa883720296449b380adcf6915 David Arinzon 2026-02-05 14:21:13
ena: Update driver version to v2.8.2
Bug Fixes:
* Verify that an ENA ring is in netmap only in native mode

Minor Changes:
* Move parenthesis to correct place in switch
* Add comment
* Reorder define

MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D55698
96c5eaf0ac6b98d0832e1037d672064de43a7e00 Arthur Kiyanovski 2026-02-13 05:32:22
libpmc: Explicitly whitelist json fields
Adds all missing Intel fields and turns jevents.c into an explicit white
list mechanism so that we no longer ignore important fields that often
invalidate the counter.  The json event parser must now parse every
field on each architecture that we support.  This has been tested by
running tinderbox and manually running jevent against our current json
repository.  As a bonus I fixed spelling errors in the AMD JSON
definitions.

Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2055
bfb2fd5f66183454cfe8771595df09c0f23c7efb Ali Mashtizadeh 2026-02-28 20:45:27
amd64: Make start_all_aps() static
It is not used elsewhere since the change [1].

[1] ac3ede5371af x86/xen: remove PVHv1 code

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55668
5f0ab9d9e965225c4af0c6ed481e01eee0ffab8f Zhenlei Huang 2026-03-12 04:24:59
hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases
The previous code subtracted AMD_PMC_PERFCTR_0 (0xC0010004) from all
perfctr MSR addresses to compute a relative offset. This is incorrect
for counters using AMD_PMC_CORE_BASE (0xC0010200), AMD_PMC_L3_BASE
(0xC0010230), and AMD_PMC_DF_BASE (0xC0010240), producing wrong offsets.

Fix by promoting amd_core_npmcs, amd_l3_npmcs, and amd_df_npmcs to
static module-level variables and computing the correct flat RDPMC
index per AMD BKDG 24594 page 440:

ECX 0-5:   Core counters 0-5
ECX 6-9:   DF counters 0-3
ECX 10-15: L3 Cache counters 0-5
ECX 16-27: DF counters 4-15
ECX > 27:  Reserved, returns EINVAL

Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne
Sponsored by:   NLINK (https://nlink.com.br), Recife, Brazil
Fixes:  https://cgit.freebsd.org/src/commit/?id=37bba2ad92d8 ("hwpmc_amd: Add support for additional counters")
Differential Revision:  https://reviews.freebsd.org/D55607
ce9aff829e02c9a21c04eae77a45f2193d1ed5a1 Paulo Fragoso 2026-03-12 15:21:33
sound: enforce MASTER volume mute during playback
MASTER mute (vol.mute) works while audio is playing. However, if a
stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the
audio will resume even though the mixer shows the MASTER volume as
muted. Other streams that are already playing remain silent. New streams
may also start playing audio regardless of the MASTER mute state.

The volume feeder now considers the MASTER mute when determining whether
a channel should be muted. This ensures MASTER mute is consistently
enforced for all streams and removes the dependency on trigger-driven
state propagation.

Tested with Creative Labs CA0132 card.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D55605
ac5ff2813027c385f9037b47b2b164d4c1bebd09 Sean Farley 2026-03-12 18:22:02
ix(4): Add EEE support for E610 adapters
The ix driver now supports Energy Efficient Ethernet (EEE) on Intel
E610 devices. EEE allows the network interface to enter low-power
states during periods of low link utilization, reducing power
consumption while maintaining full performance when needed.

E610 adapters provide EEE support through BASE-T PHY functionality.
Due to this PHY-based implementation, EEE is supported only
on 2.5Gb speeds and above.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Authored-by: Yogesh Bhosale <yogesh.bhosale@intel.com>

Approved by:    kbowling (mentor)
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D55304
13ee84c591f8df7553fc8e3dac7e92409046f4d2 Krzysztof Galazka 2026-03-13 11:48:12
i6300esbwd: Set error appropriately on event
Per the watchdog driver contract, if the driver successfully arms the
watchdog it must set error to 0, and if it's unable to arm the watchdog
it must leave error alone.

Sponsored by:   Hewlett Packard Enterprise
703901bce15bdd746cb20ab3fc88f5859924cf76 Justin Hibbits 2026-03-13 18:49:17
Commit group #25: amd64: move efirt trap checks into the helper
amd64: move efirt trap checks into the helper

Reviewed by:    imp, jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55808
914a53570750ce5a104a5870403d7669656fddc3 Konstantin Belousov 2026-03-11 11:53:52

amd64: do reset %rip after page fault if pcb_onfault is set

for any kernel page fault, and not only for EFIRT case.

Reported and tested by: pho
Fixes:  https://cgit.freebsd.org/src/commit/?id=914a53570750ce5a104a5870403d7669656fddc3
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
8365f877b1e4b6d4c30df72e0826ca60a412ce7d Konstantin Belousov 2026-03-14 11:40:07
amd64: move code to clear PSL_T on debug exception into a helper
Reviewed by:  jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55827
d92ebde76430e99f78156fb1d865a18916380aed Konstantin Belousov 2026-03-12 09:40:44
x86 FRED: add CPUID, MSR, and CR4 bits
Reviewed by:  jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55810
eb0a78f6cef0c2924b565d7c297cb08bb4de7cb0 Konstantin Belousov 2026-02-07 10:22:22
acpi_system76: Improve sysctl names
* Improve sysctl descriptions.
* Rename battery charging-threshold sysctl for clarity.
* Fix mis-spelled words.
* Style: sort headers.

Reported by: olce, jhb
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D55848
f91464171d615b7e7720ac9ed67e2e86392d1b41 Pouria Mousavizadeh Tehrani 2026-03-13 19:23:03
rtlbtfw(8): Add support for Realtek 8852CE
Add the USB Vendor/Product ID (0x13d3:0x3612) for
the new Realtek 8852CE drive to make sure it works.

Signed-off-by: Ying Xu <fakeshadow1337@gmail.com>
Reviewed by: pouria, wulf
Pull Request: https://github.com/freebsd/freebsd-src/pull/2071
2e9366982798144764159f9c0faced5f0e208b85 Ying Xu 2026-03-11 07:55:45
ure(4): Fix spurious link flaps from MII
A race condition in the MII layer causes spurious link down events.
In `statchg`, on link down, check if the PHY reports the link as
actually down using the BMSR register, if not, force the status of the
link to back up and restart TX. Do the same in a MII `linkchg` handler.
On actual link up, restart TX in case it went idle and down.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252165
Signed-off-by:  Rafael Kitover <rkitover@gmail.com>
Reviewed by:    pouria
Differential Revision: https://reviews.freebsd.org/D55682
33e0568d30a687b3bbd3f00fd9b323ff031e39a2 Rafael Kitover 2026-03-16 10:32:17
nvme: Removed unused 'regs' variable
The private struct has a 'regs' member that's only written to
and otherwise unused. This change removes it.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=b3d9e5013f3e5 (Don't active memory space)
Requested by:           jhb
Reviewed by:            imp, jhb, jrtc27
Differential Revision:  https://reviews.freebsd.org/D55817
4e3beef84628ce6dfea7f053cddf3289fddf7794 Matt Delco 2026-03-10 19:30:51
nvme: Replace bus_space_[read|write]_4 with bus_[read|write]_4
The goal this change is to remove the use of the tag and handle
needed by bus_space_[read|write]_4.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=b3d9e5013f3e5 (Don't active memory space)
Requested by:           jhb
Reviewed by:            gallatin, imp, jhb, jrtc27
Differential Revision:  https://reviews.freebsd.org/D55818
889d10d5b12050b4b3923917b5edeac85e8ca706 Matt Delco 2026-03-10 20:12:56
jevents: include file path in whitelist error message
A small enhancement.

Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55830
f0e0c4c52971f58d41a89690d402520500d286bd Mitchell Horne 2026-03-16 23:25:00
libpmc: Query hwpmc for caps
This change allows for fine-grained capabilities per counter index. This
is particularly useful for AMD where subclasses are not exposed to the
general PMC code, but other architectures also have asymmetric behaviors
when it comes to specific counter indices.

A new PMC_OP_GETCAPS op is added to the hwpmc(4) ioctl interface.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2058
44a983d249d05d932b6cff333f130baf70febc22 Ali Mashtizadeh 2026-03-01 22:08:30
pmc.h: bump PMC_VERSION_MINOR
Bump for the addition of PMC_OP_GETCAPS and the recently added Intel
CPUs.

Sponsored by:   The FreeBSD Foundation
e39d3a6b32331437da6c13a4aeb67e5bcca67625 Mitchell Horne 2026-03-16 23:35:35
virtio: Ensure power-of-two alignment for indirect queue
Some platforms enforce power-of-two alignment for bus_dma tags. Rounding up
the natural size may result in over-alignment, but should be safe.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293770
Reviewed by:    andrew
Fixes:          https://cgit.freebsd.org/src/commit/?id=c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations")
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55843
1d13d938fe6c7639d2bb4cb5248a1f81275b6891 Sarah Walker 2026-03-17 10:54:30
arm64: Have a common call to userret
Rather than each exception calling userret use a common copy. As
syscallret already calls userret we need to skip it in that case.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55250
14e97448fcebbe4b038eaf5628933abe5f9e690d Andrew Turner 2026-03-17 17:10:07
cxgbe(4): adjustments to the output of the slow interrupt handler
- Display an appropriate alert character instead of a question mark for
  unknown bits.
- Display all fatal bits for a register and not just the ones that are
  currently set.

MFC after:      1 week
Sponsored by:   Chelsio Communications
63171222540e10a58f3acacf65a412f44043f511 Navdeep Parhar 2026-03-18 21:56:37
cxgbe(4): decode the T7 MC interrupt correctly
The layout for the main INT_CAUSE is a bit different for T7.

MFC after:      1 week
Sponsored by:   Chelsio Communications
8f41ee95f9e05b3848d793deaacd591ee2387f0e Navdeep Parhar 2026-03-18 22:20:07
tpm: fix multi-threaded access with per-open state
The TPM driver currently has a single buffer per instance to hold the
result of a command, and does not allow subsequent commands to be sent
until the current result is read by the same OS thread that sent the
command, with a timeout to throw away the result after a while if the
result is not read in a timely fashion.  This has a couple problems:

 - The timeout code has a bug which causes all subsequent commands to
   hang forever if a different OS thread tries to read the result
   before the OS thread which sent the command, and the OS thread
   which sent the command never tries to read the result.

 - Even if the first problem is fixed, applications expect to be able
   to read the result from a different OS thread than the OS thread
   which sent the command. The particular case that we saw was a go
   application where the go runtime scheduled the goroutine which read
   the result to a different OS thread from one where the goroutine
   that sent the command ran, and there's no way to force these to
   always run on the same OS thread.

Fix all of this by replacing the global result buffer with a per-open
result buffer via devfs_set_cdevpriv(), so that we no longer need to
block subsequent commands until the results of a previous command are
retrieved or care about which OS thread is reading the result of a
command.

Sponsored by:   Netflix
Reviewed by:    olivier, imp
Differential Revision:  https://reviews.freebsd.org/D52328
1fd43ee968c497223254038483685d9f9c68791b Chuck Silvers 2026-03-20 18:48:44
amd64: move code to check for traps with interrupts disabled into helpers
Reviewed by:  jhb, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55809
e18449fbe2731399862e82e61fffaadd6739642c Konstantin Belousov 2026-03-11 12:04:55
amd64: check that %cs and %ss values from ucontext fit into registers
This change only checks that the values from the user-supplied context
are not truncated by C implicit type convertions.  The validity of the
segment selectors is still checked by hardware.

Reviewed by:    jhb, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55861
8892176c86db18bd175cc00a2d52dff080babec1 Konstantin Belousov 2026-03-15 07:17:24
x86 FRED: add hardware definitions for the trap frames fields
as provided by the Intel document 346446-009 AKA FRED 8.0 and SDM v90,
February 2026.

Note that the layout of the struct trapframe does not change with
FRED. The differences are in addition of two fields at the end of the
structure. Other members are carved from existing tf_cs and tf_ss by
limiting hw-written segments to 16 bits officially, and reusing rest
from the doubleword for the new data.

Reviewed by:    jhb, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55831
e90950627327de9226b052851b36f341bc72b746 Konstantin Belousov 2026-02-07 03:35:17
amd64: remove assertion about sizeof(struct pcb)
We no longer put pcb on stack, it is part of the struct thread.
Similarly, we do not put user fpu save area on stack.  There is no
constraints on the pcb size due to the XSAVE area required alignment.

Reviewed by:    jhb, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55931
acce5fa3dbe87ea953fb5060a03859e424398db8 Konstantin Belousov 2026-03-19 03:43:01
amd64: add prototype for ia32_syscall()
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
23dc4850fbc9e7abfc54f0ce11f343e4677fd0fb Konstantin Belousov 2026-02-26 00:55:59
amd64 trap.c: provide tag for the struct sfhandlers definition
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
8cc1c0f35ec8d5a3edb4ee1ede962a3c1f6baef0 Konstantin Belousov 2026-03-03 06:37:03
acpi: Print sysctl name in deprecated sleep type warning
Reported by:  markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=97d152698f48 ("acpi: Use sleep types defined in sys/power.h")
Event:          AsiaBSDCon 2026
Sponsored by:   The FreeBSD Foundation
66447abae8bb5d2e7b09a72bdea95033d9b1867a Aymeric Wibo 2026-03-21 03:15:03
acpi_spmc: Simplify constraint freeing
We don't need to check for NULL before calling free().

Sponsored by:   The FreeBSD Foundation
a87bde85232e60771691649fd5718a6de5453e59 Aymeric Wibo 2026-03-21 05:19:21
amd64: revert back struct trapframe to the pre-FRED definition
Trying to use the grown struct trapframe for IDT case broke in cases
where code supposed that hardware consumed sizeof(struct trapframe) of
the stack space when delivering interrupt or exception.  In particular,
this was broken for #NM/#DB/#MC.  Naive attempt of using IDT-trapframe
size for stack consumption caused later problems with larger C type.

Instead of pretending that IDT event delivery pushed two never-accessed
doubleword to the stack, keep it honest and provide separate type for
the FRED interrupt frame, i.e. struct trapframe_fred.

Convert between trapframe_fred and trapframe can be done by trivial pointer
arithmetic.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
1ba29614c4ce5e261ade0bd7def94079b7b9647a Konstantin Belousov 2026-03-21 22:26:48
hwpstate_amd: Refactor the cpufreq code by using delegation pattenr
We separate the code of CPPC and legacy pstate driver to make it easier
to read.

Reviewed by:    olce
Approved by:    markj (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55604
191f47bcd65097599a962b46ae293e5ebe4e5b67 ShengYi Hung 2026-02-24 07:22:52
mlx5: postpone freeing the completed command entity to taskqueue
because cancel_delayed_work_sync() might need to sleep, which cannot be
done in the interrupt thread where the completion runs.

Sponsored by:   Nvidia networking
MFC after:      1 week
f0d5f46a1e42b801d96447e544cc3820612748b1 Konstantin Belousov 2026-03-10 07:32:00
nvmf: Fix null ptr reference
Reported by:  Nikolay Denev <ndenev@gmail.com>
Reviewed by:    imp, jhb
Differential Revision:  https://reviews.freebsd.org/D55863
09c5bb35425bc70573c007e7f7e82be286677a87 Mariusz Zaborski 2026-03-23 14:37:28
hwpmc: Use rdtsc instead of rdtscp for timestamps
No need for a barrier here, we are inside an NMI handler and executing a
number of serializing instructions with stronger semantics. Reducing
this overhead will increase our maximum safe sampling rate.

Tested by:      Paulo Fragoso <paulo@nlink.com.br>
Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2076
39515d8b623a2be39d0c42a537fd9a17c417ff6e Ali Mashtizadeh 2026-03-23 20:21:21
libpmc: Add support for IBS qualifiers
Add support to libpmc for parsing the IBS qualifiers and computing the
ctl register value as a function of the qualifiers and the sample rate.
This includes all of the flags available up to AMD Zen 5.  Along side
these user facing changes I included the documentation for AMD IBS.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2081
df47355fae720fd8f63f36a50c8933f8342483d2 Ali Mashtizadeh 2026-03-18 04:27:09
hwpmc: improve diagnostic messages for invalid tunables
Replace printf() with log(LOG_WARNING, ...) in pmclog_initialize()
so that tunable validation failures are visible in dmesg and
/var/log/messages rather than only on the early console.

Also improve the messages to report both the invalid value and the
default it resets to, making it easier for users to understand why
their tunable was ignored.

While here, adjust some whitespacing/style.

Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne
MFC after:      1 week
Sponsored by:   NLINK (nlink.com.br)
Differential Revision:  https://reviews.freebsd.org/D56029
b3a18736ec2fc2bd097995dedd8d09e79bcb2056 Paulo Fragoso 2026-03-23 14:54:18
hid/hgame: Fix desync in hgame_dpad_cb()
hgame_dpad_cb() previously exited early whenever conflicting directions
were input (e.g., UP + DOWN) without saving said input to the
hgame_softc state. This led to a desync between the driver and the
gamepad.

This patch instead handles conflicting inputs by cancelling them out
with each other.

Remove early return. Calculate axis value by subtraction.

Reviewed by:    obiwac
Approved by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D55849
c586944fa20899ab0f6b58b550e753d13d889c5b Majed Alkhaleefah 2026-03-24 06:37:09
acpi_spmc: Fix checking expected DSMs
Previously was or'ing the indices of the DSMs directly, not their
corresponding bits. This commit rectifies this.

Reviewed by:    olce
Approved by:    olce
Fixes:  https://cgit.freebsd.org/src/commit/?id=c5daa5a4c32c ("acpi_spmc: Add system power management controller driver")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/https://reviews.freebsd.org/D56062
d8a8c890a1a3a003dbd12ec0235304db7fbe9e6e Aymeric Wibo 2026-03-24 07:25:50
pmc: Import Intel Meteor Lake events
Obtained from:        Intel perfmon (JSON event definitions)
Tested by:      bms, olivier
MFC after:      1 week
Reviewed by:    ali_mashtizadeh.com, mhorne
Differential Revision:  https://reviews.freebsd.org/D55641
cb9e24221672a7f77c858518c292c1eac09b3740 Bojan Novković 2026-03-02 21:45:11
libpmc/pmu-events: Add support for new json fields
This change adds support for three new Intel fields to jevents.c:
 - MetricThreshold
 - MetricgroupNoGroup
 - DefaultMetricgroupName

Reviewed by:    ali_mashtizadeh.com, mhorne
Differential Revision:  https://reviews.freebsd.org/D56017
MFC after:      1 week
6ad94d549eb2286d791abd5634400d8ef36d8259 Bojan Novković 2026-03-21 14:37:44
Commit group #26: snd_uaudio
snd_uaudio: Rename umidi_probe() to umidi_attach()

This performs an attach, not probe.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55900
e67dbccc70046a6f6d8f34c11fd01972b22920c5 Christos Margiolis 2026-03-24 10:30:42

snd_uaudio: Rename uaudio_hid_probe() to uaudio_hid_attach()

This makes more sense.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
0a7749d9436e111c882a16eed1531267943186b4 Christos Margiolis 2026-03-24 10:30:51

snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55918
039477d3e7e72285174d83b973e58cea8de85280 Christos Margiolis 2026-03-24 10:30:58
sound: Match midi_write() return values with midi_read()
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55920
a49e925489fba23878b3004b2bff7549dc2f2bcb Christos Margiolis 2026-03-24 10:31:08
snd_uaudio: Retire UAUDIO_MAX_CHAN()
It's a no-op.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55924
a2fd964a95829c0225031fb317202d4acc2d6ce9 Christos Margiolis 2026-03-24 10:31:12
sound: Retire SND_MULTICHANNEL
SND_MULTICHANNEL is always defined, so SND_CHN_MAX will also always be
8. Apart from the fact that there is no other place in the code that
touches SND_MULTICHANNEL, there is also no good reason nowadays to set
SND_CHN_MAX to 2.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55934
712bd9b2750a71ad7f8b6bebc5177c47d33a6364 Christos Margiolis 2026-03-24 10:31:26
sound: Retire unused Z_MULTIFORMAT
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
12633057f5914a533df81030b553d6bd47681d87 Christos Margiolis 2026-03-24 10:31:29
sound: Remove most Z_RATE_* aliases
They introduce an extra level of abstraction for no reason at all.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56041
0ee95151931688e3d321ea7fb13e037b211a40ba Christos Margiolis 2026-03-24 10:32:17
sound: Retire Z_PARANOID
It is always defined.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56042
6b91c8d5d2c35c4c6231eb172b514f95ce6e10d7 Christos Margiolis 2026-03-24 10:32:22
rge: handle interface flags changes
Handle interface flags like other drivers do.

Reviewed by:    zlei, adrian
Differential Revision:  https://reviews.freebsd.org/D55728
f7fd4e79fa0943446aa5900147f737a70c73d9e3 Brad Smith 2026-03-25 01:22:52
rge: make rx_process_limit a sysctl tunable
The number of packets processed per interrupt was hardcoded to 16.
Add a per-interface sysctl dev.rge.%d.rx_process_limit tunable so
users can adjust this value at runtime.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    ziaee, adrian
Differential Revision:  https://reviews.freebsd.org/D56014
930a790c2abb3680a3449a1f9ce2eff2be7acc36 Christos Longros 2026-03-25 01:27:14
kern/amd64/machdep: Replace memset in wrmsr_early_safe_end
GENERIC-KASAN kernel failed to boot on a Dell PowerEdge C6615 with
an AMD EPYC 8224P CPU; UEFI BIOS caught a #GP exception with %RIP
in kasan_memset where %GS relative pointer (curthread->td_pflags2)
was dereferenced. Investigation led to wrmsr_early_safe_end which
calls memset to clear early #GP IDT entry. Replacing memset with
__builtin_memset_inline still resulted in the compiler emitting a
call to the memset resolver in GENERIC-KASAN build and the kernel
stil faulted during boot. This version which has been successfully
tested with both GENERIC and GENERIC-KASAN kernels uses memset_early.

Signed-off-by: Kristofer Peterson <kris@tranception.com>
Reviewed-by: kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2069
615f1b9eb17c921bbcb0cce2b9ad61910361325b Kristofer Peterson 2026-03-09 19:40:34
Commit group #27: ufshci
ufshci: fix bug in ufshci_req_sdb_enable

When enabling the request queue, safely reset the list base address.
This was added due to a quirk in the Qualcomm UFS controller during
the process of activating it.

Sponsored by:           Samsung Electronics
Reviewed by:            imp (mentor)
Differential Revision:  https://reviews.freebsd.org/D55984
c4386988baa2ecdcb482c8ccace183dc643d097c Jaeyoon Choi 2026-03-24 05:12:14

ufshci: add uic powermode parameter to sysctl

Adds parameters related to the performance of the UFS device.
Also update man page for the missing sysctl entries.

Sponsored by:           Samsung Electronics
Reviewed by:            imp (mentor)
Differential Revision:  https://reviews.freebsd.org/D55985
085028463fa92b28939c87d0a14337fc14f394a0 Jaeyoon Choi 2026-03-24 05:14:04

ufshci: Support ACPI

Supports UFS host controller attachment via ACPI. Tested on the
Samsung Galaxy Book 4 Edge using Qualcomm Snapdragon X Elite.
Additionally, a quirk related to power mode change has been added.

For reference, it doesn't reach maximum speed yet. I plan to improve
it later.

Sponsored by:           Samsung Electronics
Reviewed by:            imp (mentor)
Differential Revision:  https://reviews.freebsd.org/D55986
e2083e8d3a01cac739b38521abc72620d3810aba Jaeyoon Choi 2026-03-24 05:16:26
pmc: Fix copyright in previous commits
Fix the copyright attribution to Netflix and the date and missing SPDX
line in pmc.ibs man page.

Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2094
98bedca0a4effed7f170be52f7ef3e1ab8a79b11 Ali Mashtizadeh 2026-03-25 18:51:21
x86: Guard clock frequency against a divide by 0
We may be running in a Virtual Machine which may not fully support
hardware performance counters. If the MPERF counter somehow ends up
at zero, return an error and fail gracefully instead of panicking.
This patch is part of Google Cloud Engine (GCE) C4-LSSD turnup.

Sponsored by:           Google
Tested by:              NetApp (previous)
PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292808
MFC after:              3 days
Co-authored-by:         Aymeric Wibo <obiwac@google.com>
Co-authored-by:         Jim Mattson <jmattson@google.com>
Suggested by:           jrtc27 (split out this part)
Reviewed by:            imp, obiwac, olce
Differential Revision:  https://reviews.freebsd.org/D56056
c505fc1468849150f48484b225b6476d8316de57 Matt Delco 2026-03-26 17:22:54
x86: Handle when MPERF/APERF MSRs aren't writable
For performance and/or correct reasons some hypervisors allow
MPERF/APERF MSRs to be read but not written to. This change
modifies the handling of these MSRs to not rely on writes.
This patch is part of Google Cloud Engine (GCE) C4-LSSD turnup.

Sponsored by:           Google
Tested by:              NetApp (previous)
PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292808
MFC after:              3 days
Co-authored-by:         Jim Mattson <jmattson@google.com>
Reviewed by:            jrtc27, imp, kib, markj, olce, obiwac
Differential Revision:  https://reviews.freebsd.org/D55996
7e7d4e711ff94d114c93fd522d4125aa9bd9f5cd Matt Delco 2026-03-26 17:30:31
x86: move the NUM_ISA_IRQS symbol from atpic.c into x86/isa/icu.h
This is not the best location, but works for now.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56003
5f08cdc1fb62d157b6086b3ea844287e81e3c45d Konstantin Belousov 2026-02-27 04:32:58
uart/pci: support 16550A PCI serial devices
Expand the current check to also attach the ns8250 driver to devices
reporting as 16550A.  This has been tested to work on a real device.

From an inspection of the code in the ns8250 driver it seems like it should
support up to 16950A devices, but I don't have hardware to ensure that,
hence be conservative with the change.

MFC: 2 weeks
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D56095
1491fe8f864af5af37e83f1d12459905fb6097fd Roger Pau Monné 2026-03-26 10:01:57
uart/pci: always disable MSI for generic devices
The generic device pci_id structure in uart_pci_probe() already has
PCI_NO_MSI appended to it's flags, however that information is not
propagated into uart_pci_attach().

Assume that any device that doesn't match the known IDs is a generic UART
device, and hence prevent the usage of MSIs.

MFC: 2 weeks
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D56097
c562c81e315cd25bd35d5ece14ef9a3cb569cab5 Roger Pau Monné 2026-03-26 19:59:24
i386/amd64/NOTES: Add some missing devices
The following devices to x86: ocs_fc aq vge tws
And this to amd64: ufshci

These are in GENERIC, but not NOTES.

Sponsored by:           Netflix
72bb61bac72eabb2e9de16206a68cde523eb59ba Warner Losh 2026-03-28 04:42:18
clapic_handle_intr: KASSERT isrc != NULL
If an interrupt arrives at a CPU which isn't expecting that particular
vector, intr_lookup_source will return an isrc of NULL and we'll panic
when intr_execute_handlers increments *isrc->is_count.

Place a KASSERT a few nanoseconds earlier in order to leave some more
breadcrumbs for the next person to trip over this behaviour.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55851
f350063a251c9da0c5ce437eb4c44a2d716b673e Colin Percival 2026-03-14 01:03:44
x86: Add struct ioapic_intsrc.io_valid
As of this commit, io_valid is always set to 1; but a future commit
will set it to 0, at which point IOART_INTMSET will be set to forcibly
disable interrupt sources regardless of whether they are requested to
be "masked".

Reviewed by:    kib
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D56006
1d0ccd61563d48e914dccf3dd5cf0280d8331ec1 Colin Percival 2026-03-20 22:02:29
io_apic: Don't route to APIC ID > 255
I/O APIC Redirection Table Entries use 8 bits to encode the Destination
ID.  Attempting to route an IRQ to a higher APIC ID would result in it
being silently routed to the value reduced modulo 256, causing a panic
if the IRQ fired since the receiving CPU would not expect that IRQ.

Instead, print a warning and mark the interrupt as invalid, resulting
in it being forcibly masked.

Reviewed by:    kib
Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55857
5809c9a77b2d3b83c056ba3ac5ba4e261c0af595 Colin Percival 2026-03-14 05:51:04
x86: Add stub for Extended Destination ID support
Without an IOMMU, the APIC standard only allows 8 bits of Destination
ID for MSI messages, limiting us to 256 CPUs.  While IOMMUs can allow
for more than 256 CPUs to be supported, they are not necessarily
desirable in virtualized environments.

The Extended Destination ID standard authored by David Woodhouse uses
7 "Reserved" bits for the high bits of a 15-bit Extended Destination
ID in order to address this: http://david.woodhou.se/ExtDestId.pdf

Add a loader tunable machdep.apic_ext_dest_id to control the use of
this feature; the default value (-1) means "autodetect" while 0 and
1 mean disabled and enabled respectively.

Code to detect host support in Xen, Hyper-V, KVM, and Bhyve will come
in future commits, as will the code to use this setting in msi_map and
ioapic_program_intpin.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55890
d9db6d759dfcf4a4559e66e777599bb3fa8ca14c Colin Percival 2026-03-16 23:37:04
msi: Support APIC Extended Destination IDs
If APIC Extended Destination ID support is enabled, use it in MSIs by
allowing APIC IDs up to 2^15 - 1 and encoding the high bits into
Intel "reserved" bits per the standard.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55426
02f29c1324cf5193c3aec181cb409917b541f7fe Colin Percival 2026-02-22 04:08:59
io_apic: Support APIC Extended Destination IDs
If APIC Extended Destination ID support is enabled, use it in APIC RTEs
by allowing APIC IDs up to 2^15 - 1 and encoding the high bits into
Intel "reserved" bits per the standard.

Reviewed by:    kib
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55889
b0e1b1069d655f12ab69cf3a1dc1904dd35ad1da Colin Percival 2026-03-16 23:45:32
KVM: Detect Extended Destination ID support
KVM advertises support for the Extended Destination ID standard via
bit 15 of the value returned in the EAX register when KVM features
are queried via CPUID.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55427
9ab5aa3d4c7879d5518afc7587a864ba880e7ee9 Colin Percival 2026-02-22 04:09:00
Xen: Detect Extended Destination ID support
Xen advertises support for the Extended Destination ID standard via
bit 5 (aka XEN_HVM_CPUID_EXT_DEST_ID) of the value returned in the
EAX register when Xen features are queried via CPUID.

MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55429
9b18ba2c16a0750e6c78f348845368284ef1a704 Colin Percival 2026-02-22 04:09:00
vmm: Move defines from x86.c to x86/bhyve.h
The values CPUID_BHYVE_FEATURES and CPUID_BHYVE_FEAT_EXT_DEST_ID are
useful for guests, not just hosts; so they belong in a header file in
sys/x86/include rather than simply in the .c file implementing the
bhyve host side.

The original addition of these defines took place without adding a
copyright statement, but since I'm moving them into a new file I've
added the original author's standard copyright (Amazon).

MFC after:      3 weeks
Fixes:  https://cgit.freebsd.org/src/commit/?id=313a68ea20b4 ("bhyve: Add CPUID_BHYVE_FEATURES leaf")
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55430
49b6254b3e09ee741f456617111ecb18803459fb Colin Percival 2026-02-22 04:09:00
Bhyve: Detect Extended Destination ID support
Bhyve advertises support for the Extended Destination ID standard via
bit 0 (aka CPUID_BHYVE_FEAT_EXT_DEST_ID) of the value returned in the
EAX register when Bhyve features are queried via CPUID.

MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55431
8dd9a0d52175fbc5dafed851fb95a289a94fb6cd Colin Percival 2026-02-22 04:09:00
Hyper-V: Detect Extended Destination ID support
Hyper-V advertises support for the Extended Destination ID standard via
bit 2 of the value returned in the EAX register when the hypervisor
stack properties are queried via CPUID.

This is based on a commit to the Linux kernel, as there does not seem
to be any other documentation of this feature.

Reviewed by:    Souradeep Chakrabarti
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55432
7b6be0014a4eb81943491122bae70914b7fd82b6 Colin Percival 2026-02-22 04:09:01
usbdevs: Add USB device IDs for Nuand bladeRF SDR
Add vendor and product IDs for bladeRF family of USB software defined radios manufactured by Nuand LLC.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D54733
e7de7feb74262bfdb04d285846bac2fc6229f734 Abdelkader Boudih 2026-03-29 02:54:28
amd64 sendsig(): explicitly copy registers from trapframe to ucontext
With the IDT event delivery, previously reserved fields in tf_cs and
tf_ss are guaranteed to be zero. With FRED, these fields are not zero,
which affects the values copied to userspace.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56141
7d1285e904aa76ac821ac2a6a8eb61be598f0e88 Konstantin Belousov 2026-03-29 08:06:29
bluetooth: add device IDs for Intel AX411 and BE200 adapters
Add USB product IDs for Intel AX411 (0x0035) and BE200 (0x0036)
Bluetooth adapters to ng_ubt_intel, ng_ubt, iwmbtfw, and iwmbtfw.conf.

Both chips use the same TLV-based firmware protocol as the existing
9260/9560 entries.  Newer Blazar-generation chips (BE201, BE202,
Whale Peak 2) are omitted as they require IML support not yet
implemented in iwmbtfw.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    wulf
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56122
d82bcf5681dd180177d78fdcd1b8bbde5eadc29b Christos Longros 2026-03-29 13:16:57
hkbd(4): fix handling of apple function keys in hid and evdev
Signed-off-by: tslight <tslight@pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
f54caa04edd99e341fbb0636d2c621b4a2eb36bf tslight 2026-03-29 13:16:57
ukbd(4): backport Apple function keys support from hkbd(4)
and expose eject in addition to fn.

Signed-off-by: tslight <tslight@pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
40f55eada59250dd5d9580ad3c87a36ae9d6b4a9 tslight 2026-03-29 13:16:57
hkbd(4): be more cautious & explicit about Apple vendor checking
Apply the changes to ukbd(4) as well.

Signed-off-by: tslight <tslight@pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
103325323c7daf9fe6c9a6c71aa5c90974c9dff4 tslight 2026-03-29 13:16:57
hkbd(4): add some extra handy fn key bindings
- Fn+S for ScrollLock as it's very useful to have ScrollLock on
  FreeBSD's TTY.
- Fn+P for PrtSc/SysRq, as it's another very handy but sadly missing
  key on Macbooks.
- Some other Fn+<key> combinations duplicating existing keys.

Apply the change to ukbd(4) as well.

Signed-off-by: Toby Slight <tslight@pm.me>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
bb8230f838c8d5f8d362a0dad4809908b44ae379 Toby Slight 2026-03-29 13:16:57
ukbd(4): make debug guard consistent with hkbd(4)
Signed-off-by: Toby Slight <tslight@pm.me>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
920ad3cef178c9bea37c0d07c22440828a5cb7c8 Toby Slight 2026-03-29 13:16:57
dpaa2: Perform bus_dma pre-write sync before enqueue operation
Without a proper synchronization payload of the egress TCP segments
can be corrupted as tuexen@ described in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006#c31.

This patch is indirectly related to 292006 because a properly enabled
and announced support for the TX checksum offloading hides potentially
corrupted frame payload.

NOTE: Returned back with updated placeholders.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Reported by:    tuexen@
Reviewed by:    tuexen@
Tested by:      dsl@, tuexen@
Differential Revision:  https://reviews.freebsd.org/D56144
MFC after:      3 days
5812415bee55a9063508b02fda9418b0eadb0bb4 Dmitry Salychev 2026-03-28 18:57:45
asmc(4): Add PnP record
To load asmc(4) automagically on boot with devd(8).

MFC after:      1 month
056e29070f083ac4cea31ac0a08619add6370839 Vladimir Kondratyev 2026-03-29 19:00:59
Commit group #28: asmc(4): Add support for backlight(9) interface
asmc(4): Add support for backlight(9) interface

MFC after:      1 month
5d7862fb998f48ba71dac7e34106aaad350db348 Vladimir Kondratyev 2026-03-29 19:00:59

asmc(4): Bump manpage date after edition

Fixes:          https://cgit.freebsd.org/src/commit/?id=5d7862fb998f ("asmc(4): Add support for backlight(9) interface")
MFC after:      1 month
1c10825c6e5fd9a6cab364032458346866223d4f Vladimir Kondratyev 2026-03-29 19:03:41
bluetooth: remove redundant 0x0bda entries from ng_ubt_rtl, rtlbtfw
Generic Realtek vendor rules already match all 0x0bda Bluetooth devices.
Remove the redundant per-product entries from ng_ubt_rtl.c,
rtlbtfw main.c, and rtlbtfw.conf.

Reviewed by:    wulf
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D56137
f3fc362c0fb27731e2c22523e0cedf1adec26c44 Christos Longros 2026-03-29 19:00:59
vmm: Add missing AVX instructions for AVX512 in cpuid stdext
Reported by:    Tom <freebsd@fizz.buzz>
Reviewed by:    markj
Tested by:      Tom <freebsd@fizz.buzz>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56021
e6eba5076929d0b193c9c94b2658c7e8f5da0669 ShengYi Hung 2026-03-22 02:26:56
nvme_sim: Fix name in module version metadata
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=1e39b5d4833e ("nvme_sim: Attach as a child of nvme")
Sponsored by:   The FreeBSD Foundation
e220af9cee74082841db9e80cbb73f570f3a570f Olivier Certner 2026-03-30 09:17:04
acpi_apm: Narrow scope of ACPI_LOCK
This lock doesn't need to be held across seldrain/knlist_destroy.  It
is also redundant (and a bug) to hold it across knlist_add and
knlist_remove since it is the mutex for the knlist.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293901
Reported by:    Jiaming Zhang <r772577952@gmail.com>
Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55994
cc2715cf1f864345ab175db691d4e152d5fb84af John Baldwin 2026-03-30 13:38:54
snd_uaudio: Retire sndcard_func usage
This is effectively a no-op, as it does not make use of the
sndcard_func->varinfo field, so eventually ua_probe() always succeeds.

Also change ua_probe()'s value to 0. There is no need to return
BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
with bus_attach_children().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56160
0efd33382504d3172734fa21325fcabef9c7f063 Christos Margiolis 2026-03-30 14:13:16
amdsmu: Cezanne support
Add support for Cezanne chips.  The only real difference vs
Rembrandt/Phoenix is the idlemask register.

Also simplify getting IP block count by having this straight in struct
amdsmu_product and remove Strix Point from the list for now, as that
doesn't support S0ix and our driver can't handle that.

Reviewed by:    mckusick
Approved by:    mckusick
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55594
69124109c5a00bb748cd8d3e9ede7291b34b577c Aymeric Wibo 2026-02-28 15:43:26
acpi_spmc: Improve device description
"Low Power S0 Idle" doesn't mean that much. "System Power Management
Controller" is what "SPMC" stands for in the first place.

Sponsored by:   The FreeBSD Foundation
33e095ee097d6a18dca95b8fae4edbda405bbb20 Aymeric Wibo 2026-03-31 10:01:08
bcm2835_virtgpio: Add driver for virtual GPIO controller on some RPi models
This driver enables bcm2835-virtgpio GPIO controller found on RPi3B and
some CM boards. On which, the ACT (green) LED is connected to this
controller. It is essential for FreeBSD to have this driver to control
this LED.

It will be exposed via gpioled(4).

Reviewed by:    mhorne
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D51456
84c68dbb59df81d5371f0d1eea888d30561d428d Tetsuya Uemura 2026-03-30 15:24:38

Networking

Network-related commands, library, and kernel.

pf: sprinkle const over pf_addr_cmp()
Sponsored by: Rubicon Communications, LLC ("Netgate")
fb476c70311788dfd6850d73a3f8d9abb7c3d58c Kristof Provost 2026-01-02 14:10:53
bridge: Allow BRDGSIFVLANSET without IFBRF_VLANFILTER
Currently, we disallow BRDGSIFVLANSET when IFBRF_VLANFILTER is disabled.
There's no particular reason to do this, and it causes some undesirable
behaviour such as not being able to remove the tagged config on a member
after disabling vlanfilter on the bridge.

Remove the restriction so BRDGSIFVLANSET is always accepted.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292019
MFC after:      1 week
Reviewed by:    zlei, p.mousavizadeh_protonmail.com
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D54435
2e92aeede85c8986bd6f4dde65d2ac2449eccf51 Lexi Winter 2026-01-03 01:13:22
TCP Stacks, Improve rack to better handle reordering
With a recent bug in the igb (and a few other) driver LRO mis-queuing, rack did things ok, better
than the base stack, due to the rack reordering protections in rack, but there was still room for improvements.
When a series of packets are completely mis-ordered you often times can get the acks shortly after you have
entered recovery and retransmitted the first of the packets indicated in the sack stream. Then the cum-ack
arrives basically acking all those packets. If you look at the time from when you sent the packet to when the
ack came back you can quickly determine that the ack was not to what you just transmitted but instead
was original and you had a completely false recovery entry. Dropping out of that you can then restore the
congestion state and continue on your way. The Dup-acks that also arrive help increase your reordering windows
which makes you less likely to repeat the scenario.

Differential Revision:<https://reviews.freebsd.org/D53832>
138e74ceadb237cdd42fcda11ddef18b509f571d Randall Stewart 2026-01-05 16:30:22
Commit group #29: ipfw
ipfw: remove extraneous argument from ipfw_add_protected_rule()

This function is always called with unlocked IPFW_UH_LOCK.
e4e30d5a81367b96dc8255252b527d6a65bb43b3 Gleb Smirnoff 2026-01-05 18:03:10

ipfw: use sparse initializer for dynamic opcodes

No functional change.
bc9c45df1c29370e7bffd813987c08b2f6444b5d Gleb Smirnoff 2026-01-05 18:03:10

ipfw: make create_objects_compat() static

No functional change.
161db3a910a41dfae0eea93f49b08eb7e6253617 Gleb Smirnoff 2026-01-05 18:03:10
tcp: Unifidef use of rss software hash in syncache
Ever since "d9c55b2e8cd6 rss: Enable portions of RSS globally.."
exposed the RSS software hashing functions, it has been possible
to use them without "ifdef RSS".   Do so now in the syncache
so as to get flowids recorded.

Note that the use of the rss hash functions is conditional on IP versions,
so we must ifdef INET to ensure rss_proto_software_hash_v4() is available.

Fixes 73fe85e486d2
Sponsored by: Netflix
Reviewed by: glebius, p.mousavizadeh_protonmail.com, nickbanks_netflix.com, tuexen
Differential Revision: https://reviews.freebsd.org/D54534
21865c970888ad0e2cde06db843ae2a05af550e7 Andrew Gallatin 2026-01-05 19:54:35
ng_tty: avoid the sign extention of char
When c is compared to sc->hotchar, both undergo integer promotion, which
can lead to c being sign extended. Fix this by casting c to an unsigned
char.

Reviewed by:    kevans
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54544
9b2478f60bfda663c84b48e272a2293159e1b0a0 Ahmad Khalifa 2026-01-06 02:07:29
netstat: fix a segfault with --libxo
Fix a segfault when printing the "protocol" field.  The field-format and
encoding-format were expecting different numbers of arguments.

Also, fix the width of the tcp-state field in encoded output.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292228
Fixes:          https://cgit.freebsd.org/src/commit/?id=c2b08c13c20 netstat: add support for UDP-Lite endpoints
MFC after:      1 week
Sponsored by:   ConnectWise
Reviewed by:    tuexen, js, des
Differential Revision: https://reviews.freebsd.org/D54567
3b6615ec0332f901fcc9e9307f78717424f09c1e Alan Somers 2026-01-06 22:19:57
iflib: Drop tx lock when freeing mbufs using simple_transmit
Freeing completed transmit mbufs can be time consuming (due to them
being cold in cache, and due to ext free routines taking locks),
especially when we batch tx completions. If we do this when holding
the tx ring mutex, this can cause lock contention on the tx ring mutex
when using iflib_simple_transmit.

To resolve this, this patch opportunistically copies completed mbuf
pointers into a new array (ifsd_m_defer) so they can be freed after
dropping the transmit mutex. The ifsd_m_defer array is
opportunistically used, and may be NULL. If its NULL, then we free
mbufs in the old way. The ifsd_m_defer array is atomically nulled
when a thread is using it, and atomically restored when the freeing
thread is done with it. The use of atomics here avoids
acquire/release of the tx lock to restore the array after freeing
mbufs.

Since we're no longer always freeing mbufs inline, peeking into them to see if a
transmit used TSO or not will cause a useless cache miss, as nothing
else in the mbuf is likely to be accessed soon. To avoid that cache
miss, we encode a TSO or not TSO flag in the lower bits of the mbuf
pointer stored in the ifsd_m array. Note that the IFLIB_NO_TSO flag
exists primarily for sanity/debugging.

iflib_completed_tx_reclaim() was refactored to break out
iflib_txq_can_reclaim() and _iflib_completed_tx_reclaim()
so the that the tx routine can call iflib_tx_credits_update()
just once, rather than twice.

Note that deferred mbuf freeing is not enabled by default, and can be
enabled using the dev.$DEV.$UNIT.iflib.tx_defer_mfree sysctl.

Differential Revision: https://reviews.freebsd.org/D54356
Sponsored by: Netflix
Reviewed by: markj, kbowling, ziaee
14d93f612f26f4e8454e393b75b0e4be0fc9d890 Andrew Gallatin 2026-01-07 19:29:53
tools/cam: Start to add the testing tools for CAM
Create a directory for testing tools arond CAM. These are snippets of
what will eventually be camio. At the moment, it was written using fbt
traces. This is OK, but fragile, so they need to be re-written with the
cam provider. cam_all_but_scsi.d is the first step. It shows how to do
this with the new cam dtrace provider.

Sponsored by:           Netflix
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D54472
cd1aa5f9917cc7de255e854954c818e5ef3e9c9b Warner Losh 2026-01-08 06:20:34
pf: remove redundant zeroing
nlmsg_reserve_object() already zeroes the header before it gives it to
us, so there's no need to explicitly zero these fields again.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
bf19253516ec7c3bac5ccd64d934f970f68f2b2d Kristof Provost 2026-01-06 21:57:58
pf: handle nlattr_add_nested() failure
Sponsored by: Rubicon Communications, LLC ("Netgate")
0df9054bc11633e2a4414e783be74906c743a64d Kristof Provost 2026-01-06 22:01:21
cam: Dtrace scripts to help diagnose weird things
These are sample dtrace scripts that likely need to be modified for
whatever problem you are chasing. Unfortuneately, you have to read the
driver extensively to understand them or how to use them. But studying
the completion routine of mpr/mps will help understand many of the error
and recovery paths.

Sponsored by:           Netflix
92f251f36b31519ed336ac67b768d39b62ebf896 Warner Losh 2026-01-09 06:11:10
iflib: remove convoluted custom zeroing code
Replace a collection of aliasing violations and ifdefs with memset
(which now expands to __builtin_memset and should be quite reliably
inlined.)  The old code is hard to maintain as evidenced by the most
recent change to if_pkt_info_t updating the defines, but not the zeroing
code.

Reviewed by:    gallatin, erj
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=43d7ee540efe ("iflib: support for transmit side nic KTLS offload")
Differential Revision:  https://reviews.freebsd.org/D54605
31e7dc6b9a000b02353bfc41cbd897533287cda2 Brooks Davis 2026-01-09 14:19:49
net80211: fix bpf tap leak on wlan(4) detach
509a185dd9405141df4d304d7805019b40e736cf Gleb Smirnoff 2026-01-10 18:56:19
iflib: null out freed mbuf in iflib_txsd_free
When adding the IFLIB_GET_MBUF/FLAGS, I neglected to NULL out the
mbuf in the descriptor ring.  I didn't think this should matter as
the I thought this code was only used when the ring was about
to be freed. But I was wrong, and leaving a stale mbuf in there can
cause panics.

Reported by:  Marek Zarychta (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292547)
Fixes: https://cgit.freebsd.org/src/commit/?id=14d93f612f26
Sponsored by: Netflix
d91ae61f8fc2dd4ab3c208f25570b91a0725e2e4 Andrew Gallatin 2026-01-19 15:41:02
pfctl(8): change default limiter action from no-match to block
pf(4) users who use limiters in current should update the rules
accordingly to reflect the change in default behavior. The existing
rule which reads as follows:

    pass in from any to any state limiter test

needs to be changed to:

    pass in from any to any state limiter test (no-match)

OK dlg@

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, c600931321
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2e0e45a516b93cc72771a5de8b87cd0a07a55f07 Kristof Provost 2026-01-16 17:30:55
ip: improve deferred computation of checksums
This patch adds the same functionality for the IPv4 header checksum
as was done erlier for the SCTP/TCP/UDP transport checksum.
When the IP implementation sends a packet, it does not compute the
corresponding checksum but defers that. It will determine whether the
network interface selected for the packet has the requested capability
and computes the checksum in software, if the selected network
interface does not have the requested capability.
Do this not only for packets being sent by the local IP stack, but
also when forwarding packets. Furthermore, when such packets are
delivered to a local IP stack, do not compute or validate the checksum,
since such packets have never been on the wire. This allows to support
checksum offloading also in the case of local virtual machines or
jails. Support for epair interfaces will be added in a separate commit.

Reviewed by:            pouria, tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D54455
6f15ba8004c3fdc2fb12f0cd6618d1b3a40aab7d Timo Völker 2026-01-20 10:30:19
Commit group #30: krb5: Expose missing symbols
krb5: Expose missing symbols

Add symbols found in the port but not in base. This requires replacing
a shared libkrb5profile.so with libkrb5profile.a (with -fPIC so it can
be used by shared libraries). We do this by making libkrb5profile
INTERNALLIB.

Base currently has libkrb5profile in a shared library. The patch moves
those functions to the various "consumer" libraries as the port does.

Symbols that should be in the other libraries are in libkrb5profile.so.
This is causing some ports issues.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291695
Reported by:    michaelo, markj,  Chris Inacio <inacio@andrew.cmu.edu>
Tested by:      michaelo
Fixes:          https://cgit.freebsd.org/src/commit/?id=ae07a5805b19
Reviewed by:    michaelo (previous version)
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D54323
1876de606eb876b7a97beccfe6fcc89e60a72a25 Cy Schubert 2025-12-18 00:50:44

krb5: Fix gcc14 build

Fixes:          https://cgit.freebsd.org/src/commit/?id=1876de606eb8
X-MFC with:     1876de606eb8
MFC After:      2 weeks
6637e8f616f0e94c7801698dd11bee5ebcf3799a Cy Schubert 2026-01-20 15:35:00

krb5: Fix another GCC build issue

Fixes:          https://cgit.freebsd.org/src/commit/?id=1876de606eb8
X-MFC with:     1876de606eb8
MFC after:      2 weeks
2d8ec3bab2d8af9d0f3322c4d752ff928620491c Cy Schubert 2026-01-20 17:33:17
net80211: correct return code for ieee80211_ampdu_request()
We used to return the result of (*ic_send_action) directly but
ieee80211_ampdu_request() returns 1 on success and 0 on error,
which is contrary to the result of (*ic_send_action).  Deal with
that accordingly and update the documentation of the function.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D54794
c670af3725d0bb5494caf0846994ae6997175cb6 Bjoern A. Zeeb 2026-01-20 13:48:11
sctp: support bridge interfaces
Reported by:  Timo Völker
Tested by:      Timo Völker
MFC after:      3 days
8d82dafa568baf7be46e5e443dd7310986a28aa9 Michael Tuexen 2026-01-20 17:04:35
radiotap: add more EHT definitions
Add more EHT definitions used by at least iwlwifi.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
5f7b5dde10518d4436e1ec07a76873bf31d28425 Bjoern A. Zeeb 2026-01-20 18:57:19
tests/ktest_netlink_message_writer: remove INVARIANTS requirement
INVARIANTS is meant to be used to enable extra sanity checking for
internal structures, not enable/disable tests in the freebsd kyua
test suite.

STABLE branches include a GENERIC kernconf without INVARIANTS, so
ktest_netlink_message_writer is broken on such branches:

https://ci.freebsd.org/job/FreeBSD-stable-15-amd64-test/253/testReport/sys.netlink.test_netlink_message_writer/py/__test_cases_list__/

Reviewed by:    lwhsu, imp
Approved by:    lwhsu (mentor)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1889
MFC after:      3 days
Signed-off-by:  Siva Mahadevan <siva@FreeBSD.org>
Sponsored by:   The FreeBSD Foundation
8352e24d0bc59f9730980986600bde7d8cdce21d Siva Mahadevan 2026-01-22 19:49:51
Commit group #31: netinet6
netinet6: embed struct nd_ifinfo into struct in6_ndireq

There is no functional change here, but we'd like to emphasize that the
nd_ifinfo structure is not a actually a kernel ND6 software context,
despite being actively used like this way, but an API/ABI structure for
ioctl(2).  This should prevent from a ABI breakages like in 31ec8b6407fd.
This also is a step towards stopping using it as a kernel software
context.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54722
6857b3a04e59d178f7716ba409d08a57f850ffcf Gleb Smirnoff 2026-01-23 22:16:42

netinet6: embed the counter(9) arrays in struct in6_ifextra

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54723
3182dc411788ea690d557f9e16083dcaf38ddab0 Gleb Smirnoff 2026-01-23 22:17:10

netinet6: use in6_ifmtu() instead of IN6_LINKMTU() macro

There should be no functional change.  If there are any performance
concerns with a function call, with the future changes, that would move
ND6 bits into in6_ifextra, this function would be easily inline-able.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54724
25a11d9805fc94ec6b01525b3902c89be87c735c Gleb Smirnoff 2026-01-23 22:17:16
Commit group #32: netinet6
netinet6: embed struct scope6_id into struct in6_ifextra

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54726
aa3bbc06e5f0856dcb9b9d15ddde1a0a030088e2 Gleb Smirnoff 2026-01-23 22:18:07

netinet6: embed struct mld_ifsoftc into struct in6_ifextra

In mld_domifdetach() don't search the global list.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54727
cba9f88105c268f73fa2a92ca4479cc15b8a3338 Gleb Smirnoff 2026-01-23 22:18:12

netinet6: free in6_ifextra with epoch_call(9)

This is expected to fix the old in6_selecthlim() panics.  The nature of
the panic is that a packet sending thread will obtain the struct ifnet
pointer locklessly and then pick the if_inet6 pointer from it and
dereference it. While the struct ifnet is freed via epoch_call(9), the
struct in6_ifextra until this change was not.  For the forwarded packets,
or locally originated non-TCP packets we were probably safe due to the old
if_dead trick.  But locally originated TCP packets may dereference
in6_ifextra via direct call into in6_selecthlim() from the tcp_output(),
before ip6_output().

NB: hypothetically a similar problem also applies to IPv4's if_inet pointer,
but there are no known panics, yet.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279653
Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54728
f3de667137e90679cd20fa5c1dcd93a4c51ad848 Gleb Smirnoff 2026-01-23 22:18:18
Commit group #33: netlink: use caller's credentials in rtnl_handle_newlink
netlink: use caller's credentials in rtnl_handle_newlink

Make sure rtnl_handle_newlink sets the caller's credential
during calls to ifc_create_ifp_nl and ifc_modify_ifp_nl

Reviewed by: glebius, melifaro
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D54109
04f6b99947d2d2e0f6ec7703609c74083b5646e2 Pouria Mousavizadeh Tehrani 2026-01-24 09:50:50

netlink: make compile without VIMAGE

Add the #include for proc.h which seems to be there in the VIMAGE
case through some other includes only.

Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=04f6b99947d2
072af59d46af264c835c8cda21d61b82fb4251ab Bjoern A. Zeeb 2026-01-25 12:33:17
pf: Rationalize the ip_divert_ptr test
If a rule has a divert port set, then we can reasonably predict that
ipdivert.ko is loaded, and in particular that ip_divert_ptr is set.

Moreover, in this case, if ipdivert.ko is not loaded we should just drop
the packet instead of ignoring the divert rule.

Reviewed by:    igoro, kp, glebius
MFC after:      2 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54845
39878d24a690feb4da3fc223649c6a5fd166d09d Mark Johnston 2026-01-26 17:23:33
ipfw: don't use the upper half lock to walk dynamic states buckets
The lock is sleepable and we can't grab it in dyn_tick().  Use the
individual bucket locks instead.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e3caa360d5d0a73af0de1d293d5b8ff6e900ceb4
d1a8f1a62f31779e1902b856b44249b198178fc9 Gleb Smirnoff 2026-01-26 23:05:17
ip6: Remove support for RFC2675 (Jumbo Payload Option)
The Jumbo Payload option was intended to allow the deployment of IPv6 on
networks with a link MTU in excess of 65,735 octets.

Speaking to one of the authors of RFC2675 the networks which motivated
the Jumbo Payload option no longer exist.

FreeBSD does not currently support any links with this capacity and
discussion when this change was first proposed suggested that the loop
back interface had to be patched to test implementation.

As there are no known devices that can carry Jumbo Payloads remove
support.

Reviewed by:    glebius, teuxen, kp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D19960
069a67374ed9641ff1ada2aecaac1cc61a560649 Tom Jones 2026-01-23 12:43:25
pf: Pass v6 packets to the divert socket
There is no particular limitation of divert sockets with respect to
IPv6, and the pf.conf man page does not mention the restriction to IPv4.

Extend the divert-to regression tests to exercise the v6 case.

Reviewed by:    igoro, kp, glebius
MFC after:      3 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54847
b0d99709502294812b11c139f64b0b78f5d2d457 Mark Johnston 2026-01-27 13:48:09
ip_mroute: EVENTHANDLER_REGISTER does not fail
No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
0f1e1350704af555a4b30136f5f3d16db6f2dc51 Mark Johnston 2026-01-27 14:56:55
ip_mroute: Convert to using a regular mutex
The multicast routing code was using spin mutexes for packet counting,
but there is no reason to use them instead of regular mutexes, given
that none of this code runs in an interrupt context.  Convert to using
default mutexes.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54603
a265c8b4a5a7c8fdd33e27b8f74bd2a514f82c70 Mark Johnston 2026-01-27 14:58:02
ipfw: don't recurse on the upper half lock in ipfw_iface_ref()
d8a78048a24662dc9310bfd4e4498d278fe00f0a Gleb Smirnoff 2026-01-27 17:30:13
ipfw: fix my stupid error in casting void * to enum
29c3350f395a48b5c6fe8acd28f281e9af9cd8ab Gleb Smirnoff 2026-01-27 18:02:46
bluetooth: Don't use a non-string to initialize NG_HCI_BDADDR_ANY
Explicitly use an array of 6 zeroes instead of a C string containing
nul characters.  GCC 15 warns about the truncation, but this is
cleaner regardless.

In file included from /usr/obj/.../amd64.amd64/tmp/usr/include/bluetooth.h:51,
                 from usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c:45:
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c: In function 'register_sdp':
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c:96:13: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (7 chars into 6 available) [-Werror=unterminated-string-initialization]
   96 |             NG_HCI_BDADDR_ANY, (const uint8_t *)&record, sizeof(record),
      |             ^~~~~~~~~~~~~~~~~

Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D54869
72a6991b80c6e6c47a3b84337f62f0a02bd30391 John Baldwin 2026-01-27 18:40:38
Commit group #34: netinet6: Disallow connections to IN6ADDR_ANY
netinet6: Disallow connections to IN6ADDR_ANY

Previously connect() or sendto() to INADDR_ANY or IN6ADDR_ANY reached
some socket bound to some host interface address.  Although this was
intentional it was an artifact of a different era, and is not desirable
now.

In 417b35a97b76 markj added support to disallow connect() to INADDR_ANY
and IN6ADDR_ANY.  Connections to INADDR_ANY were disabled by default in
cd240957d7ba.  Follow suit with IN6ADDR_ANY.

Reviewed by:    glebius, markj, zlei
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54306
627e126dbb07b167b028380ef61bb45f10493938 Ed Maste 2025-12-19 14:15:35

tests/netinet: fix tests that depended on connect(in6addr_any)

Fixes:  https://cgit.freebsd.org/src/commit/?id=627e126dbb07b167b028380ef61bb45f10493938
9df110b11f2dc8802fe6418b96e417f93ba6a753 Gleb Smirnoff 2026-01-30 21:31:13
epair: add VLAN_HWTAGGING
Add capability VLAN_HWTAGGING to the epair interface and enable it by
default.
When sending a packet over a VLAN interface that uses an epair
interface, the flag M_VLANTAG and the ether_vtag (which contains the
VLAN ID and/or PCP) are set in the mbuf to inform the hardware that
the VLAN header has to be added. The sending epair end does not need
to actually add a VLAN header. It can just pass the mbuf with this
setting to the other epair end, which receives the packet. The
receiving epair end can just pass the mbuf with this setting to the
upper layer. Due to this setting, the upper layer believes that there
was a VLAN header that has been removed by the interface.
If the packet later leaves the host, the outgoing physical interface
can add the VLAN header in hardware if it supports VLAN_HWTAGGING.
If not, the implementation of Ethernet or bridge adds the VLAN header
in software.

Reviewed by:            zlei, tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D52465
574d46b25ab6f42ad97017bb8b72520e9539e36f Timo Völker 2026-01-30 10:54:33
ip6_mroute: Mark functions as static
No functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
a03eabfebbce15d8ce028168969812d3ca2be206 Mark Johnston 2026-01-30 15:25:52
ip6_mroute: Remove unnecessary casts
No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
56e1cba88bb82f2a6af0212c72182ff6303a1554 Mark Johnston 2026-01-30 20:39:34
sockstat: Surround explicit IPv6 addresses with brackets
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254611
Approved by:    otis, tuexen, des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54375
fe81e3944c085e765c83c4f78941d7529ceb556e Michael Osipov 2025-12-26 17:27:12
ip_mroute: Make privilege checking more consistent
- The v6 socket option and ioctl handlers had no privilege checks at
  all.  The socket options, I believe, can only be reached via a raw
  socket, but a jailed root user with a raw socket shouldn't be able to
  configure multicast routing in a non-VNET jail.  The ioctls can only
  be used to fetch stats.
- Delete a bogus comment in X_mrt_ioctl(), one can issue multicast
  routing ioctls against any socket.  Note that the call path is
  soo_ioctl()->rtioctl_fib()->mrt_ioctl().

I think all of the mroute privilege checks should be done within the
ip(6)_mroute code, but let's first make the v4 and v6 modules
consistent.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54982
74839871be363c5c2ac7ccd3396f36bdb58d19de Mark Johnston 2026-02-02 14:53:35
Commit group #35: ip6_mroute
ip6_mroute: Make MF6CFIND a regular function

This is more natural and corresponds more closely to the v4 multicast
routing code.  No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54983
b370fcc716b9cfd4d08e291f0009f02452c84d64 Mark Johnston 2026-02-02 14:57:20

ip6_mroute: Fix the UPCALL_TIMING build

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
5bb953b095461b488b102ab3025f42cd2ef61f9d Mark Johnston 2026-02-02 14:57:49

ip6_mroute: Remove an unused constant

No functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
b320e89e6909c0c3f29542976df0381990866988 Mark Johnston 2026-02-02 14:58:38

ip6_mroute: Remove an unhelpful comment

ifnets already track if_allmulti() calls in the if_amcount field.  That
field is older than the comment, so I'm not exactly sure what the intent
was; let's just remove it.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
a45fb94801dffd414bdb1981def0e977ef0c774f Mark Johnston 2026-02-02 14:59:20
pf: fix use of uninitialised variable
In pf_match_rule() we attempt to append matching rules to the end of
'match_rules'. We want to preserve the order to make the multiple
pflog entries easier to understand. So we keep track of the last added
rule item in 'rt'. However, that assumed that 'match_rules' was only
ever added to in that one call to pf_match_rules(). This isn't always
the case, for example if we have match rules in different anchors.
In that case we'd end up using the uninitialised 'rt' variable in the
SLIST_INSERT_AFTER call.

Instead track the match rules and the last matching rule (to enable
easy appending) in the struct pf_test_ctx.
This also allows us to reduce the number of arguments for some
functions, because we passed a ctx to most functions that needed
'match_rules'.

While here also make pf_match_rules() static, because it's only ever
used in pf.c

Add a test case to exercise the relevant code path.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
fe9e4eb6f38ae004efb576bf44aded08852f9e6b Kristof Provost 2026-02-03 12:17:08
ipfilter: Fix possible overrun
The destination buffer is FR_GROUPLEN (16 bytes) in length. When
gname is created, the userspace utilities correctly use FR_GROUPLEN
as the buffer length. The kernel should also limit its copy operation to
FR_GROUPLEN bytes to avoid any user written code from exploiting this
vulnerability.

Reported by:    Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after:      1 week
e40817302ebdf89df2f3bcd679fb7f2a18c244dc Cy Schubert 2026-02-04 17:27:23
bpf: don't clear pointer from descriptor to the tap on descriptor close
During packet processing the descriptor is looked up using epoch(9) and it
can be accessed after bpf_detachd().  In scenario of descriptor close the
tap point is alive (it actually produces packets) and thus the pointer can
be legitimately dereferenced.  This fixes a race on a bpf(4) device close
that would otherwise result in panic.

Differential Revision:  https://reviews.freebsd.org/D55064
5937e1cdc99180b4adae2cf20cabd75dd9f45546 Gleb Smirnoff 2026-02-04 22:07:11
lagg: Make the none protocol a first-class citizen
All the other protocols have corresponding start and input routines,
which are used in the fast path. Currently the none protocol is
treated specially. In the fast path it is checked to indicate whether
a working protocol is configured. There are two issues raised by this
design:

1. In production, other protocols are commonly used, but not the
none protocol. It smells like an overkill to always check it in the
fast path. It is unfair to other commonly used protocols.

2. PR 289017 reveals that there's a small window between checking the
protocol and calling lagg_proto_start(). lagg_proto_start() is possible
to see the none protocol and do NULL deferencing.

Fix them by making the none protocol a first-class citizen so that it
has start and input routines just the same as other protocols. Then we
can stop checking it in the fast path, since lagg_proto_start() and
lagg_proto_input() will never fail to work.

The error ENETDOWN is chosen for the start routine. Obviously no active
ports are available, and the packets will go nowhere. It is also a
better error than ENXIO, since indeed the interface is configured and
has a TX algorithm (the none protocol).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289017
Diagnosed by:   Qiu-ji Chen <chenqiuji666@gmail.com>
Tested by:      Gui-Dong Han <hanguidong02@gmail.com>
Reviewed by:    glebius
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55123
a622030b4baec2136984cea7bd25c2985a2ae9b3 Zhenlei Huang 2026-02-06 03:37:43
lagg: Remove the member pr_num from struct lagg_proto
It is set but never used. Remove it to avoid confusion and save a
little space.

While here, use designated initializers to initialize the LAGG protocol
table. That improves readability, and it will be safer to initialize the
table if we introduce new protocols in the future.

No functional change intended.

Reviewed by:    glebius
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55124
5ba503fc2cabc1a614997f102ace671d996bcc53 Zhenlei Huang 2026-02-06 03:37:43
sctp: Use __sdt_used for variables only used by SDT probes
Previously this used a home-rolled version.

Reviewed by:    tuexen, imp, markj
Differential Revision:  https://reviews.freebsd.org/D55165
d4d735b26537662565001d86685080256cf95758 John Baldwin 2026-02-09 16:27:55
lagg: Make lagg_link_active() static
It is declared as static. Make the definition consistent with the
declaration.

It was ever fixed by commit 52e53e2de0ec, but the commit was reverted,
leaving it unfixed.

No functional change intended.

MFC after:      3 days
30988d0a7bd7ebd5f5825b9b7aa04ff0af788aa7 Zhenlei Huang 2026-02-09 17:48:07
sys/netinet6: switch net.inet6.ip6.use_stableaddr to on by default
This change switches to using RFC 7217 algorithm as the default to
generate SLAAC addresses for IPv6 interfaces configured with
accept_rtadv.

Reviewed by:            pouria, glebius, zlei
Approved by:            zlei
Relnotes:               yes
Differential Revision:  https://reviews.freebsd.org/D55138
a2eb0894b79bd0241e51c6888a52bea369ae8a6a Guido Falsi 2026-02-09 20:27:15
net80211: in net80211_vap_printf() also use vprintf()
While everything else uses vprintf() and net80211_vap_printf()
vlog() the debug output of wlandebug sessions can be weird.
For consistency use vprintf() everywhere to have homogeneous logging.

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D54795
840f478eed2ab18abd1088aa12587bb708a46b56 Bjoern A. Zeeb 2026-01-20 13:43:51
iflib: Add support for SIOCGIFDOWNREASON ioctl
This change adds native support for the SIOCGIFDOWNREASON ioctl in iflib.

When ifconfig issues SIOCGIFDOWNREASON, the request is now routed through a
new driver callback (IFDI_GET_DOWNREASON). iflib allocates the ifdownreason
structure, calls the driver to fill the down-reason message, and then
returns the data back to ifconfig for display.

Without this change, iflib-based drivers cannot implement link-down reason
reporting even if the hardware provides the information.

No functional change for existing drivers unless they implement the new
IFDI_GET_DOWNREASON method. Existing drivers continue to behave as before.

Reviewed by: gallatin, erj, kgalazka, ssaxena, #iflib
Differential Revision: https://reviews.freebsd.org/D54045
MFC After: 1 week
c2f799d4193f135f4d36e9f622b10b825b9144eb Chandrakanth Patil 2026-01-30 07:15:55
ip_mroute: Use a local variable to store a VIF pointer
This is cleaner and will make it a bit easier to add some more
indirection to the VIF table, specifically, to add per-FIB tables.

No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55057
0a757ef9a79d101bb4b7429ab5802579888dce98 Mark Johnston 2026-02-09 22:51:55
ip_mroute: Try to make function pointer declarations more consistent
The ip_mroute and ip6_mroute modules hook into the network stack via
several function pointers.  Declarations for these pointers are
scattered around several headers.  Put them all in the same place,
ip(6)_mroute.h.

No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55058
9df6a7f9a60b76eda2ac82826528487ca43edf46 Mark Johnston 2026-02-09 22:52:08
ip6_mroute: Deindent some code in ip6_mdq()
Deal with the mifi >= nummifs case early so that we can de-indent the
rest of the code.  This also ensures that the debug log (compiled out by
default) doesn't perform an out-of-bounds access.

Remove a bogus NULL test in an inner loop while here.

No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55059
d8f7a7b44a951368d637bbbdc06c28ffd6331d76 Mark Johnston 2026-02-09 22:52:20
net: Remove the IFF_RENAMING flag
This used to be needed when interface renames were broadcast using the
ifnet_departure_event eventhandler, but since commit 349fcf079ca3
("net: add ifnet_rename_event EVENTHANDLER(9) for interface renaming"),
it has no purpose.  Remove it.

Reviewed by:    pouria, zlei
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55171
93075bdb813a9956e66c711eda2c83fb596711fd Mark Johnston 2026-02-09 23:24:02
ipfilter: Interface name must not extend beyond end of buffer
sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after:      1 week
47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0 Cy Schubert 2026-01-08 17:41:53
pf: remove unused variable from pf_test_ctx
Sponsored by: Rubicon Communications, LLC ("Netgate")
950dedcd87afc6beb8e38956273072ca0d02c964 Kristof Provost 2026-02-09 20:13:30
net80211: clean up time comparison in HT code
There's at least one place where the time comparison is wrong, leading
to some bad beahaviour around deciding to try and establish/reestablish
AMPDU TX sessions.

Start addressing these!

Differential Revision:  https://reviews.freebsd.org/D54390
7a5288a023baeac2f0c3128506178f89fda3cc0d Adrian Chadd 2025-12-15 03:45:36
lagg: Avoid dropping locks when starting the interface
The init routine of a lagg(4) interface will not change during the whole
lifecycle. So we can call lagg_init() directly instead of through the
function pointer. Well, that requires a drop and pickup lock, which
unnecessarily expose a small race window. Refactor lagg_init() into
lagg_init_locked() and call the later one to avoid that.

Meanwhile, delay updating the driver managed status until after the
interface is really ready.

Reviewed by:    markj
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55198
c182cf646a4f995fa8506afd8afc9541c4d32905 Zhenlei Huang 2026-02-11 18:15:41
netinet6: Add a struct socket declaration to ip6_var.h
MFC after:    1 week
Reported by:    Ian FREISLICH <ianfreislich@gmail.com>
be393b6f0497f374c679c31e746705515eb9a554 Mark Johnston 2026-02-12 13:59:40
ip_mroute: Make the routing socket private
I have some patches which make ip_mroute and ip6_mroute multi-FIB-aware.
This enables running per-FIB routing daemons, each of which has a
separate routing socket.

Several places in the network stack check whether multicast routing is
configured by checking whether the multicast routing socket is non-NULL.
This doesn't directly translate in my proposed scheme, as each FIB would
have its own socket.  I'd like to modify the ip(6)_mroute code to store
all state, including the socket, in a per-FIB structure.  So, take a
step towards that and 1) hide the socket, 2) add a boolean flag which
indicates whether a multicast router is registered.

Reviewed by:    pouria, zlei, glebius, adrian
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55236
d19fd2f349226116f7effb281baa1eb32b8292e7 Mark Johnston 2026-02-13 16:50:18
bpf: don't call bpf_detachd() in bpf_setdlt()
The bpf_attachd() will perform bpf_detachd() itself.  Performing it twice
will lead to doing CK_LIST_REMOVE twice.

Reported & tested by:       bz
596bf3485fe5dd62991e0f49ee783bc91d83678c Gleb Smirnoff 2026-02-12 20:11:09
pf: convert DIOCRTSTADDRS to netlink
Sponsored by: Rubicon Communications, LLC ("Netgate")
281282e9357b95b679d36ca6d8561e96c1263937 Kristof Provost 2026-02-13 16:21:33
netlink: force uninline of nl_receive_message()
The entire netlink(4) message processing thread is all inlined into
nl_taskqueue_handler() making it difficult to dtrace(1) on a message
level.
11c1b69885be9c20fba8f7b0d41bd6da8202b972 Gleb Smirnoff 2026-02-16 23:39:29
ipfilter: Avoid negative array indicies
Array indices must always be posive. We avoid this by making each index
unsigned. This mitigates out-of-bounds reads and writes.

Reported by:            Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by:            glebius
MFC after:              3 days
Differential revision:  https://reviews.freebsd.org/D55260
3fdbd8a07a2dcb8fe3cec19fc59ef064453e4755 Cy Schubert 2026-02-11 19:30:38
krb5: Make the build a bit quieter
compile_et.sh is run during buildworld and prints a bunch of debug
output.  It's intrusive and probably not needed, at least by default, so
let's make the build output a bit cleaner.  This is an upstream script,
but it hasn't been modified in 15 years so the local modification is
unlikely to cause any pain.

Also remove a print that shows up in buildworld -s output.

Reviewed by:    cy
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55317
4c247f120492d999ac90efcfc73e5fea29206d1f Mark Johnston 2026-02-17 14:45:50
Commit group #36: if_gre: Add netlink support with tests
if_gre: Add netlink support with tests

Migrate to new if_clone KPI and implement netlink support
for gre(4). Also refactor some of the gre specific ioctls.

Reviewed by: glebius, zlei
Differential Revision: https://reviews.freebsd.org/D54443
e1e18cc12e68762b641646b203d9ac42d10e3b1f Pouria Mousavizadeh Tehrani 2026-02-18 18:12:35

gre tests: Add required_kmods to gre netlink test

Fixes: https://cgit.freebsd.org/src/commit/?id=e1e18cc12e68
Differential Revision: https://reviews.freebsd.org/D54443
1635ba90615a5d9342604d495b71ac5380030b36 Pouria Mousavizadeh Tehrani 2026-02-20 07:50:20

gre tests: Fix gcc warnings on gre netlink tests

Avoid using `snl_add_msg_attr_ip` for now and directly use
`snl_add_msg_attr_ip4` to silence gcc warnings.

Fixes: https://cgit.freebsd.org/src/commit/?id=e1e18cc12e68
Differential Revision: https://reviews.freebsd.org/D54443
49fa0079cfc850917723e2163c51622eb5462429 Pouria Mousavizadeh Tehrani 2026-02-20 16:45:13
pf: avoid NULL deref on purged states
States can be invalidated and still be present in the state table for a
while (until the pf_purge thread cleans them up). These states might not
have keys set, so we must make sure a state is not purged before we try
to access those keys.

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
d60082f16e4c91d4b97d8b3b56b39fa348ecfbda Kristof Provost 2026-02-18 18:23:42
netinet6: spell Identifiers in the comment
59eafd8726e2be08807650a8f67714124aa75dbd Maxim Konovalov 2026-02-19 04:26:09
icmp6: clear csum_flags on mbuf reuse
When icmp6 sends an ICMPv6 message, it reuses the mbuf of the packet
that triggered the ICMPv6 message and prepends an IPv6 and ICMPv6
header. For a locally generated packet with checksum offloading, the
mbuf still has csum_flags set indicating that a SCTP/TCP/UDP checksum
has to be computed and inserted. Since this not the case anymore,
csum_flags need to be cleared.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293227
Reviewed by:            kp, zlei, tuexen
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D55367
ada4dc77577f7162353e8c2916ba5c258b6210f0 Timo Völker 2026-02-19 14:15:10
ctld: Honor the default maximum I/O queue size for NVMeoF controllers
<dev/nvmf.h> exports a constant to set the default maximum I/O queue
size which is used by ctl(4) if an explicit size is not set.  This
value was chosen to match Linux's default, but it also avoids
excessive resource usage for I/O queues.

ctld was using the absolute maxium size as the default instead.

Sponsored by:   Chelsio Communications
0788e7c40ddbeedfd9713842440a8db2a8f7ea2f John Baldwin 2026-02-20 18:56:00
tcp: improve validation of received TCP over UDP packets
Reviewed by:          glebius, pouria
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D55410
e1886559ea477add82a0a86cddf728f6778f1603 Michael Tuexen 2026-02-20 21:21:37
tcp: cleanup
No functional change intended.

Reviewed by:            pouria, rrs, Timo Völker
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D55415
c984c7593e11aa95f21f79bb5425a9d5e9181945 Michael Tuexen 2026-02-22 17:44:10
net/if_vlan.c: do not leak vlan sx slock in vlan_clone_dump_nl()
Reported by:  pho
Reviewed by:    markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=d4062b9f16e46f039f2b5b40dd35592b5dabf00c
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55447
dfcd04c4c811096e5183a406d0f001a7c0ffa60a Konstantin Belousov 2026-02-21 18:54:52
rtsock: Fix stack overflow
Approved by:  so
Security:       FreeBSD-SA-26:05.route
Security:       CVE-2026-3038
Fixes:          https://cgit.freebsd.org/src/commit/?id=92be2847e845 ("rtsock: Avoid copying uninitialized padding bytes")
f3be7df50f01d9a6ead9f27b55bb4dfd7dc4f9d2 Mark Johnston 2026-02-23 15:52:50
Mitigate a case where TCP rack can send an extra ack.
Rack will in theory send an extra rate limited ack when we get to a closing state (sending a FIN) so that
if we have only 1 packet outstanding we might encourage the connection to close out. However it does this
always which is not always wise. Change it so that it only does that if its been more than an srtt since
we have had some activity i.e. a send or a receive of a packet.
Reviewed by:tuexen, rscheff
Differential Revision:<https://reviews.freebsd.org/D55459>
9063968e8e394b8062a855592e12607b143c1b0f Randall Stewart 2026-02-24 16:47:36
When TCP ECN decides it wants to assure an ACK is sent it needs to do it correctly and with some limits.
So in testing I have found two interesting cases where ECN is going
to make it so that an ack will be sent right away. These cases need
to be limited to being in the ESTABLISHED state. You don't want ECN
sending ACK's when we are transitioning in front or end states.
Also we don't start a delayed ack timer <and> at the same time set
the ACKNOW flag, thats just plain wrong.

Reviewed by: tuexen, rscheff
Differential Revision:<https://reviews.freebsd.org/D55460>
4e28874a6048f3c5a72a42b5bcfcfc7e71cad8a6 Randall Stewart 2026-02-25 12:59:04
tcp: BBLog incoming packets in TCPS_TIME_WAIT
PR:                   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292293
Reviewed by:            rrs, rscheff, pouria, Nick Banks, Peter Lei
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D5546
8d2f910ceb0f1c366bcf2146a5ba1d1074d07933 Michael Tuexen 2026-02-25 13:01:50
tcp: improve handling of segments in TIME WAIT
The check for excluding duplicate ACKs needs to consider only TH_SYN
and TH_FIN. We know that TH_ACK is set and TH_RST is cleared. All
other flags, in particular TH_ECE, TH_CWR, and TH_AE needs to be
ignored for the check.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292293
Reviewed by:            rrs
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D55489
f3364d3c8c876074a9a6f68168e5eb8bd60207de Michael Tuexen 2026-02-25 13:06:15
netipsec/ipsec_offload.c: handle failures to install SA nicely
If driver refused to install SA, record rejected handle for SA on the
interface always, not only for EOPNOTSUPP case.  The
ipsec_accel_output() function did the right thing if there is no
rejection handle, but not having the handle allows further attempts to
install the SA on the interface.

If driver installed the SA, but ipsec_accel_handle_sav() returned error,
uninstall the SA from the interface.  Hardware must not be set up to
process packets for which kernel expects no processing is done.

In both cases, free the drv_spi if a handle was not installed.  But keep
drv_spi allocated if the deinstall returned an error from the driver.

Reviewed by:    slavash
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   NVidia networking
MFC after:      1 week
477f020c7b5453bcd3bff7f1491e9830027b271e Konstantin Belousov 2026-01-27 01:00:36
ipsec_offload: add comment stating why ipsec_accel_sa_newkey_cb() returns 0
Reviewed by:  slavash
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   NVidia networking
MFC after:      1 week
0e5caac7d543687d540fa83a7125726c7c9e6e58 Konstantin Belousov 2026-02-04 02:34:59
rtnetlink: Add support for nexthop expiration in new/get route
Before this change, netlink only shows nexthop
expire value if route is not multipath.
Now it can set expire time during route creation.
Also, show expire time of multipath nexthops.

Reviewed by: glebius
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D55442
ff6d1faa65a1a77d04746b43023feb457cfa27b8 Pouria Mousavizadeh Tehrani 2026-02-22 17:46:12
netstat(1): Fix expire column in -r flag using netlink
Reviewed by: glebius
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D55440
2f7cfeebcc4356d3bb85e953900ba5d3f75831ff Pouria Mousavizadeh Tehrani 2026-02-22 16:35:23
divert: Use a better source identifier for netisr_queue_src() calls
These opaque IDs are used by netisr to distribute work among threads.
The mapping function is simply SourceID % numthreads, so using socket
addresses as source IDs isn't going to distribute packets well due to
alignment.

Use the divert socket's generation number instead, as that suits this
purpose much better.

Reviewed by:    zlei, glebius
MFC after:      1 week
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55537
5547a7bb39accd8f151b53e90b41d13b55f84c95 Mark Johnston 2026-02-26 20:25:35
divert: unbreak the LINT-NOIP build
Only expose `dcb` when either `INET` or `INET6` is defined.

Reported by:    clang (`-Wunused`)
MFC after:      1 week
Fixes 5547a7bb39 ("divert: Use a better source identifier...")
Differential Revision: https://reviews.freebsd.org/D55548
bd758ebac3272f720c051570e043e4bc653dcd48 Enji Cooper 2026-02-26 23:06:36
gre: unbreak LINT-NOINET
- Move some of the braces under their respective conditionals to make the
statements more self-encapsulated and only define the `aliasreq` union
in the event either INET or INET6 is defined.

- Fix a copy-paste error: `in_gre_ioctl` should be `in6_gre_ioctl` in the
  INET6 case.

Reported by:    tinderbox
Fixes:          https://cgit.freebsd.org/src/commit/?id=e1e18cc12e68 ("if_gre: Add netlink support with tests")
Differential Revision: https://reviews.freebsd.org/D55546
afbfc2a617ee16b4c3bafef869690b594f812690 Enji Cooper 2026-02-26 21:31:25
snl: Remove duplicate rta_expires member in route parser
There is no user for `rta_expires` member and it's
duplicate of `rta_expire`.

Reviewed By: melifaro
Differential Revision: https://reviews.freebsd.org/D55445
82069fae3ff956ecf833d239864e34a3efc3356e Pouria Mousavizadeh Tehrani 2026-02-27 20:41:51
vnet: Ensure the space allocated by vnet_data_alloc() is sufficent aligned
Some 32-bit architectures, e.g., armv7, require strict 8-byte
alignment while doing atomic 64-bit access. Hence aligning to the
pointer type (4-byte alignment) does not meet the requirement on
those architectures.

Make the space allocated by vnet_data_alloc() sufficent aligned to
avoid unaligned access.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265639
Diagnosed by:   markj
Reviewed by:    jhb, markj
Co-authored-by: jhb
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55560
32beb3ae71cb320dbe4190a01c036943d99083b3 Zhenlei Huang 2026-02-28 11:35:42
ipfw: add support for masked ip-address lookups
Current radix-based implementation of lookup tables in ipfw does
not support non-contiguous prefixes while this type of lookup is
needed to write CPU-effective firewall configurations.

For some of the cases we can reach the goal using a masked table
lookup by adding masked (e.g. zero non-significant bits) records
into a table and then zero non-significant bits in lookup key
prior to making a table lookup.

Obtained from:  Yandex LLC
MFC after:      3 weeks
Relnotes:       yes
Sponsored by:   Yandex LLC
Differential Revision:  https://reviews.freebsd.org/D53694
32cd3ee5901ea33d41ff550e5f40ce743c8d4165 Boris Lytochkin 2026-03-01 18:54:24
netinet6: Fix memory leak on auto_linklocal
release the refcount of link-local prefix information to ensure
it gets freed when the address is deleted.

Reviewed By: zlei, ivy
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55593
b55bffeaaf9bae5dc7aa21eae441d89c999ebab8 Pouria Mousavizadeh Tehrani 2026-03-02 15:24:23
tcp: improve NOINET builds
Reported by:  bz
MFC after:      1 week
Sponsored by:   Netflix, Inc.
3d69387ece535fc33821d089aab241bfb9551d69 Michael Tuexen 2026-03-04 14:18:58
inpcb: use correct label name in a comment
df97a58afdea2dc23746c84ebeb60790d8786b22 Gleb Smirnoff 2026-02-28 05:10:54
hpts: remove no longer relevant comment
c5c54f7d21e573741d8ebcfc68d2a852ce416b54 Gleb Smirnoff 2026-03-04 08:20:01
rss: manifest RSS option in kernel with kern.features sysctl
78843218b0cc4679826c15829b355f27c17d3fc1 Gleb Smirnoff 2026-03-05 04:01:22
carp: fix global demotion counter to VRRP advertisements
When net.inet.carp.preempt=1 and a physical interface goes down, the global
V_carp_demotion counter is incremented. For CARP this was already reflected in
outgoing advertisements via DEMOTE_ADVSKEW(), but VRRP sent the raw
sc_vrrp_prio unchanged, so demotion had no effect.

Add DEMOTE_VRRP_PRIO(), a macro analogous to DEMOTE_ADVSKEW():
It subtracts V_carp_demotion from the configured priority and clamps the result
to [0, 254]. Priority 0 is VRRPv3's "resign" signal and causes backups to
preempt immediately. Priority 255 (IP address owner) is never demoted.

Reviewed by:    kp
Approved by:    kp
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D55558
9f71153aec0cb455cd49af6d4ca7e4c16fd45d7a Olivier Cochard 2026-03-05 11:02:20
net80211: sta: use IEEE80211_STATUS_SUCCESS instead of magic 0
Rather than using the status != 0 check use the way more descriptive
status != IEEE80211_STATUS_SUCCESS definition.  This makes it a lot
more clear what is checked here.  While here add a comment in case
aof the (Re)Assoc Resp failure as we do not update state in that case
but rely on a timeout which will bounce us back to State 1
(cf. 802.11-2024, Figure 11-23) which means SCAN in our case, rather
than possibly moving us back to AUTH.  We will likely have to revisit
this when SAE hits the tree.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D55643
9b03cc2a70e4b6354c5f5b90e4c51b850b6b1dd2 Bjoern A. Zeeb 2026-03-02 10:33:53
ndp: Add support for Gratuitous Neighbor Discovery (GRAND)
Implement RFC 4861 Section 7.2.6 and RFC 9131, which is also
address one of the IPv6 deployment issues in RFC 9898 Section 3.9.
GRAND should be triggered by a change in link-layer address of interface
or by configuration of a new global ipv6 address after DAD completes.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55015
7f3b46fe54f16b24e9ce33294fb805f6e7f785c9 Pouria Mousavizadeh Tehrani 2026-03-05 17:58:14
ndp: Simplify and breakdown nd6_ra_input()
`nd6_ra_input()` is simplied to make it easier to add
additional options.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55267
0616521adc35cb252cb399f1147f103284f0f188 Pouria Mousavizadeh Tehrani 2026-03-05 18:01:30
netinet6: Remove support for connecting to IN6ADDR_ANY
RFC4291 section 2.5.2:
    The unspecified address must not be used as the destination address
    of IPv6 packets or in IPv6 Routing headers.  An IPv6 packet with a
    source address of unspecified must never be forwarded by an IPv6
    router.

We disallowed connections to IN6ADDR_ANY by default, as of commit
627e126dbb07 ("netinet6: Disallow connections to IN6ADDR_ANY").  As this
is actually disallowed by the RFC, just remove the support.

Reported by:    bz (in D54306)
Reviewed by:    bz, glebius
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54942
a1789fa30c0b1e4c20a083c550f0ec2d50e480e4 Ed Maste 2026-01-27 21:29:20
net80211: fix VHT160/80P80/80 chanwidth selection in the "40-" case
Depending on the base channel ni_vht_chan2 - ni_vht_chan1 can be
negative.  Apply abs() as indicated in the comments right above
        | CCFS1 - CCFS0 | = 8  or > 16
in order to fix the channel width selection.

Sponsored by:   The FreeBSD Foundation
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293645
Fixes:          https://cgit.freebsd.org/src/commit/?id=4bf049bfeefd9
MFC after:      3 days
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D55717
6cfd2b93e68061c7831016b91c2e308d01658764 Bjoern A. Zeeb 2026-03-08 00:57:33
Commit group #37: ndp: implement delayed anycast and proxy NA
ndp: implement delayed anycast and proxy NA

Reviewed by: bms
Differential Revision: https://reviews.freebsd.org/D55141
f37fbe30f559acfb269f67d3efe59569878a3ee1 Pouria Mousavizadeh Tehrani 2026-03-09 17:00:15

ndp: Fix free after use and exclude delayed proxy

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293777
Fixes:  https://cgit.freebsd.org/src/commit/?id=f37fbe30f559 ("ndp: implement delayed ...")
75f1665f33463e9ee0aaa63af0a875e6c46f8755 Pouria Mousavizadeh Tehrani 2026-03-13 11:36:04
carp: retire ioctl(2) API
All supported stable branches use netlink(4) API to configure carp(4).
The deleted code also has kernel stack leak vulnerability, that requires
extra effort to fix.

Reviewed by:            pouria, kp
Differential Revision:  https://reviews.freebsd.org/D55804
72472e52e310ec348949a3a67d3fa17e33fb8e50 Gleb Smirnoff 2026-03-12 16:30:46
Commit group #38: tcp: make sack_filter.c compilable without _WANT_TCPCB
tcp: make sack_filter.c compilable without _WANT_TCPCB

This file can be compiled as a standalone program for debugging purposes.
Achieve that without exposing hack from tcp_var.h that is destined for
removal.
c0462c2deafdcfe885e8d6f91b529d8cbddc6014 Gleb Smirnoff 2026-03-12 04:44:25

tcp: fix up !VIMAGE builds

The tcp_seq.h uses getmicrouptime() in an inline function, but it doesn't
include <sys/time.h>.  This was usually masked by having tcp_var.h always
before tcp_seq.h, so restore that.

Fixes:  https://cgit.freebsd.org/src/commit/?id=c0462c2deafdcfe885e8d6f91b529d8cbddc6014
4f59a7eb878f8f084e86baa58e882bc55f460a40 Gleb Smirnoff 2026-03-14 04:04:14
netinet: remove _WANT_INPCB and _WANT_TCPCB
These were hacks since FreeBSD 12 that provided some transition period for
utilities to migrate from reading kernel memory via kvm(3) to sysctl(3)
based APIs.  The transition period is over.
815ef05284d184d83613adcf60def403607be6a0 Gleb Smirnoff 2026-03-12 04:48:06
debugnet: don't include udp_var.h
The module constructs UDP packets, but doesn't use the UDP stack.
0f1aa4543fbb7a49c077b69fbb60945ce0c14367 Gleb Smirnoff 2026-03-12 18:01:01
Commit group #39: inpcb: overhaul in_pcb.h
inpcb: overhaul in_pcb.h

Pull up all user-visible stuff to the top of the file and isolate the
rest under _KERNEL.  The user visible parts are:
- struct in_conninfo
- struct xinpcb
- defines for inp_flags bits, that are shared between xinpcb and inpcb

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293493
041e9eb1ae094a81e55fbcaba37eb2ac194658cc Gleb Smirnoff 2026-03-12 18:02:27

inpcb: fix up !VIMAGE builds

There are some files that don't include mutex.h and rwlock.h, but use
inpcb locking macros.  With VIMAGE the net/vnet.h pulls half of the
possible kernel includes, masking the problem.  The in_pcb.h also used to
mask the problem, so restore that.

Fixes:  https://cgit.freebsd.org/src/commit/?id=041e9eb1ae094a81e55fbcaba37eb2ac194658cc
a47c870930a728b5d890e8243cc363c788ebddc7 Gleb Smirnoff 2026-03-14 03:59:51
ndp: fix late KASSERT in nd6_queue_timer
Reviewed by:  glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=7f3b46fe54f1 ("ndp: Add support for Gratuitous...")
Differential Revision: https://reviews.freebsd.org/D55844
a1fa1478f665ceb85e4b58e4ed8234edef833d97 Pouria Mousavizadeh Tehrani 2026-03-13 12:41:04
inpcb: in in_pcbbind() use bool for anonport
77e0c9c3414cbe30eb7f376bf9c8531ca0f097ff Gleb Smirnoff 2026-03-05 20:47:51
inpcb: remove a completely outdated comment
512e189a96415c3471399581239c243d1032e07a Gleb Smirnoff 2026-03-11 03:09:22
rss_config: Add option to enable rss udp hashing
Added optional system tunable parameter to enable
4-tuple rss udp hashing.

Signed-off-by: bigJ <bigj@solanavibestation.com>
Reviewed by: adrian, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2057
283ef95d1677b873903f8b8fa077fbfa3a5e0036 bigJ 2026-03-01 20:14:49
ifnet: Fix decreasing the vnet interface count
It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by:    kp, pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55873
8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7 Zhenlei Huang 2026-03-16 16:20:08
ifnet: Remove unreachable code
The ioctls SIOCSIFVNET and SIOCSIFRVNET are for userland only. For
SIOCSIFVNET, if_vmove_loan(), the interface is obtained from current
VNET. For SIOCSIFRVNET, if_vmove_reclaim(), a valid child prison is
held before getting the interface. In both cases the VNET of the
obtained interfaces is stable, so there's no need to check it.

No functional change intended.

Reviewed by:    glebius, jamie (for #jails)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55828
e0731059af912a27d0f842959218946b1daaa7d1 Zhenlei Huang 2026-03-16 17:03:05
if_bridge(4): don't sleep under epoch(9) in destruction
bridge tries to run callout_drain(9) twice under epoch
during destruction.
once for bridge_timer, which is not required to be under epoch.
second time for the BSTP callout, which is already disabled
earlier inside bridge_delete_member.

Reviewed by: glebius, zlei
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55876
a8b9a05d3cad3bdcb9008232c9172a1aeffbe9fd Pouria Mousavizadeh Tehrani 2026-03-16 12:53:45
ndp: don't send unsolicited NA for multicast address
During link-layer address change event, don't send unsolicited
NA for multicast addresses.

Reviewed by: adrian, zlei
Differential Revision: https://reviews.freebsd.org/D55885
7b9bb32d1cc6779139780baed983129b53a7f36e Pouria Mousavizadeh Tehrani 2026-03-16 20:52:32
in_var.h: fixup comments that mention use by ifmcstat(8)
85cf26c6ee09f0210999881ac3306d333aaea5a3 Gleb Smirnoff 2026-03-18 19:36:07
ecn(9): Update ecn tunneling functions to RFC 6040
Update ECN tunneling functions from obsolete RFC 3168 to
newer RFC 6040.
Also, add ECN_COMPLETE to support dangerous packet reporting
without causing extra costs to existing caller functions.
Finally, return values are specified as macro to reduce
confusion, considering extra return values for ECN_WARN
and ECN_ALARM were added.

Reviewed By: glebius, tuexen
Differential Revision: https://reviews.freebsd.org/D53516
32a462ba9cdc8a927c1aba5d9bff9d16d367d7da Pouria Mousavizadeh Tehrani 2026-03-19 10:18:34
ndp: Accept multiple queued ND for non-GRAND NAs
Multiple delayed NAs on the same ifa can occur simultaneously.
Therefore:
* Differentiate between GRAND and solicited replies.
* Cancel previous pending GRAND NA for same ifa.
* Reuse ndq memory for GRAND.
* Free non-GRAND replies immediately.
* Don't limit non-GRAND NAs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55905
15ebee7c2ed34d2dad8457d6595010ea4ed7e1f2 Pouria Mousavizadeh Tehrani 2026-03-17 20:09:42
bridge(4): Remove epoch_enter during destruction
bridge doesn't require to enter epoch during destruction.

Reviewed by: zlei, glebius
Differential Revision: https://reviews.freebsd.org/D55935
17920f8335106487968d7928d01b34300756ea00 Pouria Mousavizadeh Tehrani 2026-03-19 11:18:42
ip6_input: Remove unused check for IPv4-compatible IPv6
IPv4-compatible IPv6 addresses are deprecated by RFC 4291.
No functional change intended.

Reviewed by: glebius, emaste
Differential Revision: https://reviews.freebsd.org/D55387
56dddebc55494fdf75eeb914cc9e345d0d762f8c Pouria Mousavizadeh Tehrani 2026-03-19 18:15:10
tcp: remove extraneous code
The tcp_close() will perform both actions.

Reviewed by:            pouria, tuexen, rrs
Differential Revision:  https://reviews.freebsd.org/D55965
0798ad802350d449641fb91409860f5c12045581 Gleb Smirnoff 2026-03-20 16:54:54
tcp/rack: don't call call tcp_state_change() before tcp_close()
Reviewed by:          tuexen, rrs
Differential Revision:  https://reviews.freebsd.org/D55969
03b7b779a80557fe769bc00e1b06f4d116df958a Gleb Smirnoff 2026-03-20 16:55:04
tcp: make TCP_TRK_TRACK_FLG_* flags visible to userland programs
These flags are used in BBLog entries.
73f72ca08dbb13ad186e6b33420015d51d0d5b17 Gleb Smirnoff 2026-03-23 21:55:59
pf: Fix hashing of IP address ranges
This corrects the false detection of duplicate rules.

MFC after:      1 week
Reviewed by:    kp
1fa873c93c8b08561c53107c7b90c53dfad30ddc Michael Gmelin 2026-03-12 14:18:09
pf: include all elements when hashing rules
MFC after:    1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c6bcf6e6fd507d952a48226b51cc161b8ef972a2 Kristof Provost 2026-03-19 07:21:51
in6_mcast: Acquire ref to ifp and exit epoch earlier in sysctl
This patch reduces the number of witness warnings during ifmcstat(8) calls.

Reviewed by: glebius, zlei
Differential Revision: https://reviews.freebsd.org/D56052
cbac897a7b057427cfaab12cc143144eadd1e80d Pouria Mousavizadeh Tehrani 2026-03-23 18:38:46
tcp_usrreq: Only allocate TFO counter when required
During tcp_usr_listen(), only allocate TFO counter when required.

Reviewed by: tuexen, glebius
Differential Revision: https://reviews.freebsd.org/D56067
769a6f803d1b531d956af8d857e68f2d2d847324 Pouria Mousavizadeh Tehrani 2026-03-24 17:54:46
tcp: plug an mbuf leak
When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:    so
Security:       FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:    lstewart
Tested by:      lstewart
Sponsored by:   Netflix, Inc.
6b2d6ccad2552e46a5c9c3ba70b2d0ed27c70ca8 Michael Tuexen 2026-03-25 05:53:56
ifnet: Fix races in if_vmove_reclaim()
The thread running if_vmove_reclaim() may race with other threads those
running if_detach(), if_vmove_loan() or if_vmove_reclaim(). In case the
current thread loses race, two issues arise,

 1. It is unstable and unsafe to access ifp->if_vnet,
 2. The interface is removed from "active" list, hence if_unlink_ifnet()
    can fail.

For the first case, check against source prison's vnet instead, given
the interface is obtained from that vnet.

For the second one, return ENODEV to indicate the interface was on the
list but the current thread loses race, to distinguish from ENXIO, which
means the interface or child prison is not found. This is the same with
if_vmove_loan().

Reviewed by:    kp, pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55997
ee9456ce37539da5b651945eea18502f290eb133 Zhenlei Huang 2026-03-30 16:00:01
ip_mroute: Start moving globals into a structure
I would like to support per-FIB multicast routing tables, such that one
can run a routing daemon per-FIB, with each daemon oblivious to the
existence of others.  Currently the multicast routing code is completely
unaware of FIBs.

To that end, start collecting various global variables in ip_mroute.c
into a per-VNET struct mfctable.  In a future patch this will be
expanded into an array of mfctable structures, one per FIB.  For now,
all of the state is collected into V_mfctables[0].

Each mfctable contains, among other things:
- a pointer to the routing socket, if routing is enabled,
- a hash table of routing cache entries,
- an table of network interfaces participating in the routing
  configuration

This change has no functional effect, it is just factoring out these
global variables to make the subsequent patches simpler.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55237
d50d0c002b982f193e36ede9fa2669d5dcf8467b Mark Johnston 2026-03-30 13:27:52
ip6_mroute: Start putting global variables into a structure
As in the IPv4 version of this change, I added a struct mf6ctable
structure which holds all global routing table state, soon to become
per-FIB state.

Note that much of the v6 multicast routing code was not VNETified; this
change fixes that too.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55238
a223d6c489c7ea9a384f3d2bbda1b05b00d4502d Mark Johnston 2026-03-30 13:29:01
net/route: Add an eventhandler for rt_numfibs changes
The multicast routing code will start implementing per-FIB routing
tables.  As a part of this, it needs to be notified when the number of
FIBs changes, so that it can expand its tables.

Add an eventhandler for this purpose.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55239
81dbacbb7d71a53eef99ce73f7e589a165c3e1d6 Mark Johnston 2026-03-30 13:30:19
ip(6)_mroute: Grow the routing tables when the number of FIBs changes
Use the new rtnumfibs_change event to expand the mfctable array when the
number of FIBs increases.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55240
97a4bc9a0da7cd63c660ce59a9dd7c87efe1f218 Mark Johnston 2026-03-30 13:30:38
Commit group #40: ip_mroute: FIBify
ip_mroute: FIBify

Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55241
4c486fe402673c49443293cfb70ad4da61d39916 Mark Johnston 2026-03-30 13:31:29
Commit group #41: ip6_mroute: FIBify
ip6_mroute: FIBify

Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55242
0bb9c2b665d90934ae16eee152b6b4f4f4be0dd5 Mark Johnston 2026-03-30 13:31:55
ip6_mroute: Make ip6_mroute.h more self-contained
MFC after:    2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55243
d4339cebbe8e0b26f92a74eb5d4d9a20403c2ad1 Mark Johnston 2026-03-30 13:32:13
ip6_mroute: Pass the multicast interface number directly to del_m6if()
There's no need to pass a pointer to the interface number.  No
functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55245
82272cbf56aa5646611c6f1049501cc345fcf6ec Mark Johnston 2026-03-30 13:33:11
ip6_mroute: Handle interface detach events
When an interface goes away we need to make sure the v6 multicast
routing tables don't carry any dangling references to the ifnet.  The v4
code handles this already.  Copy the approach there and use an
eventhandler to purge the corresponding MIF, if one exists, and further
go through all routes in the FIB and remove references to the interface.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55246
a1c042a9641c9df08010e87d0928703849ff9853 Mark Johnston 2026-03-30 13:33:32

System administration

Stuff in man section 8 (other than networking).

periodic/801.trim-zfs: Fix daily-trim-zfs-flags
This variable was named incorrectly, resulting in any specified flags
being silently ignored.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292074
MFC after:      3 days
Reported by:    CrazyMihey@Ya.Ru
Fixes:          https://cgit.freebsd.org/src/commit/?id=493908c4b45c (Add a daily zfs trim script)
68d6abd9714384a41028dc0d5086b4930366bbea Alexander Ziaee 2026-01-01 17:53:31
loader.efi: probe for UGA if GOP isn't found
Probe for UGA instead of returning early if we can't find GOP.

Reviewed by:    tsoome
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291935
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54431
5d85dde27b4769604fc108b89328607e70e767ed Ahmad Khalifa 2026-01-04 13:15:02
loader.efi: only use firmware provided Blt on GOP
gfx_state.tg_private points to a EFI_GRAPHICS_OUTPUT_PROTOCOL only when
using GOP.

The firmware provided Blt functions on UGA platforms have been observed
to not work on old MacBooks, and are likley hit or miss anyways as UGA
has been deprecated since 2006.

Reviewed by:    tsoome
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291935
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54432
9595055ae7494997bb07b4aaed544f88ac4c5e7f Ahmad Khalifa 2026-01-04 13:15:37
inetd.conf: Correct rsync example
There is no rsyncd binary in the rsync package; rsync is just invoked
with --daemon.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=122037
Sponsored by:   The FreeBSD Foundation
58a14d9596bd9a72683cbd725e817fdabe926139 Ed Maste 2026-01-05 14:51:28
nuageinit: config2_network support dns service cfg
This change enhances `config2_network()` to honor the DNS
configuration, when it's defined through the `services` section.

The `network_data.json` file can hold DNS configuration at two different
places:
- within a network configuration entry
- or `dns` entry in the `services` section, in this case the configuration is global.

An example of such configuration:

{"links": [{"id": "interface0", "type": "phy",
"ethernet_mac_address": "52:54:00:01:59:03"}], "networks": [{"id": "private-ipv4-0", "type": "ipv4", "link": "interface0",
"ip_address": "192.168.123.5", "netmask": "255.255.255.0", "routes": [{"network": "0.0.0.0", "netmask": "0.0.0.0", "gateway":
"192.168.123.1"}], "network_id": "9e5b1ed9-f5e6-4941-a90f-2e06bab858de", "dns_nameservers": ["192.168.123.1"], "services": [{"type":
 "dns", "address": "192.168.123.1"}]}], "services": [{"type": "dns", "address": "192.168.123.1"}]}

See: https://docs.openstack.org/nova/latest/user/metadata.html

MFC After:      1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1941
7af8b75201b7af353fa74c8feb937b52f5ccf9bb Gonéri Le Bouder 2026-01-03 02:11:55
loader.efi: add stride & offset for MacBookPro3,1
Note that there are three variants of this MacBook. We only have the
stride and offset values for the 17" 1680x1050 model.

Reviewed by:    vexeduxr
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1584
be6ba97aaee762c2e5300834f1916ae5dfd5a0b9 Frank Hilgendorf 2025-01-27 21:18:39
nuageinit: only create the default user when needed
The "default" user should only be created when:

- the `users` key is missing
- or the `default` string is present in the `users` list

Since the `public_keys` is extracted from the meta-data, this patch has
to slightly adjust the way they are loaded.
The change simplify the logic around the default user SSH key injection.
Both `ssh_authorized_keys` and `public_keys` are handled at the same time.

MFC After:      1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1952
cbc00fcc2b92e6e38b0a180261547b1a22b461bd Gonéri Le Bouder 2026-01-06 17:18:46
bhyve: improve console error reporting on arm64
Currently, on arm64, if bhyve fails to initialize the console,
it falls into assert(), which does not look particularly pretty
for users.

Replace the assert with proper error handling so bhyve prints
a meaningful error message and exits with status code 4 (error).
That matches the behavior on amd64.

Approved by:            markj
Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D54504
9fc7fe6427579f1c82a371588df6fd6af3b83dfd Roman Bogorodskiy 2026-01-04 13:59:34
lualoader: fix pruning of non-existent default kernel
Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work.  Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).

There's room to improve the error messages here, but for now let's just
make it actually work correctly.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292232
Fixes:  https://cgit.freebsd.org/src/commit/?id=d04415c520b03 ("loader: lua: remove the default kernel [...]")
e30086ab4c8778ea70a3b19e83546ce1b4a16492 Kyle Evans 2026-01-07 18:20:05
loader.efi: Only use SPCR if enabled.
SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.

FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp@FreeBSD.org>
Closes:  https://github.com/freebsd/freebsd-src/pull/1948
d82698ac68c23d856716dc9f6524b9ef363d7eba Jarmo Jaakkola 2026-01-08 05:14:56
loader: Only warn when we have neither FDT nor ACPI
Sponsored by:         Netflix
Reviewed by:            adrian, andrew
Differential Revision:  https://reviews.freebsd.org/D54510
3989a3d8170168570c10f4529a8ce7891d432520 Warner Losh 2026-01-08 05:34:28
nuageinit: set the hostname when user-data is missing
This address the situation reported here
https://github.com/freebsd/freebsd-src/pull/1952#issuecomment-3720210259

The user-data file was missing and the `sethostname` function is never
called. This commit adjusts slightly the logic to avoid the `exit()` call
when the `user-data` file is missing.

MFC After:      1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Differential Revision:  https://github.com/freebsd/freebsd-src/pull/1953
cae280931c9e1f072d8bf300c377ae120300b898 Gonéri Le Bouder 2026-01-07 21:03:34
nuageinit: fix test after recent behaviour change
with recent change nuageinit always create a "freebsd" user, if no
users are specified, which means we do need to get the rootdir in the
testsuite containing a group file otherwise pw complains and the tests
fails.
65e77d34fdff9065616cfaedef3ef53329cdad26 Baptiste Daroussin 2026-01-08 09:52:20
bhyve: add UNIX domain socket support to rfb
This commit adds support for a UNIX domain socket to bhyve's remote
framebuffer. It enables the use of the graphical console when the bhyve instance
is running in a jail with no networking, for instance. A VNC client running on
the host can then connect to the UNIX domain socket through the filesystem.

Signed-off-by:  Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by:   Defenso
Reviewed by:    kevans, markj
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D53814
cbc6f7e941e42639a0314cd121b06493cce8e0e6 Quentin Thébault 2025-11-18 06:44:05
sesutil: Remove width modifier on encoded "Desc" field
Remove the width modifier to remove white space padding
added to "description" field when running
`sesutil --libxo:JP show`.

Reviewed by:    asomers
Approved by:    asomers (mentor)
MFC after:      1w
Sponsored by:   ConnectWise
Differential Revision:  https://reviews.freebsd.org/D54536
bf98d6775d7f18c3596b7d3423db0cc11232bd64 Johan Söllvander 2026-01-08 16:15:54
bhyve: support MTU configuration for SLIRP net backend
Support configuring MTU for the SLIRP net backend, for example:

  -s 1:0,virtio-net,slirp,mtu=2048,open

Update the manual page accordingly.  While here, also document
MAC address configuration.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D54133
90b9a77ebeb8019fbd22b3cf992370cd9b0004a2 Roman Bogorodskiy 2025-12-08 17:37:09
stand: remove powerpcspe linker script
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 9c72e8e3500408f7ce5fc7be500dd3efc0307674)
fa6736526e18a4343f908f41d8019982e6994f05 Minsoo Choo 2025-12-03 04:14:41
Cron: add CC and BCC option for crontab variables
Signed-off-by: Lakshmikanth Ayyadevara <lakshmikanth.a.ayyadevara@oracle.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1865
3e72ce4081f4a8d6b1d879dae201d569ce450261 Lakshmikanth Ayyadevara 2025-10-02 16:08:09
Fix NULL deref segfault in bhyve's usb_mouse.c
Some of the cases inside umouse_request() (usr.sbin/bhyve/usb_mouse.c)
use the data component of an event, while only partially checking if
it's NULL. 'data' has a NULL check, but then 'data' is immediately
deferenced anyway after the check regardless of if it's NULL or not.

For example:
        case UREQ(UR_GET_STATUS, UT_READ_INTERFACE):
        case UREQ(UR_GET_STATUS, UT_READ_ENDPOINT):
                DPRINTF(("umouse: (UR_GET_STATUS, UT_READ_INTERFACE)"));
                if (data != NULL && len > 1) {
                        USETW(udata, 0);
                        data->blen = len - 2;
                        data->bdone += 2;
                }
                eshort = data->blen > 0;
                break;

There are actually four occurrences of this same bug, each in a
different case in this switch block.

Signed-off-by: Jack Bendtsen <jackdbendtsen@gmail.com>
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282237
Reviewed by: imp, jhb, vexeduxr
MFC After: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1728
7631790422464de1aec309018e2c444defe5f629 Jack Bendtsen 2025-06-19 07:40:31
Comments: FreeBSD.conf should not be overwritten
The files /usr/sbin/pkg/FreeBSD.conf.* currently set base repo to {enable: no}.
We don't want to overwrite /local/etc/pkg/repos/FreeBSD.conf that already exists
when users choose tech preview in the installation.

Signed-off-by: Guilherme Augusto de Souza Candinho <cndghm@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1925
849c0eb0702879d7cd0fdec589aac048b691b2ab Guilherme Augusto de Souza Candinho 2025-12-13 22:55:28
bsdinstall: Create separate datasets for directories in /usr/ports
Both distfiles & packages contain compressed files.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1873
3e8619e535b61c99f0dc50cc6c7e237eb82a8be7 Ricardo Branco 2025-10-12 10:32:02
Commit group #42: newfs: Add an option to disable soft updates
newfs: Add an option to disable soft updates

A previous commit turned soft updates on by default for UFS2 without
providing a way to turn them off.  This corrects that by adding a new -u
flag which forces soft updates (and soft updates journaling) off.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Fixes:          https://cgit.freebsd.org/src/commit/?id=61dece6d27fb ("Enable soft updates by default for UFS2 filesystems.")
Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D54576
68562f8145e8154e7e276897a546995f0d8f3428 Dag-Erling Smørgrav 2026-01-11 02:34:00

newfs: Add -u to getopt string

Fixes:          https://cgit.freebsd.org/src/commit/?id=68562f8145e8 ("newfs: Add an option to disable soft updates")
717ae163919e48f000b94f85dc188e0d92261929 Dag-Erling Smørgrav 2026-01-11 14:07:47
jail(3): fix common usage after mac.label support
Nobody else's mac.conf(5) has any entries for jails, so they get a
trivial ENOENT and we fail before we can fetch any jail parameters.
Most notably, this breaks `jls -s` / `jls -n` if you do not have any
loaded policy that applies jail labels.

Add an entry that works for everyone, and hardcode that as an ENOENT
fallback in libjail to provide a smoother transition.  This is probably
not harmful to leave in long-term, since mac.conf(5) will override it.

This unearthed one additional issue, in that mac_get_prison() in the
MAC framework handled the no-label-policies bit wrong.  We don't want
to break jail utilities enumerating jail parameters automatically, so
we must ingest the label in all cases -- we can still use it as a small
optimization to avoid trying to copy out any label.  We will break
things if a non-optional element is specified in the copied in label,
but that's expected.

The APIs dedicated to jaildescs remain unphased, since they won't be
used in the same way.

Fixes:  https://cgit.freebsd.org/src/commit/?id=db3b39f063d9f05 ("libjail: extend struct handlers [...]")
Fixes:  https://cgit.freebsd.org/src/commit/?id=bd55cbb50c58876 ("kern: add a mac.label jail parameter")
Reported by:    jlduran (on behalf of Jenkins)
Reviewed by:    jlduran
Differential Revision:  https://reviews.freebsd.org/D54786
3f3b53e68a7b2f9319ee1fdac82b511c9f9f22d7 Kyle Evans 2026-01-20 02:57:42
nanobsd: Use NANO_DEF_{UNAME,GNAME}
Prefer to use NANO_DEF_UNAME and NANO_DEF_GNAME instead of a fixed
"root/wheel".

Fixes:          https://cgit.freebsd.org/src/commit/?id=61ac7309c366 ("nanobsd: Add a provisional populate_part function")
MFC after:      3 days
aed4089c2573420be042a90af51fb538d0b63fe5 Jose Luis Duran 2026-01-20 16:51:06
nanobsd: Avoid unnecessary subshell execution
Mimic c99bb5747f5e ("nanobsd: minor formatting cleanup") and cleanup
_create_code_slice(), somehow I missed it when rebasing.

No functional change intended.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ecc039be7fdd ("nanobsd: Add a NO_ROOT build option")
MFC after:      3 days
eced166af01565fb1d6278a8918e844ebc4412a6 Jose Luis Duran 2026-01-20 16:50:47
cron: Implement full PAM session lifecycle for user jobs
Extend PAM integration beyond account checks to include credential
establishment and session management, allowing PAM modules to configure
the execution environment for user cron jobs.

Previously, cron only called pam_acct_mgmt() to verify account validity
but immediately terminated the PAM handle before job execution. This
prevented PAM modules from establishing sessions, setting credentials
(e.g., Kerberos tickets), or exporting environment variables needed by
jobs.

The PAM handle now persists in the intermediate process throughout the
job execution, enabling proper session open/close pairing. Credentials
are established and sessions opened while still running as root, before
dropping privileges in the grandchild. PAM environment variables are
exported in the job process with user crontab variables taking precedence.

A session rule (pam_permit.so) is added to /etc/pam.d/cron to enable
session support without changing default behavior. Administrators can
replace this with other modules as needed.

System crontab entries continue to bypass all PAM operations.

PR:             bin/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244844
Reviewed by:    des
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D54415
12444a4da514e91fdf984b31e1691d042d5f88d2 Xin LI 2025-12-29 09:32:24
mdmfs: Fix soft updates logic
Now that newfs(8) has a command-line argument to disable soft updates,
use that instead of running tunefs(8) after the fact to turn them off.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    mckusick, imp
Differential Revision:  https://reviews.freebsd.org/D54783
4b9620433855b75989164c1a8a8a2e1a9b5fbff2 Dag-Erling Smørgrav 2026-01-22 18:16:37
nanobsd: Use mtree -C to produce the metalog
Prefer an mtree -C output, which is guaranteed to be mtree-compatible.
Add "gname", "uname", and "tags" to the default keyword set, while
removing "size" and "time", the latter being set on kernel file entries
and taking precedence over makefs -T (when paired with -F).

As a side effect, this produces a cleaner file with sorted keywords.

Note that passing "-u" to sort in order to pipe to mtree is no longer
necessary, but we'll do it out of habit.

Reviewed by:    imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54854
cd730bef74f9ecc2500fd5c01094dd5bfd34c246 Jose Luis Duran 2026-01-24 02:06:57
loader: Only warn for !FDT && !ACPI take two
For unclear reasons, we used to print two warnings about not having a
DTB: First,
        printf("No valid device tree blob found!\n");
and immediately later a second,
        printf("WARNING! Trying to fire up the kernel, but no "
            "device tree blob found!\n");

A previous commit silenced the second warning in the event that the
acpi.revision environment variable was set, on the theory that systems
which have ACPI might not need a DTB; this commit silences the first
of the two warnings under the same condition.

Reviewed by:    andrew
Fixes:  https://cgit.freebsd.org/src/commit/?id=3989a3d81701 ("loader: Only warn when we have neither FDT nor ACPI")
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D54772
ec2b3d786b236ac64ff5d3e28e8d05e2293896d5 Colin Percival 2026-01-19 01:19:03
nanobsd: Fix _populate_part()
- Avoid unnecessary subshell execution
- Fix removing the temporary and empty /cfg directory
- Do not remove the generated metalog file for /cfg or /data partitions

Fixes:          https://cgit.freebsd.org/src/commit/?id=61ac7309c366 ("nanobsd: Add a provisional populate_part function")
MFC after:      3 days
4f093770b5d55e176786db27d6f99639ae42a40e Jose Luis Duran 2026-01-24 08:58:05
bhyve: Use PCIOCGETCONF to find the host LPC bridge
pci_host_read_config() requires write access to /dev/pci so cannot be
used with unprivileged bhyve.  The lpc init code uses it to find the
host system's LPC bridge device and so was generating warnings with
bhyve running as a non-root user.

Refactor the implementation to use PCIOCGETCONF instead, which doesn't
require any special privileges.  This isn't formally necessary, as we
only care about copying the host system's identifiers in order to
support Intel GPU passthrough (see commit f4ceaff56ddaa), but it's
straightforward and lets an unprivileged user run bhyve without seeing
warnings about failing to open /dev/pci with write permissions.

Reviewed by:    corvink, rew
MFC after:      3 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54851
1db1e4bdc64f29661592a47f2feb690d7cf37957 Mark Johnston 2026-01-26 21:05:06
sbin/setkey: add -Z option to disable receive timeouts
Sponsored by: NVidia networking
MFC after:      1 week
d47c1c2cf562a7583758387cd652e98b91ab83f6 Konstantin Belousov 2026-01-20 12:09:47
stand/zfs: fix path setup in zfs_mount()
Need to check argument 'path', not just allocated struct member.
ab5f29ae9ef0246cee27d246ee48923030575aae Toomas Soome 2026-01-28 08:32:13
loader.conf.5: "console" setting does not document multi-value possiblity
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292595
Approved by:    ziaee, dab, imp, tsoome
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54843
240c614d48cb0484bfe7876decdf6bbdcc99ba73 Michael Osipov 2026-01-23 20:26:24
flua: lposix: fix WARNS=6 issues
lposix is the last holdout of modules built into flua until we can fix
the module design to have the right parts require()able.  Address a
valid bug in lua_read() found at a higher WARNS and drop the override
entirely.  Some of the modules could possibly be re-evaluated.

Fixes:  https://cgit.freebsd.org/src/commit/?id=c2caf3b3313 ("flua: lposix: add more useful functions [...]")
Reported by:    des
Reviewed by:    des
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
b41b6fdb3a1635de4c2a9280aab12b83e3aeffc5 Kyle Evans 2026-01-28 15:37:04
ifconfig: Exit with a non-zero status when SIOCSIFFIB fails
Previously, setting an interface FIB to some invalid value would result
in a warning being printed, but the ifconfig command would exit with
status 0, but this is wrong.

Add a little regression test.

Reviewed by:    pouria, zlei, melifaro
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54918
2ea85a622bcba92a7b58901d6a6e945df3022c4e Mark Johnston 2026-01-28 16:11:47
cpucontrol: Be more strict with input validation
Avoid truncating 32-bit values.  This would have saved me a bit of time
when I was looking at a cpuid leaf on my system and typed 0x80000001f
instead of 0x8000001f.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54919
59bbb62b6078afffd1c182b63d43934248289675 Mark Johnston 2026-01-28 16:31:41
Set virtual_oss_enable="NO" in /etc/defaults/rc.conf
This prevents 'service -e' from emitting (/var/log/messages):

/usr/sbin/service: WARNING: $virtual_oss_enable is not set properly - see rc.conf(5)

Pull Request:   https://github.com/freebsd/freebsd-src/pull/1987
Reviewed by:    christos
Signed-off-by:  eborisch@gmail.com
MFC after:      1 week
1b2d495a24c36d81b14178a2f898025946bff2d8 Eric A. Borisch 2026-01-29 07:32:45
loader: Prefer comma-separated list of values for "console"
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292595
Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54923
56970c3c4b0bc61d972837661a31cc2b9e8e8d7c Michael Osipov 2026-01-28 09:02:33
nuageinit: support fetching configuration on multiple iface
On some environement a VM can be connected to multiple ifaces but only
one will respond to dhcp and able to fetch the metadata.

Launch the early dhclient on all available ifaces and as soon as one
dhcp has successfully configured an iface, proceed with fetching the
metadata.

MFC After:      1 week
Reported by:    mateusz.klejn@ovhcloud.com
Tested by:      mateusz.klejn@ovhcloud.com
Sponsored by:   OVHcloud
90a7728cd8905cd26b90d06f7873df8bad43ae9a Baptiste Daroussin 2026-01-29 09:56:33
nanobsd: embedded: Stub out experimental functions
Stub out both experimental functions introduced in ecc039be7fdd when
doing embedded builds.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ecc039be7fdd ("nanobsd: Add a NO_ROOT build option")
MFC after:      3 days
f54f362d62c638529b66ea351821752e756a9a21 Jose Luis Duran 2026-01-27 05:54:04
heimdal: Add missing function prototypes
This fixes the build with GCC 14 on stable/14 which raises fatal
-Wimplicit-function-declaration warnings.

Reviewed by:    rmacklem, cy
Fixes:          https://cgit.freebsd.org/src/commit/?id=5000d023a446 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:  https://reviews.freebsd.org/D54931
8a8dc73ef87b538c369abc1b642e2a40b52c53c2 John Baldwin 2026-01-31 17:00:15
heimdal: Pass the correct pointer to free in an error case
This fixes a warning reported by GCC 14 on stable/14:

crypto/heimdal/lib/hdb/keys.c:241:13: warning: 'free' called on pointer 'ext' with nonzero offset 16 [-Wfree-nonheap-object]
  241 |             free(hist_keys);
      |             ^~~~~~~~~~~~~~~
crypto/heimdal/lib/hdb/keys.c:234:15: note: returned from 'calloc'
  234 |         ext = calloc(1, sizeof (*ext));
      |               ^~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by:    rmacklem, cy
Fixes:          https://cgit.freebsd.org/src/commit/?id=5000d023a446 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:  https://reviews.freebsd.org/D54932
b26a7af438f36dcde86f39a681123cc2140affb2 John Baldwin 2026-01-31 17:00:44
stand: Use the correct OUTPUT_ARCH in the linker script for RISC-V
Compare to the OUTPUT_ARCH in sys/conf/ldscript.riscv.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D54962
2e8ef82b3418b41e7c54e2dbd16df0edb3cb8376 John Baldwin 2026-01-31 17:09:44
Commit group #43: nvmecontrol
nvmecontrol: Always set the RAE bit on telemetry-log requests

nvme-cli, as well as some vendor scripts, always set the RAE bit of the
GET LOG PAGE request when retrieving telemetry logs to avoid the log
getting reset to something new. Adopt that praactice here (nvme-cli
telemetry-log does have a --rae option, but that just turns on the rae
bit which defaults to being on: there's no way to turn it off).

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55017
05322eec86ae42a8f873ba10d8da61bd61b5b48f Warner Losh 2026-02-02 13:30:08

nvmecontrol: telemetry-log don't sanity check host generation number

Don't sanity check the host initiated generation number. It's not
necessarily constant between the two log page fetches. nvme-cli doesn't
do this stanity check and it generates a lot of false positives.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55018
ff9fe85ff245bfbf6f54f98175282be5cf500cb3 Warner Losh 2026-02-02 13:30:22

nvmecontrol: telemetry-log --verbose

Add -v / --verbose to report status report since these things can take
minutes to retrieve.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55019
350c1232a57a64b955a3ae7f9b92dde164d1eb65 Warner Losh 2026-02-02 13:30:28
heimdal: Pass the correct pointer to realloc when growing a string buffer
The realloc in my_fgetln was trying to grow the pointer to the string
buffer, not the string buffer itself.

In function 'my_fgetln',
    inlined from 'mit_prop_dump' at crypto/heimdal/kdc/mit_dump.c:156:19:
crypto/heimdal/kdc/mit_dump.c:119:13: error: 'realloc' called on unallocated object 'line' [-Werror=free-nonheap-object]
  119 |         n = realloc(buf, *sz + (*sz >> 1));
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/heimdal/kdc/mit_dump.c: In function 'mit_prop_dump':
crypto/heimdal/kdc/mit_dump.c:139:11: note: declared here
  139 |     char *line = NULL;
      |           ^~~~

Reviewed by:    rmacklem, cy
Fixes:          https://cgit.freebsd.org/src/commit/?id=a93e1b731ae4 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:  https://reviews.freebsd.org/D54933
03d8ac948b1ad9c419b294c3129b7da58d818363 John Baldwin 2026-02-02 17:18:11
rc: run the zfs rc script before tmp
The tmp rc script has much the same problem that the var does: it wants
to test if /tmp is writable, and mount a tmpfs if it's not.  This means
that we actually want our zfs datasets mounted first, because we might
have a /tmp dataset that changes the story.

The ordering problem is particularly noticable with a r/o zfs root,
since the write test will fail and we'll mount a tmpfs that later gets
covered by our /tmp dataset.  If that /tmp dataset inherited readonly,
then we're still in trouble.

This also fixes `tmpmfs=yes`, which would again get covered by a zfs
dataset with the existing ordering.

Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D54995
d3f21856aa72c28408660ed40ce76bbd0716a991 Kyle Evans 2026-02-03 03:21:42
nvmecontrol: Pass 1 to uint8_t arg
The rae arg is uint8_t (which we then shift over to the right bit. Pass
'1' instead of 'true' here to match the interface. While true is
promoted to (uint8_t)1, we don't use it as a bool in read_logpage().

Fixes:                  https://cgit.freebsd.org/src/commit/?id=5322eec86ae4 ("nvmecontrol: Always set the RAE bit on telemetry-log requests")
Sponsored by:           Netflix
Reviewed by:            chs
Differential Revision:  https://reviews.freebsd.org/D55060
cbb7441245cf2b22efed17dec3c88587c980c691 Warner Losh 2026-02-03 17:34:36
ifconfig: fix gre(4) status
Set `ifr->ifr_name` to display gre options
for the interface.

Reviewed by: glebius, zlei
Approved by: glebius (mentor)
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D55099
c2ba906fa63982d7aa799466d83716d39fe91d2b Pouria Mousavizadeh Tehrani 2026-02-04 11:03:22
etcupdate: Do not ignore empty files.
PR:           bin/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292773
Reviewed by:    markj
MFC after:      1 week

Differential Revision: https://reviews.freebsd.org/D54935
4f7336a93cb84a0633ca9aa715e474625b4adce5 Xin LI 2026-01-29 03:23:15
pkg: Fix mirror type parsing and service discovery
Signed-off-by: Pavel Knoblokh <info@software-advisory.com.au>
Reviewed by:    emaste, imp, kevans
Fixes:          https://cgit.freebsd.org/src/commit/?id=dc4581589a3 ("pkg: clean support for repositories")
Closes:         https://github.com/freebsd/freebsd-src/pull/1989
abf911af22729858cc876231e7970eff6aefbb9d Pavel Knoblokh 2026-02-05 03:59:21
bhyve/virtio: check negotiated_caps for indirect descriptor support
vq_getchain() erroneously checked vc_hv_caps for indirect descriptor
support when it encountered an indirect descriptor. vc_hv_caps is used
in feature negotiation to advertise what features our device emulation
supports, but we should really check what features we have negotiated
with the driver.

Reviewed by: corvink
Differential Revision: https://reviews.freebsd.org/D53465
5379c4627782ebb2619f95a5784361c88472c8b5 Hans Rosenfeld 2026-02-05 18:48:10
bhyve/virtio-scsi: advertise support for indirect descriptors
Support for indirect registers is actually part of the common virtio code,
the virtio-scsi code doesn't actually care or even know anything about it.

Advertising the features greatly improves performance with some guest
operating systems.

Reviewed by: corvink
Differential Revision: https://reviews.freebsd.org/D53467
94976733d35234c629fdb086036f2319c44eb08c Hans Rosenfeld 2026-02-05 18:52:56
bhyve/virtio-scsi: Unlimit max_sectors
The old default of 2 for max_sectors limits performance significantly
with guest systems where the virtio-scsi driver actually honors this
value.

As CTL doesn't seem to have any limit of the maximum size of a single
transfer, set this to INT32_MAX by default.

Reviewed by:    corvink
Differential Revision: https://reviews.freebsd.org/D53466
73ab91aaade5f33459fda16d9daf6526ab668c42 Hans Rosenfeld 2025-10-29 14:09:43
bhyve: Simplify passthru_msix_addr()
It can use the passthru_mmio_map() helper function.  Make that change,
and also make passthru_mmio_map() use EPRINTLN to fix formatting when
the guest console is stdio.

Reviewed by:    corvink, jhb
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55067
86150ed98b7903feaba942f01619e74894cd23c4 Mark Johnston 2026-02-06 15:30:56
daemon: Add option for output file mode
The daemon utility has always created its output file with a fixed mode
of 0600. This causes issues for log collection setups where the collector
does not run as root but instead relies on group access to the watched
daemon’s log file.

Introduce a new option that allows specifying the output file mode using
install(1)-style semantics. This enables non-root log collectors to access
the file as intended and improves compatibility with log rotation tools.

Reviewed by:    kevans
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D54930
a3b90a1f008365d9f62773998f89f9c872e2bed5 Michael Osipov 2026-01-28 18:49:26
vmrun.sh: add option for sharing directory via p9fs to bhyve
Reviewed by:  markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55100
525d00dcf45f6f83b188cf1ad7bfcfcc8ea39eca David Marker 2026-02-07 21:28:58
bsdinstall: Add note to zfsboot pointing to release/tools/vmimage.subr
The VM image creation scripts have a copy of this list of datasets which
should be kept in sync, which can otherwise be easily missed, as was the
case in the now-reverted 3e8619e535b6 ("bsdinstall: Create separate
datasets for directories in /usr/ports").
825aaabcc7ac3750b330d3e54bd1ccf349df48c9 Jessica Clarke 2026-02-08 17:17:06
flua: Fix SIGSEGV in lua_chown when uid/gid doesn't exist
When lua_chown is used to call chown(2) internally, it first resolves
the user and/or group by calling the getpwnam_r(3) and getgrnam_r(3)
functions, respectively. However, although it checks for errors, it does
not check when entries are not found (which is not an error), which
means that the buffer will be set to NULL, and since lua_chown attempts
to access the NULL structure, it will receive a SIGSEGV signal.

Reviewed by:                    imp@
Approved by:                    imp@
Differential Revision:          https://reviews.freebsd.org/D55172
436af5715cdbea87de53d63fcc3762591d93b028 Jesús Daniel Colmenares Oviedo 2026-02-08 20:35:25
rc.d: Convert more service to Use startmsg
Signed-off-by: Thibault Payet <contact@thibaultpayet.fr>
Reviewed by: imp,mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/2001
d3ed0e0ab06a1434032abd7f013d02611567fd43 Thibault Payet 2026-02-03 09:27:41
traceroute: graceful recover after networking errors with as_server
Currentlu, the traceroute[6] utility does not check
for possible networking errors while talking to as_server
in case of "traceroute -a". Meantime, there is a common case
when trace is long and it has many non-responding hops
(shown as '* * *'), so as_server aborts our connection,
hence no AS numbers shown for the rest of trace.

Somewhat artifical way to reproduce the problem:

traceroute to 57.144.244.1 (57.144.244.1), 80 hops max, 48 byte packets
 5  [AS174] be2950.ccr42.fra05.atlas.cogentco.com (154.54.72.42)  74.277 ms  9.605 ms  9.599 ms
 6  [AS174] 149.11.228.19 (149.11.228.19)  9.506 ms  9.466 ms  9.420 ms
 7  [AS33182] po172.asw02.fra5.tfbnw.net (129.134.108.146)  9.725 ms  9.874 ms  9.696 ms
 8  [AS32934] psw04.fra5.tfbnw.net (157.240.59.85)  8.718 ms  8.691 ms  8.618 ms
 9  * * *
10  [AS0] edge-star-mini-shv-01-fra5.facebook.com (57.144.244.1)  9.747 ms  9.815 ms  9.699 ms

Note what due to increased timeout (-w10) we get [AS0] for 10th hop
because as_server closed our connection. Same problem occurs
with default -w3 when there are lots of '* * *' hops in a trace.

Fix it with some additional error checking and a reconnection.

This patch was in my use for many years and after traceroute(8) moved
from contrib/ to usr.sbin/ it's nice to have it in the tree.

MFC after:      2 weeks
60a6ebaf73719ef7aa15768c3906626fb106b2b3 Eugene Grosbein 2026-02-09 09:47:01
mtree: stop creating /usr/share/doc/ncurses
In base 68ad2b0d7af2a the ncurses html documentation was removed, and
entries added to ObsoleteFiles.inc to get rid of /usr/share/doc/ncurses,
but the directory was still being re-created via BSD.usr.dist. Remove it
from there too.

Fixes:          https://cgit.freebsd.org/src/commit/?id=68ad2b0d7af2a
MFC after:      1 month
212272a43767c3d7be3ddb87605612f6164774c1 Dimitry Andric 2026-02-10 14:32:52
moused(8): Use KQUEUE_CPONFORK flag to pass kqueue fd through fork
and use libc daemon() instead of private rfork-based copy.
20a3c611f53dfad830f9907e24fa08b80b674860 Vladimir Kondratyev 2026-02-10 22:59:06
freebsd-update: Error for -b basedir without UNAME_r set
freebsd-update sets the currently running release from UNAME -r, which
can be overridden via the --currently-running commandline option (or by
setting UNAME_r in the environment).  This may be invalid if -b is used
to specify a basedir other than /, so error out if -b is specified
without setting the currently running version.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283229
Reviewed by:    cperciva
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48016
097458ac665db732cc91a22279da4cc14f694da2 Ed Maste 2024-12-10 13:47:34
Commit group #44: ngctl
ngctl: Modernize code somewhat

* Replace fgets(3) with getline(3)

* Replace select(2) with poll(2)

* Avoid needlessly copying text around

* Correct use of getopt(3)

* Pick some style and whitespace nits

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55257
3cbdcabf714d5187e22d8ff1cbfbc261dc8622eb Dag-Erling Smørgrav 2026-02-13 15:57:40

ngctl: Check hook name length

Check the length of the hook name when copying it into the sockaddr.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55258
585190dff436eeea3be97300e36c82559028d3dd Dag-Erling Smørgrav 2026-02-13 15:57:46

ngctl: Fix buffer overflow in config command

Keep track of our buffer length when assembling the argument list.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293075
MFC after:      1 week
Reviewed by:    zlei, markj
Differential Revision:  https://reviews.freebsd.org/D55259
59906a163e474c8d00bdebe226c4d47332b91bad Dag-Erling Smørgrav 2026-02-13 15:57:50
bhyve: Fix a misleading error message
The ioctl might fail because it's run in a jail which doesn't have
permission to invoke ppt ioctls.

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55070
7ab5e3f29a50bc9294a139cc0e8e661a7c036ba3 Mark Johnston 2026-02-16 14:56:39
syslogd: Improve handling of configuration errors
Make parse_selector() print a warning to stderr and continue parsing the
config if it encounters an invalid facility or priority.  Note that
because the parsing is done from a casper service, there isn't a good
mechanism to log errors; the warnings are visible only when syslogd is
started in debug mode.

Reported by:    Doug Hardie <bc979@lafn.org>
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=f4b4a10abb26 ("syslogd: Move selector parsing into its own function")
Reviewed by:    jfree, jlduran, eugen, delphij
Differential Revision:  https://reviews.freebsd.org/D55033
29ec3907f193e205a1c2118c182ec43e51baf717 Mark Johnston 2026-02-16 19:50:45
bhyve: Propagate errors from rfb_recv_* functions
Update rfb_recv_* functions to return -1 on failure and 0 on success.
Update rfb_handle to check these return values and drop the connection
if an error occurs.

Signed-off-by: Hayzam Sherif <hayzam@gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
757b0bf5cf46230bcbeeb298f734b9bb7cde1817 Hayzam Sherif 2026-02-16 17:46:35
recoverdisk: Ensure medium_read is multiple of small_read.
d7d0369ad331d17ca2bc0076b2f1ab8bed88c5f4 Poul-Henning Kamp 2026-02-17 18:33:41
bhyveload: If disk cannot be opened RW try RO. (=same as bhyve)
Not expecting it to turn into yak-shaving: kevans
0f2b7181ea5acbabe11bf2c732078e8898c02c40 Poul-Henning Kamp 2026-02-17 18:36:04
camcontrol: Add SPDX-License-Identifier tag
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55269
25ed5ee654a8cd7d9f694307c62bb84ff4d16866 Tuukka Pasanen 2026-02-09 08:12:25
newfs_msdos: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55274
8ac992645850318d8b2cf93b083372b99b6374e1 Tuukka Pasanen 2026-02-09 08:20:05
decryptcore: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55270
299d3e944a15cbffc8ed16a49869e1eaec1fb493 Tuukka Pasanen 2026-02-09 08:14:10
ipfw: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55273
904e0dcd2967cfe72899e7285e6cd6e9977ae68c Tuukka Pasanen 2026-02-09 08:19:20
nvmecontrol: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55275
f8517c21d57f1db005c0d15e14d16252e8e4bfd0 Tuukka Pasanen 2026-02-09 08:21:25
nvmecontrol: Remove an incorrect use of PAGE_SIZE
The mdts value is in terms of the nvme page size, not the host page
size. On many architectures these are both 4k, however on arm64 it is
possible to build a system with the host page size of 16k.

Use NVME_MPS_SHIFT to get the correct nvme page shift.

Reviewed by:    imp
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55334
bfb7c81f93b534f8c10928d80ea56c8177a6f39f Andrew Turner 2026-02-18 14:20:57
devmatch: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55271
835813c88ab6e44590c2d47e2d66fe153cf9dfc5 Tuukka Pasanen 2026-02-09 08:17:45
ifconfig: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55272
d685228989020f7bceebdaf6ea79be09305d2954 Tuukka Pasanen 2026-02-09 08:18:34
ed: add missing test entry in mtree
Reported by:  olce
9a6e77e3dbc0daa7c4a3e816a73bc45d0af27b9e Baptiste Daroussin 2026-02-19 11:56:23
ypserv: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
ac8189e6de8fb5de31d5b662f1d406f27285ac74 Tuukka Pasanen 2026-02-16 09:46:12
yppush: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
d6bec77ad8f80438f10bb3fe7a8bc8e9265e2858 Tuukka Pasanen 2026-02-16 09:45:25
virtual_oss: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
6d5a428056b52c7ce47b01d6af8aaaff6feecfdd Tuukka Pasanen 2026-02-16 09:43:58
makefs: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
6010b73fa9574b8e651b08451f30ba9c05f3f894 Tuukka Pasanen 2026-02-16 09:26:43
bhyve: Fix unchecked stream I/O in RFB handler
Convert rfb_send_* helpers to return status codes and check their
results. Add missing checks for stream_read() and stream_write() returns
during the handshake in rfb_handle() to avoid acting on failed I/O.

Signed-off-by:  Hayzam Sherif <hayzam@gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55343
818971cc403e78d42b77eb6c18a2d2a073e5541f Hayzam Sherif 2026-02-19 19:24:02
bhyve: fix USB mouse requests
USB HCI requests may not include HCI transfer block structures (i.e.,
xfer->data[] == NULL), but in several places, the USB mouse emulation
code assumes one will exist. This can lead to a NULL pointer dereference
and a SEGV in the bhyve process as observed via experiments with an
Ubuntu guest and PyUSB code. Note that many of the cases processing
other request types already checked for data == NULL.

While in the neighborhood, fix a typo in the loop iterating over the
usb_data_xfer_block array which used the wrong variable to check for
valid data (idx vs. i).

Reported by: danmcd@edgecast.io
Obtained from: SmartOS
MFC after: 1 week
Relnotes: yes

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54661
10d5404adb11773969a600428d1abeb4308d98aa Chuck Tuffli 2026-02-19 22:27:49
fstyp: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
836ac989933bcd5b662979bfdec429a201c123a6 Tuukka Pasanen 2026-02-16 09:22:39
bhyve: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
499d0f04f55e52327d624d27ead3a0d16e3b465a Tuukka Pasanen 2026-02-16 09:02:51
loader.efi: tss_pa setup seems to be flawed in trap.c
since sd_lobase is 24 bits, we would need to shift 24 bits, not 16.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55178
dc11af08a4983237a90c3500ecf500ed41b0802b Toomas Soome 2026-02-21 08:49:34
loader.efi: free_tables() appears to free tss_pa twice.
we check and reset loader_gdt_pa, but use FreePages(tss_pa).

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55179
f2186bbd63fc4185a42740dfee8c403e3d9b2ae9 Toomas Soome 2026-02-21 15:20:54
loader.efi: efi_redirect_exceptions does use uninitialized pointer
loader_idt.rd_base is not set when we are attempting to bcopy(),
resulting to data stored to page 0 and therefore corrupting it.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55180
23605a8e5124dcbd27aa3a8bfbca20ee2b179361 Toomas Soome 2026-02-21 15:27:35
ttys: Correct comment about required statuses
The status field also accepts onifconsole and onifexists,
so it looks crusty saying that it only accepts on and off.

Reviewed by:    imp
Closes:         https://github.com/freebsd/freebsd-src/pull/2042
6d15e0efa0b3a85cf69f3c72d3f24f4f97850a03 Alexander Ziaee 2026-02-22 07:37:45
virtual_oss: use hw.snd.default_unit by default
Reviewed by:  christos
MFC after:      1 week
Signed-off-by:  Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by:   Defenso
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293130
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2043
06b466526a7fc35cc6fc5bf6f6269e7f3a0a7aea Quentin Thébault 2026-02-23 12:33:33
ngctl: Fix getline loop
I misremembered when I wrote this code: getline() returns -1 on EOF, not
zero, so the loop condition and the error check are both incorrect
(though in practice getline() will never return 0).

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=3cbdcabf714d ("ngctl: Modernize code somewhat")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55487
6c4777c59325c2cfefcce0c466b3bf475404a550 Dag-Erling Smørgrav 2026-02-24 14:23:39
camcontrol: Print 'transport revision'
As described in Serial ATA Revision 3.5a

Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2044
f4f9054dc47b430872d38c7a75fea753c6fe796f Dmitry Lukhtionov 2026-02-23 14:42:59
bhyve: Fix truncate_iov()
The implementation was simply wrong.  It would always just return the
first entry in the iovec, even if the requested length is larger than
that first entry.

Note, this function will be removed soon, see D53468.

Reported by:    Vinod p n <vinod272@gmail.com>
Reviewed by:    des, emaste, Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55438
d7d4da91de201841c57a6b8f89b450754b9b8696 Mark Johnston 2026-02-24 15:14:39
bsdinstall: fix EFI boot entry creation
update_uefi_bootentry assumes that the caller sets FREEBSD_BOOTNAME and
mntpt, which isn't the case anymore. The result is that there is no
"FreeBSD" boot entry created/updated after install. Most machines manage
to boot from the removable media path (if the loader is installed there
too), but some don't.

Take the loader's path as an argument and rename the variable used in
the ZFS mirror loop so mntpt can be reused below.

Also mark nentries as a local variable so it doesn't leak out of the
function.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293385
Fixes:          https://cgit.freebsd.org/src/commit/?id=494de51bc0074472d1b01604f085daea0844f240
MFC after:      2 days
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55469
0fd91c489134643ac9e38c0f55ba7464fe892c5e Ahmad Khalifa 2026-02-24 20:11:32
lpd: Improve robustness
* Check for integer overflow when receiving file sizes.

* Check for buffer overflow when receiving file names, and fully
  validate the names.

* Check for integer overflow when checking for available disk space.

* Check for I/O errors when sending status codes.

* Enforce one job per connection and one control file per job (see
  code comments for additional details).

* Simplify readfile(), avoiding constructs vulnerable to integer
  overflow.

* Don't delete files we didn't create.

* Rename read_number() to read_minfree() since that's all it's used
  for, and move all the minfree logic into it.

* Fix a few style issues.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293278
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55399
9065be0a5902e058d25a42bd9b3fbe9dc28b189d Dag-Erling Smørgrav 2026-02-26 06:15:06
lpd: Add timeout option
Set a 120-second receive timeout on all client connections, and add a
command-line option to change that value.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55400
56fbfd1ecdc78fc99b3a2e381c355ce8980de39d Dag-Erling Smørgrav 2026-02-26 06:15:14
route(8): Fix -expire argument when using netlink
Also fixes nexthop expire value on route get using netlink.

Reviewed by: glebius
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D55444
8230cf1aa18d9215ee17fec743fc7c7c8fa2da13 Pouria Mousavizadeh Tehrani 2026-02-22 18:41:31
route(8): show expire time of each nexthop in monitor
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55514
b5366f8e138e223d85d7c9b71f0a0384f5d55f29 Pouria Mousavizadeh Tehrani 2026-02-25 16:45:36
loader.efi: try all ZFS pools found by efi_zfs_probe()
Remove global uint64_t pool_guid and instead iterate over all pools that
efizfs_get_zfsinfo_list() provides.

The global pool_guid used to mark that we have constructed a ZFS pool and
the pool label that was used for that was stored on a partition that is
the EFI image device handle.

First problem here is that it is too restrictive.  If the very first
device to probe is a spare member of a pool, it will be used to
instantiate a pool but (pd->pd_handle == boot_img->DeviceHandle) won't be
true, thus global pool_guid won't be populated and ZFS boot won't be
tried.

Second problem is that potentially we may find several pools, and all
should be tried to boot.  Note that the code for that is already here -
efizfs_get_zfsinfo_list() is imported by efizfs.h but was not used until
now.

Reviewed by: imp
Differential Revision:  https://reviews.freebsd.org/D55094
d69fc3a9dc71768e125e83d35274f0820063e42d Gleb Smirnoff 2026-02-27 00:57:26
stand/efi: Allow RELAXED or STRICT boot policies
The RELAXED boot policy will automatically search for any root
filesystem (currently zfs only) on any device. STRICT policy only
searches on the boot device. RELEAXED will still prefer the device we
booted from, which is the smallest behavior change we should do. STRICT
may be needed for releases, though.

Sponsored by:           Netflix
Reviewed by:            glebius
Differential Revision:  https://reviews.freebsd.org/D55107
784150fd25351f4a38f4d983882f4a26cc5d3272 Warner Losh 2026-02-27 00:57:39
bsdinstall: remove ftp.at.freebsd.org
After ~13 years of running the ftp.at.freebsd.org community mirror is
shutting down at the end of March.  Remove it from the mirrorselect
script.

Reported by:    Klaus P. Ohrhallinger <k@7he.at>
d44d79e577eab3e66b993c783b969b82678792d1 Philip Paeps 2026-02-28 09:56:23
bhyveload: simplify cb_open() and eliminate minor TOCTOU
It's not at all clear why I wrote it like this, but we can do better.

I wouldn't think this really has any meaningful security implications
since the hierarchy in question can't really be modified by the guest
scripts, but it would seem to make it a little more robust.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6779d44bd878e3c ("bhyveload: use a dirfd to support -h")
Reviewed by:    bnovkov, markj
Differential Revision:  https://reviews.freebsd.org/D55379
6da9d465c54bf2e3496e83db025c5d22f3b3cc17 Kyle Evans 2026-03-01 03:23:59
crunch: ldconfig and ldd are unrelated to GNU ld
Move them to the usr.bin section.

Fixes: https://cgit.freebsd.org/src/commit/?id=de5663609e4c ("This is the new crunch utility for making...")
e4c8058cf48df2d98e89a7de66d189c71bd4c3fb Ed Maste 2026-03-02 19:34:29
pfctl: consistency
% pfctl -F ethernet
Ethernet rules cleared

% pfctl -s ethernet
pfctl: Unknown show modifier 'ethernet'

pfctl accepts 'ethernet' (or any prefix of it) in the -F flag but
accepts only 'ether' (or any prefix of it) in the -s flag, which seems
inconsistent.  This change brings the two to parity while remaining
backwards compatible.

Reviewed by:    kp
MFC after:      2 weeks
Signed-off-by: Seth Hoffert <seth.hoffert@gmail.com>
36acf1bd32ed5749af4a9f735aeea1a3434fe42f Seth Hoffert 2026-03-03 21:56:45
bhyve/virtio: Rework iovec handling functions for efficiency and clarity
Add check_iov_len() to check whether an iovec array covers a certain
length without the need to call count_iov() on the whole array first.

Garbage-collect the 'seek' argument to buf_to_iov(), used only by
virtio-scsi control request handling. The apparent benefit of using it
to copy only the final status byte instead of the whole TMF or AN
request (25 and 21 bytes, respectively) is dubious at best, given that
the extra code to handle this in buf_to_iov() allocates and frees a new
iovec array and uses seek_iov(), which traverses the whole array and
copies iovecs around.

Replace seek_iov() and truncate_iov(), used only by virtio-scsi, with
a single function split_iov() which combines the functionality of both
in a more efficient way:
While seek_iov() always copies all iovecs past the seek offset into a
new iovec array, split_iov() works in place and doesn't copy iovecs
unless actually necessary. By using split_iov(), we can avoid almost
all copying of iovecs in I/O handling code paths of virtio-scsi.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D53468
a28cf86c4171fbd004d02f331026e1a946d85778 Hans Rosenfeld 2025-10-28 10:33:42
bhyve/virtio-scsi: Preallocate all I/O requests
By preallocating all I/O requests on all queues, we can take most
allocations out of the hot I/O code paths and simplify the code
significantly. While here, make sure we check all allocations for
success and make sure to handle failures gracefully.

Additionally, check for I/O request validity as early as possible,
and return illegal requests immediately.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D53469
2a514d377b37a30356c5c27a07b4fb0fd6df4881 Hans Rosenfeld 2025-10-15 21:07:37
bhyve/virtio-scsi: Check LUN address validity
Instead of blindly trusting the guest OS driver that it sends us well-
formed LUN addresses, check the LUN address for validity and fail the
request if it is invalid. While here, constify the members of the virtio
requests which aren't device-writable anyway.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D53470
4dfeadc32e464557c2aa450212ac419bc567d1e6 Hans Rosenfeld 2025-10-28 08:51:26
rc: virtual_oss: Silence potential hw.snd.default_unit error
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293582
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
e85f221def717660c9daf4c0616dfb9cdfb75827 Christos Margiolis 2026-03-06 12:27:03
rtadvd: add multi pref64 support
Add support for multi pref64 in rtadvd and rtadvctl

Reviewed By: zlei, bz
Differential Revision: https://reviews.freebsd.org/D54636
0951901814d1def721ac9a4fc3657af5c9694228 Pouria Mousavizadeh Tehrani 2026-03-06 11:48:23
devinfo: Support PCI DBSF and ACPI handles for -p
When matching on a name of a device, match on ACPI handles and PCI
selectors in addition to device names.  This can be useful for
matching on devices without an attached driver.

For example: devinfo -p pci0:0:31:0

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55673
ca25b1b26379e27bf2bab7742a7b383ca0bfc7d2 John Baldwin 2026-03-06 20:36:05
fsck_msdosfs: reduce the scope of dentry deletion
When dentry flag is ATTR_VOLUME because of 1 bit flip(from 0x10 to 0x18),
removede function will delete all dentry from invalid dentry postion,
so some normal dentries will be deleted in the same cluster.Unfortunately,
these normal directories and files will not be visible to the user
after wo do fsck_msdos

Signed-off-by: YangWen <anmuxixixi@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1694
cb69951f7ee68c51ce465dba9b0d2f661c567c4b YangWen 2025-05-07 15:39:30
rc.d/zfs: align zfs mount verbosity in host and jail environments
ZFS script runs different startup seqneces depending on where it runs:
on the host (`zfs_start_main()`) or in a jail (`zfs_start_jail()`):

- `zfs_start_main()` mounts ZFS datasets in verbose mode `zfs mount -va`
- `zfs_start_jail()` mounts ZFS datasets silently `zfs mount -a`.

This change aligns the verbose levels.

NO_ISSUE

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2030
895a97c875a0f3fed3d4399762f6262b5a4aedb9 Samvel Khalatyan 2026-02-18 17:00:13
virtual_oss: Use virtual_oss_delay_ns() to avoid duplication
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
3a410851bf02c247e71bcd06fdeec2706c6b6070 Christos Margiolis 2026-03-07 23:46:25
virtual_oss: Use virtual_oss_timestamp() to avoid duplication
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
e75c8faf277dded0a80d469cb8182583716a2211 Christos Margiolis 2026-03-07 23:46:28
freebsd-update: Document -v verbosity flag
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276099
MFC after:      3 days
Reported by:    michaelo
Co-authored-by: Alexander Ziaee <ziaee@FreeBSD.org>
02fd9fa2952705ea0ed142061dd86aad7e01f8db Paarth Shirsat 2026-03-09 13:49:51
cxgbetool: create one backend routine for all the loadX cmds
They are all doing almost the same thing so it makes sense to have one
common routine.  The new routine supports non-regular files too.  eg.
 # cxgbetool chnex0 loadfw <(fetch -qo - http://srv/t7fw.bin)

MFC after:      1 week
Sponsored by:   Chelsio Communications
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D55747
87c6ec16857939693ee4d5bef9e8aa8b04bad5dc Navdeep Parhar 2026-03-08 19:34:15
stand: lua: break out a few more dirent types in lfs
These are non-standard and specific to the version used in loader.  We
have some desire to recognize symlinks to avoid filtering out kernel
symlinks in the autodetection bits when they would be perfectly fine to
`load`.

This won't be usable right away, so any impending use will need to be
careful to account for nil.

Reported by:    leres
bc531a96c9b28b1cabcd5deb0c9f8f6d815cfebc Kyle Evans 2026-03-09 21:38:57
core.lua: follow symlinks when looking for bootable kernels
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293654
Reviewed by:    kevans
Approved by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55713
e6d579be42550f366cc85188b15c6eb0cad27367 Craig Leres 2026-03-09 21:47:10
virtual_oss: Combine -d, -l and -L option getopt code
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55671
a2b601343bf9261c4ada51e4d4c30c5b9320bb2b Christos Margiolis 2026-03-10 10:55:21
pciconf: Factor out fetching of matching devices from list_devs
The new fetch_devs function fetches the entire list of PCI devices
into a single list, retrying if the list changes while it is being
fetched.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55768
9eb035ff8439195f565b9e3180b727333a4e7170 John Baldwin 2026-03-10 16:48:04
pciconf: Use a single enum to track the current operation mode
Reviewed by:  imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55769
c8fb16542a52ca889c1adf56b2ce13b4ad4cf887 John Baldwin 2026-03-10 16:48:16
pciconf: Use the exported values of bus numbers for PCI bridges
Reviewed by:  imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55772
9a1394957c3054c24995d684e8bc26878702dc6b John Baldwin 2026-03-10 16:50:08
pciconf: Add a tree mode
This lists PCI devices in a hierarchy showing the parent/child
relationship of PCI devices and bridges.  While this is inspired by
lspci -t output, the format is closer to ps -d and also prefers using
new-bus device names when possible.  If a device does not have a
driver, the PCI selector is output in place of the device name.

When the -v flag is given, the vendor and device ID strings are output
after the device name.  If a string for an ID isn't found, the hex ID
values are output instead.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55774
14b8a27883c15d3add3114f855eff7c6bda1b015 John Baldwin 2026-03-10 16:51:00
jail: fix crash with startup commands on a jail without name
Jail name is optional, thus don't try setenv(NULL).

Fixes:  https://cgit.freebsd.org/src/commit/?id=d8f021add40c321c4578da55dae52fb93c7ccb5f
78c4f821f43d530ba1f2a6308a64a8483208ebe3 Gleb Smirnoff 2026-03-13 20:21:26
ipfwpcap: Fix build after libpcap 1.10.6 update
pcap-int.h now references SIZEOF_TIME_T from libpcap's config.h, which
is not available to consumers of the internal header outside of the
libpcap build.  Switch to the public <pcap.h> header and replace the
direct FILE* casts and ferror()/fflush() calls with pcap_dump_flush(3),
which is the correct public API for flushing a pcap dump file.

Sponsored by:   The FreeBSD Foundation
a0b3ef1952603ebf0307ca723b03e5a71598dd5a Joseph Mingrone 2026-03-15 05:32:01
pmcstat: Implement PMC_CAP_SYSWIDE
Implement the PMC_CAP_SYSWIDE capability flag in the same manner as the
PMC_CAP_DOMWIDE flag.  This flag was previously introduced along side
the domain wide flag, but is yet to be used anywhere.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2075
209d9fbe50c181701bafb16a16dca8c959bbe8ae Ali Mashtizadeh 2026-03-16 23:39:15
ifmcstat: remove libkvm(3) code
It has been broken and disabled for over 10 years.  Remove mentions of the
kvm(3) from the manual page.
ad0e698e642e46ba6f1f25d9a151e8e975ec6356 Gleb Smirnoff 2026-03-18 19:30:14
nanobsd: embedded: Calculate FAT type and scheme
Determine the FAT (MS-DOS) type (FAT32, FAT16, or FAT12) and partition
scheme (fat32lba or fat16b) based on partition size.

Accept any (NetBSD) strsuftoll(3)-compatible string, as the value will
be fed to makefs(8) "-s" in a future commit.

NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s") will not be
supported.  As a workaround, the letter "b" (blocks) may be used.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54975
68f5e5b1244d1285f0ec5ea3f88ff63f2c9554dd Jose Luis Duran 2026-03-19 17:12:26
nanobsd: embedded: Remove mtools dependency
Rely on makefs -t msdos to create the MS-DOS partition and remove the
dependency on filesystems/mtools.

Note that NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s")
are no longer supported, as a workaround the letter "b" (blocks) may be
used instead.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54976
5de9a54c76cf4ce423685531f3d9ec256a31b1b6 Jose Luis Duran 2026-03-19 17:12:51
Commit group #45: nanobsd
nanobsd: embedded: Fix more regressions from last cleanup

Commit c99bb5747f5e changed "()" grouping into "{}", but in these cases
we chdir and depended on the subshell not changing the directory for the
caller.  Restore the old behavior.  While things appear to work without
this change, the previous code was intentionally structured this way.

Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=c99bb5747f5e ("nanobsd: minor formatting cleanup")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54978
60f8d36f7eedf397a8ec21ce58cb33a26f1aa4fc Jose Luis Duran 2026-03-19 17:13:59

nanobsd: Minor cleanup

No functional change intended.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54979
5902c1834d82737137152eeaf8b60f1cd6652fad Jose Luis Duran 2026-03-19 17:14:24

nanobsd: embedded: Time stamp the code image

While there is a function nano_makefs() that already takes care of this
issue, we are not yet ready to consume it.

Just add the time stamp and FFS options to makefs.  This is done
primarily to use UFS2 (UFS version 2).  If the user needs further
customization, the variable NANO_MAKEFS can be overridden.  Timestamping
takes care of making the images bit-for-bit identical.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54980
894992e7860596ce27961771fc00e52812da91f1 Jose Luis Duran 2026-03-19 17:14:36
"Pending" is more correct than "Missing"
Pointed out by: Alex "the PS/2 guy"
a0170dbd4e1abba2b1975ebb37f6051a936c7f9a Poul-Henning Kamp 2026-03-20 10:32:30
loader(8): embedded MD should be the most preferred currdev
A loader built with MD_IMAGE_SIZE is almost always meant for use with
its embedded image and should try that as currdev before anything else.
Recent changes (d69fc3a9dc71, 784150fd2535) seem to have relaxed the ZFS
code's search for a rootfs and exposed this problem.

Reviewed by:    imp, tsoome
MFC after:      1 week
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55979
0661997cea165e951e4e215e6aed41596d8b1d52 Navdeep Parhar 2026-03-20 00:39:17
newfs: Don't combine GEOM journaling with SU
GEOM journaling shouldn't be used at the same time as soft updates, so
don't enable soft updates if GEOM journaling has been requested, and
error out if both are explicitly requested.

MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293896
Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D55999
e30fcdaae2e68458da83d5420e6034c5f384e5f2 Dag-Erling Smørgrav 2026-03-21 07:21:28
tunefs: Don't combine GEOM journaling with SU
GEOM journaling shouldn't be used at the same time as soft updates, so
don't enable one if the other is already in use.

MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293896
Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D56002
b1f72dd2a9a5e69a310b9e76b55f16cff433b8da Dag-Erling Smørgrav 2026-03-21 07:21:33
pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.

Issue reported and fix suggested by berts _from_ fastmail _dot_ com

'Looks good.' @deraadt

MFC after:      1 week
Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 9fd28a8cca
Sponsored by:   Rubicon Communications, LLC ("Netgate")
343ace42f82a629374af4dc3a72da5f46f2c3feb Kristof Provost 2026-03-22 02:50:47
mtree: Add missing entries
Add missing mtree directory entries.  Without them, the resulting
worldstage METALOG file would produce an invalid (incomplete) mtree
specification file.

Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D56013
8d99314a044cfb58183087894592c3ec5be99be6 Jose Luis Duran 2026-03-23 06:41:59
pfctl: always warn if a duplicate rule was detected
MFC after:    1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
66d66dd0f6f83926980fc1d68dd366c0057350c5 Kristof Provost 2026-03-12 14:24:42
syslogd: Allow killing when in foreground
Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode.  Extend that to also apply when running in the
foreground.  Take this opportunity to comment the event loop.

MFC after:      1 week
Reviewed by:    jfree
Differential Revision:  https://reviews.freebsd.org/D55886
828de702ada854b5f09f447ba06e4e08e976ba07 Dag-Erling Smørgrav 2026-03-24 10:58:53
stand: Force disable RETPOLINE for boot loaders
Boot loaders do not require speculative execution protection, and may be
too large if enabled.

Reported by:    Shawn Webb
Reviewed by:    dim, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56068
61f78130c2f3a6abaa70bd66d6d6974060fb3d04 Ed Maste 2026-03-24 14:53:13
rtld: properly handle update of several vars in rtld_set_var()
Besides setting the value in the array of the values, rtld sometimes
needs to recalculate some internal control variable for the change to
take effect.  Allow the variable description to supply a method called
on the update.  Lock the function with the bind lock for safe operation.

Mark several variables as allowed for update, since the on_update method
is provided for them.  The list is LD_BIND_NOW, LD_BIND_NOT,
LD_LIBMAP_DISABLE, LD_LOADFLTR.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56055
b9f046d941c4dbd0e4fc634827ada6e7cf6a6bcf Konstantin Belousov 2026-03-24 01:43:23
rtld: add a test for rtld_set_var (with LIBRARY_PATH_FDS)
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294054
Reviewed by:    kib
MFC after:      1 week
9f16078b5f8c44d5718ecc940ab0b4ed5a1877a5 Alex S 2026-03-25 00:56:01
newsyslog: check for rename failure during log rotation
Differential Revision:        https://reviews.freebsd.org/D56088
6cf1afeccd8aaf926c58c5f0ee24ca3d2329a0ce Christos Longros 2026-03-27 19:28:42
syslogd: Fix ereregex property filters and add test
This change fixes Bug 293879, where ereregex filters in syslogd
did not handle alternation correctly.

The issue appears to come from mixing up two different kinds of
flags: syslogd's internal serialized filter flags in
usr.sbin/syslogd/syslogd.h, and the regex compilation flags from
include/regex.h. ereregex was storing REG_EXTENDED in cmp_flags,
even though cmp_flags is meant to carry syslogd's own FILT_FLAG_*
values for configuration serialization and reconstruction.

REG_EXTENDED has the same bit value as FILT_FLAG_EXCLUDE, so the
filter could be reconstructed with the wrong semantics.

The fix stores FILT_FLAG_EXTENDED instead, allowing syslogd to
correctly REG_EXTENDED when compiling the regex.

A test was also added for both ereregex and !ereregex filters.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293879
Signed-off-by: tzyt <zyt2006613@outlook.com>
Fixes: https://cgit.freebsd.org/src/commit/?id=2567168dc4986
MFC after: 1 week
Reviewed-by: markj, ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2088
69042706604752f42072f422671a72c49343ac45 tzyt 2026-03-22 08:40:57
pkgbase: Move all of Kyua into the kyua package
Some Kyua directories were improperly tagged as belonging to the tests
package.  Move them to the kyua package, which contains all of the
files found in these directories.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294129
MFC after:      1 week
Reviewed by:    ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D56159
40e8afadc393a102f4199228ae2047d3e6c71251 Dag-Erling Smørgrav 2026-03-30 14:03:18
rtld: check for overflow in parse_integer()
Reviewed by:  dim, emaste, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56151
7cfffe25da3fbc2db4bcf073ff2d240f84233973 Konstantin Belousov 2026-03-29 22:45:13

Libraries

Commit group #46: libgeom
libgeom: Fix segfault in 32-on-64 case

We were using strtoul() to parse object identifiers, which are kernel
pointers.  This works fine as long as the kernel and userland match,
but in a 32-bit libgeom on a 64-bit kernel this will return ULONG_MAX
for all objects, resulting in memory corruption when we later pick the
wrong object while resolving consumer-producer references.

MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292127
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54452
27894e20f140ee2729c14b589035870c8185b87d Dag-Erling Smørgrav 2026-01-03 09:09:51

libgeom: Clean up xml2tree code

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54453
fad6707e2589d8557ceb6b6bf11f22323b265f01 Dag-Erling Smørgrav 2026-01-03 09:09:58

libgeom: Improve type safety of xml2tree code

When resolving references, assert that the type of the object we find
is what we expect.  This will help prevent memory corruption if two
objects of different types somehow end up with the same identifier.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54454
4b0d5d1d6a7c9773e38882feb4747a76b37a645c Dag-Erling Smørgrav 2026-01-03 09:10:03

libgeom: Fix 32-bit gcc build

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=27894e20f140 ("libgeom: Fix segfault in 32-on-64 case")
17355cf50fcbd0d8ddb638e1f2fd5861b526edbe Dag-Erling Smørgrav 2026-01-03 20:34:44
libc/amd64: fix stpncpy.S again
The previous fix introduced a regression on machines without the BMI1
instruction set extension.  The TZCNT instruction used in this function
behaves different on old machines when the source operand is zero, but
the code was originally designed to never trigger this case.  The bug
fix caused this case to be possible, leading to a regression on
sufficiently old hardware.

Fix the code by messing with things such that the source operand is
never zero.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291720
Fixes:          https://cgit.freebsd.org/src/commit/?id=66eb78377bf109af1d9e25626bf254b4369436ec
Tested by:      cy
Approved by:    markj (mentor)
Differential Revision:  https://reviews.freebsd.org/D54303
2f83319214d9adb8ab7a77e35d1014658b3f9cae Robert Clausecker 2025-12-18 23:37:33
stdbool.h: Update for C23
When a compiler with C23 or higher is detected, builtin bool, true,
and false are used to conform the C23 standard.

Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D44664
f441a225c4eb56deff1edc2402fe85a0ae263ebd Minsoo Choo 2026-01-06 19:57:27
librdmacm/libibverbs: Add bnxtre RDMA provider to OFED build infrastructure
Extend the FreeBSD OFED build framework to include the Broadcom bnxtre RDMA
provider library.

This change:

 -Registers libbnxtre in src.libnames.mk so it is built and installed as part
  of the OFED libraries.
 -Adds bnxtre to the OFED pcap dependency set when MK_OFED is enabled.
 -Declares proper dependency mappings for bnxtre (ibverbs, pthread).
 -Introduces LIBBNXTREDIR for consistent object directory handling.
 -Updates libibverbs and librdmacm build rules to link against libbnxtre,
  enabling Broadcom RoCE device support at runtime.
 -libbnxtre library uses below constructor to register with the libibverbs,
  static attribute((constructor)) void bnxt_re_register_driver(void)

These updates ensure that applications using libibverbs and librdmacm can
discover and use Broadcom bnxt RDMA devices on FreeBSD.

Reviewed by: markj, ssaxena
Differential Revision: https://reviews.freebsd.org/D54368
MFC after: 3 days
821c6c43a33d5b72290ee7f896d28438a3b789e1 Sreekanth Reddy 2026-01-09 11:34:43
lib: remove powerpcspe
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 907cf3e4378f9d114af41d05a59ef4a075d3efb0)
9cdb2eb66823e19c86cc9d2ebcf0c70c32a40caf Minsoo Choo 2025-12-03 04:12:49
libthr/thread/thr_join.c: deduplicate backout_join() helper
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54766
ce16be73707eedc798b26e0741dcd70d1168ac10 Konstantin Belousov 2026-01-18 12:23:14
libthr: add pthread_tryjoin_np()
Similar to the same glibc function.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54766
afa70a8496e90fa751418be8d1b55e3d559a281a Konstantin Belousov 2026-01-18 12:26:46
lib/libthr: add pthread_tryjoin(3) test
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54766
902e3057cd5c7a076b78dd559b7b264610af59aa Konstantin Belousov 2026-01-18 12:47:40
libfetch: apply timeout to SSL_read()
Currently, fetchTimeout works for non-SSL connections only, so does fetch -T.
Fix it applying specified timeout to SSL_read().

MFC after:      3 days
8f8a7f6fffd7dca09013f7c4bfa075bc3825fb8e Eugene Grosbein 2026-01-22 08:40:35
libfetch: allow disabling TLS v1.3 when the connection
MFC after:    3 days
129aec72250266e60c07ff4643623188f7c27a9d Eugene Grosbein 2026-01-22 14:37:54
rpc/xdr.h: make xdrproc_t always take two arguments
The type of xdrproc_t is clearly defined in the comments as a function
with two arguments, an XDR * and a void * (sometimes spelled caddr_t).
It was initialy defined as:

        typedef bool_t (*xdrproc_t)();

At some point people started giving it a non-empty argument list.
Unfortunatly, there has been widespread disagreement about how arguments
are passed.  There seems to have been a widespread view that it should
be allowed to pass three argument function pointer to xdrproc_t.  Most
notable is xdr_string which takes a maximum length parameter. This lead
to all sorts of prototypes (all of which have been present in the
FreeBSD source tree):

FreeBSD userspace (nominally from tirpc, but seemingly local):
        typedef bool_t (*xdrproc_t)(XDR *, ...);
FreeBSD kernel, glibc:
        typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
rcp/xdr.h with _KERNEL defined (not used?):
        typedef bool_t (*xdrproc_t)(XDR *, void *, u_int);
gssrpc (in krb5) and Linux kernel:
        typedef bool_t (*xdrproc_t)(XDR *, void *);

For two argument functions on current ABIs, these all equivalent as
these arguments are passed in registers regardless of decleration and
definition, but we end up with two problems:

   - xdr_free((xdrproc_t)xdr_string, ...) calls xdr_string with no third
     argument and (at least on FreeBSD) may fail to free memory if the
     string is shorter than the value lying around in the third argument
     register.  There are no instance of this in tree, but I found some
     with Debian code search, in particular in OpenAFS.

   - Under CheriABI, variadic arguments are passed in a separate,
     bounded array so theses prototypes aren't equilvalent to the
     non-variadic calling convention of the functions.

The reality is that that xdr_string should not be cast to xdrproc_t and
xdr_wrapstring should be used instead so we do not need to support this
case.  Instances of the former behavior are now extremely rare.

With this change we bring FreeBSD in line with gssrpc and the Linux
Kernel.  Warnings about casts should now be correct and should be fixed.

Bump __FreeBSD_version as some software required adaptation if it is
declaring functions to cast to xdrproc_t.  Update OpenZFS's workaround
of this historic mess accordingly.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54824
ac5a19ec6989675c8ec6c3ca245dba243d1a6416 Brooks Davis 2026-01-23 10:35:32
xdr_string: don't leak strings with xdr_free
Historically (and in a small amount of older software such as OpenAFS),
developers would attempt to free XDR strings with

        xdr_free((xdrproc_t)xdr_string, &string)

This resulted in xdr_free calling xdr_string with only two intentional
arguments and whatever was left in the third argument register.  If the
register held a sufficently small number, xdr_string would return FALSE
and not free the string (no one checks the return values).

Software should instead free strings with:

        xdr_free((xdrproc_t)xdr_wrapstring, &string)

Because buggy software exists in the wild, act as though xdr_wrapstring
was used in the XDR_FREE case and plug these leaks.

Reviewed by:    kib
MFC after:      3 days
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D54825
e17d7ab869bbfe3fa5a7da4b74d9f4fa51a0d69f Brooks Davis 2026-01-23 10:35:55
lib/libsys, lib/libc: export pdrfork(2)
Reviewed by:  asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
f10b4b6131d444c023a90c386cec4b0b8f525a1f Konstantin Belousov 2026-01-08 02:04:06
lib/libsys, lib/libc: export pdwait
Make pdwait(2) cancellable, same as all other wait*(2) syscalls wrappers.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
2d555ec85a716e016be587b2a1606ca69267f870 Konstantin Belousov 2026-01-08 03:49:33
Regen for the fork and exit/wait exterror category addition
6c82bf1407d26e9053e5a9f9259e3e32203fe31b Konstantin Belousov 2026-01-08 00:33:54
libc: add posix_spawnattr_{get,set}execfd_np(3)
If execfd is set, the fexecve(2) is used by posix_spawn() instead of the
provided path.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54862
3f0aea09689f6c10740de78011469355208a19a5 Konstantin Belousov 2026-01-24 22:06:36
libsys: add pdrfork_thread() on x86
Reviewed by:  asomers
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54879
74a2bf1b7a7ff0c872499cb94df24713f61c872c Konstantin Belousov 2026-01-25 17:33:05
libc: add posix_spawnattr_{get,set}procdescp_np
Reviewed by:  asomers
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54879
080d8ed7dd29ba537ce4cca286ed3369aca61ef5 Konstantin Belousov 2026-01-25 17:40:48
btree/bt_split.c: Fix a misaligned if statement
Sponsored by: Klara, Inc.
1e233e393ddd39faa4c530351c5a584ea0ef4df0 Bojan Novković 2026-01-27 13:44:54
btree/bt_seq.c: Fix two NULL pointer dereferences
This change fixes two NULL pointer dereferences caused by the
__bt_first function.

The first was caused by returning 0 (i.e., RET_SUCCESS) when a key
was not found, causing the caller to dereference an uninitalized
or NULL pointer. The second one was caused by an if statment clobbering
a local variable with a function call result that might be NULL.

Reported by:    clang-tidy
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Differential Revision:  https://reviews.freebsd.org/D54905
4bcc5a3cdc05f217a8adf2f5f97a2e922663f741 Bojan Novković 2026-01-27 15:13:13
libc: Don't use uninitialised string for getnetbyaddr[_r](0) DNS lookup
If net is all-zero, the loop to extract all leading non-zero octets will
iterate zero times and leave nn with the value 4, which the following
switch statement to initialise qbuf does not handle. As a result,
_dns_getnetbyaddr will look up the PTR record for this uninitialised
string, which will leak the pre-existing contents of that stack memory
to the DNS resolver and, if remote and not otherwise protected, network.

Note that _dns_getnetbyaddr is only used if nsswitch.conf is configured
to enable the "dns" source for the "networks" database, which is not the
default configuration in FreeBSD.

For glibc this same bug, in code also derived from BIND's, was issued
CVE-2026-0915. This commit adopts the same behaviour as glibc's fix,
which is to regard a net of 0 as being for 0.0.0.0. Apparently NetBSD
will return NS_UNAVAIL instead, which may or may not make more sense,
but in general glibc compatibility tends to cause less friction when
there's not a good reason to avoid it.

Reviewed by:    markj (secteam)
Fixes:          https://cgit.freebsd.org/src/commit/?id=1363f04ce1b8 ("get* rework and new bind code")
MFC after:      1 day
Security:       Same bug as glibc's CVE-2026-0915
331316b073505e4794754af1cd0c5ccc578a2bde Jessica Clarke 2026-01-27 21:44:39
libsys, libc: provide rfork_thread() and pdrfork_thread() on all arches
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54898
c1be185e3fb9afd6743683a8f5a43b9c364ab529 Konstantin Belousov 2026-01-26 16:04:08
posix_spawn: use rfork_thread on all arches
Do not allocate or switch to the custom stack on non-x86.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54898
4daf2d3e7db53a113108f9a02ceaf5051d416184 Konstantin Belousov 2026-01-26 16:09:18
libc/resolv: Switch default to loopback address
If no resolver configuration was found, we would fall back to INADDR_ANY
and IN6ADDR_ANY.  This made sense when it was first written thirty or
forty years ago but not today, especially since connecting to INADDR_ANY
or IN6ADDR_ANY is no longer supported.  Switch to the loopback address
and simplify the code.

Note that (as the pre-existing comment in the code states) running
without a resolver configuration is not really supported.  Still, if
we're going to have a hardcoded fallback, it might as well work.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291790
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55011
1538284a5fddfce546db678cb873b7edc6adb9ed Dag-Erling Smørgrav 2026-01-31 17:52:53
libc: Clean up *dir() code
Fix style nits (mostly whitespace issues) and clean up the manual page.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55024
387ae6390534b6e9b48931840e7bc76eeb0b258d Dag-Erling Smørgrav 2026-02-02 15:46:53
Commit group #47: libc: Improve POSIX conformance of dirfd()
libc: Improve POSIX conformance of dirfd()

POSIX states that dirfd() should set errno to EINVAL and return -1 if
dirp does not refer to a valid directory stream.  Our interpretation is
that this applies if dirp is null or the file descriptor associated
with it is negative.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55025
5074d5c9845e142883cdbb9ad212be66e57615d0 Dag-Erling Smørgrav 2026-02-02 15:46:57

libc: Fix missing include

Although not needed on FreeBSD due to namespace pollution, we should
technically #include <stddef.h> to secure a definition of NULL.

Fixes:          https://cgit.freebsd.org/src/commit/?id=5074d5c9845e ("libc: Improve POSIX conformance of dirfd()")
1c00d5a3b234ef937d848956027e9de5ea8010f9 Dag-Erling Smørgrav 2026-02-02 16:26:17
clnt_broadcast(3): don't free function pointers
Replace use of thr_getspecific/thr_setspecific to stash the function
pointer we're smuggling between clnt_broadcast and rpc_wrap_bcast with a
simple thread local variable.  Clear it after use so the reference
doesn't linger.

In the relatively unlikely event clnt_broadcast was called from threads
that exited prior to program termination, the previous code called free
on a function pointer, which is undefined and might corrupted allocator
state.

Effort:         CHERI upstreaming
Reviewed by:    glebius, jhb
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54939
47413f23e503e796989b35dfb04e453c5b6e2d01 Brooks Davis 2026-02-02 21:20:01
clnt_broadcast(3): fix eachresult argument type
The `eachresult` argument is documented to take a function pointer of
type:

        bool_t (*)(caddr_t, struct sockaddr_in *)

It was declared to take a resultproc_t which has historically been
declared to be:

        bool_t (*resultproc_t)(caddr_t, ...);

This overlapped well enough for currently supported ABIs where variadic
arguments are passed in registers, but this declaration is misaligned
with the documentation (resultproc_t takes three arguments) and will be
fixed in a followup commit.

Fix the type to be non-variadic, matching callbacks, and define a
convenience type of as most callbacks take something other than a char *
as their first argument and need to be cast.

Effort:         CHERI upstreaming
Reviewed by:    ngie, glebius, jhb
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54940
e236502a997da6bc94d018d5c5f79bfe17f0f1e7 Brooks Davis 2026-02-02 21:20:10
rpc: correct resultproc_t's type
It takes exactly three arguments of known type.

Tweak the types of various resultproc_t functions to match the type (mostly
added const to struct pointers) allowing us to drop casts.

Effort:         CHERI upstreaming
Reviewed by:    vangyzen, glebius
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54941
18d47c1856f4ec3f7a2f9a726bba2ebe64d63dd7 Brooks Davis 2026-02-02 21:20:16
libc/aarch64: Split out the MOPS functions
This allows static binaries to only include the functions they
reference.

Reviewed by:    imp
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54775
f0516ed4652cfb7435f8c5a16b46dc067779a1a8 Andrew Turner 2026-02-03 14:01:07
libc/aarch64: Add memset for a 64 byte dc zva
On arm64 we can use the "dc zva" instruction to zero memory. The CPU
tells software if the instruction is implemented, and if so the size
and alignment it will use.

When the size is 64-bytes the Arm Optimized Routines implementation of
memset can use dc zva to zero memory, and has a build flag to skip
checking.

Use this flag to build a version of memset that will be used when this
assumption is true.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54776
32d1f18865abe94d351a6f178a93b7195595ec69 Andrew Turner 2026-02-03 14:01:32
libdiff: Simplify truncation detection
* Adjust the comment to reflect the fact that SIGBUS can occur not only
  if the file is truncated, but also if an I/O error occurs while paging
  in any part of it.

* Instead of setting a flag, just return EIO.

* Adjust the unit test accordingly.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    thj, kevans
Differential Revision:  https://reviews.freebsd.org/D55108
a689bfa4e25af8307709dc12f75b0e02a65abf18 Dag-Erling Smørgrav 2026-02-05 14:39:34
libfetch: Check for failure to create SSL context
* Drop the ssl_meth member, there is no reason to hang on to it.

* Replace deprecated SSLv23_client_method() with TLS_client_method().

* Check the return value from SSL_CTX_new().

MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292903
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55098
4e160c6197f75fda3d5d5997ce893087058cf718 Dag-Erling Smørgrav 2026-02-07 14:24:40
libmd aarch64: Use ands instead of bics to round down the length
GNU as does not accept bics with two register operands but instead
requires three register operands.  However, clang assembles the bics
instruction to ands anyway, so just use ands directly.

Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D55155
244f498074b5574d18d4518583863580498b8d3b John Baldwin 2026-02-09 16:26:29
libc: Remove leftover comments
These comments refer to a comment in div.c which doesn't exist anymore.

Fixes:  https://cgit.freebsd.org/src/commit/?id=7c7299df76e2 ("libc: Remove support for pre-C99 C standards")
Sponsored by:   Klara, Inc.
c3f945eac4538de572600787a73221f2549c62c8 Aymeric Wibo 2026-02-12 13:55:01
libc: Improve {,l,ll,imax}div(3) manpages
Mainly rename numerator parameter of div(3) and ldiv(3) from num to
numer, and explicitly specify what "numer", "denom", and "rem" mean in
the manpages.

MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
0bba277f2223a31e4453ade39be110b1b3aeb1dd Aymeric Wibo 2026-02-12 14:50:19
libnv/tests: unskip nvlist_send_recv__send_many_fds__dgram
The test passes consistently for 1000+ consecutive iterations.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260891
Reviewed by:    oshogbo
Approved by:    lwhsu (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55223
fbe6da7f7592169ad7c26aa563f4c6305de1e345 Siva Mahadevan 2026-02-11 21:05:25
libpfctl: Sort order of snl attribute parser
snl atttribute parsers must be sorted by type, so PF_GS_BCOUNTERS
(16) must follow PF_GF_PCOUNTERS (15). Fix ordering and add a call
to SNL_VERIFY_PARSERS.

Without this fix, byte counters reported by 'pfctl -s info' with
a loginterface are always zero.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291763
MFC after:      1 week
Reviewed by:    kp
Signed-off-by:  eborisch@gmail.com
363b57d579bafa8a52cfb5a1dcb98af821b1ecb6 Eric A. Borisch 2026-02-12 00:26:26
libpfctl: verify all parsers
List all currently defined parsers in 'all_parsers', and pass them to
SNL_VERIFY_PARSERS(). This will detect incorrect odering in parsers,
which will help us detect otherwise subtle bugs.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
1e7665e36860af87cae24cbeb1a65a97ad9a0efb Kristof Provost 2026-02-12 09:39:05
libc/arm: use __builtin_trap() instead of abort() in aeabi_unwind stubs
This avoids a dependency on the abort symbol in libsys.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292539
Reviewed by:    mmel
Approved by:    markj (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55255
1782bc9a0a8da2d6aca31b7790981e1980c9e4b9 Robert Clausecker 2026-02-11 18:50:18
libusb: make libusb_hotplug_get_user_data actually return user_data
MFC After:    2 days
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55291
be522176951d8b542de9354f4ec9ac7603745b71 Baptiste Daroussin 2026-02-15 19:39:18
libusb: dequeue next transfer on completion to prevent stalls
The transfer proxy callbacks (bulk/interrupt, control, isochronous)
only called libusb10_submit_transfer_sub() in the START path to
pipeline the second kernel transfer slot. On completion or error,
no attempt was made to dequeue the next pending transfer from
tr_head onto the now-free slot.

When more than two async transfers were submitted on the same
endpoint, the third (and subsequent) transfers would remain stuck
on tr_head indefinitely, since no completion ever triggered their
submission. This caused a protocol-level deadlock in applications
like adb that submit header + payload + zero-length terminator as
three separate bulk transfers in sequence.

Fix by calling libusb10_submit_transfer_sub() after every
libusb10_complete_transfer() in all three proxy callbacks.

MFC After:      2 weeks
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55289
38c18332642500fdfe075a82f88e033f6673a53f Baptiste Daroussin 2026-02-15 18:07:07
libc: print extended errors from warn(3) and vwarn(3)
Noted and reviewed by:        mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55327
ffbf95907039821b69dfe1607d1695b46af82e35 Konstantin Belousov 2026-02-17 11:12:02
libc: improve include usage for exterror sources
Include sys/types.h by exterr.h, since size_t is used.
Drop include of sys/exterr_cat.h, it is useless for the only prototype
provided.

Reviewed by:    mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55337
1443a455a96e587a7b49608def79495e9d74513f Konstantin Belousov 2026-02-17 20:56:50
libfetch: Restore timeout functionality
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293124
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:        8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:    eugen, imp
Differential Revision:  https://reviews.freebsd.org/D55293
73b82d1b0a2f09224e6d0f7a13dd73c66d740207 Dag-Erling Smørgrav 2026-02-18 15:10:47
stddef.h: add ptraddr_t
I'd missed that stddef.h is standalone and isn't a copy of sys/stddef.h
in my initial merge.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=dca634d1544b ("new type: ptraddr_t")
Differential Revision:  https://reviews.freebsd.org/D55305
cb59eec9ebbf1ae3a24223431ed1d947674c8c6a Brooks Davis 2026-02-19 15:04:51
Commit group #48: stddef.h: centralize definition of offsetof()
stddef.h: centralize definition of offsetof()

Move to sys/_offsetof.h and use __builtin_offsetof() instead of
__offsetof to avoid reintroducing sys/cdefs.h polution in stddef.h.

This has the side effect of allowing sys/stddef.h to be included after
stddef.h which can happen in compatability headers.

Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D55307
2adc3f0db1877dbe9801e6dacfa9ae8df8879549 Brooks Davis 2026-02-19 15:05:22

types.h: use central definition of offsetof()

Previously this broke if included after (sys/)stddef.h.

Reported by:    des
Fixes:          https://cgit.freebsd.org/src/commit/?id=2adc3f0db187 ("stddef.h: centralize definition of offsetof()")
dcbd1fccdc66ec33f0652be34a1c8bdd5293f90c Brooks Davis 2026-02-19 16:13:57
libnetbsd: import `__CTASSERT(..)` macros
These compile-time assert macros are similar to `Static_assert` on FreeBSD.

These macros are in use in newer versions of `contrib/netbsd-tests`.

Obtained from:  https://github.com/NetBSD/src (c26cc77b3a0b26b95a2)
MFC after:      1 week
d1f1402dff63dd163d4ba4ac65f7f2ffd00c5e08 Enji Cooper 2026-02-20 20:24:46
Commit group #49: libfetch
libfetch: Clean up fetch_info usage

* Provide a wrapper for the common if (verbose) fetch_info(...) idiom.

* Replace remaining instances of fprintf(stderr, ...) with fetch_info().

* Fix a few style nits.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55405
1b7c4d29fdfc975facdc43f6da50947cf3bb8e4a Dag-Erling Smørgrav 2026-02-21 01:18:11

libfetch: Fail hard if interrupted while connecting

This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.

Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have.  It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293312
MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55406
afbdcd402bb439bd3d487baaad63b68e95929265 Dag-Erling Smørgrav 2026-02-21 01:18:15

libfetch: Gracefully skip unsupported protocols

If socket() fails because the address family or protocol is unsupported,
just continue with the next address.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55407
b5d570e711da1dad303312bebaf1bd2fb720f0dc Dag-Erling Smørgrav 2026-02-21 01:18:18
libc: Roll {l,ll,imax}abs(3) manpages into just abs(3)
No need to have 4 separate manpages for these functions. Use opportunity
to change parameter names in the source from j -> i to reflect the name
used in POSIX. (The ISO C standard uses j but i is a better name
anyway.)

Reviewed by:    des, rpokala
Approved by:    rpokala
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55361
98ffaae49fea5c478230ef68086bcea89a6f654b Aymeric Wibo 2026-02-19 03:02:19
libjail: avoid a double-free in the MAC label bits
As written, we'll repeatedly jps_free() the first element, which is
obviously bogus.  Fix it to index appropriately.

Fixes:  https://cgit.freebsd.org/src/commit/?id=db3b39f063d9f ("libjail: extend struct handlers [...]")
686280c0fdc4807676c3e8b896a1816ce62d4457 Kyle Evans 2026-02-24 05:55:12
mpool/mpool_get.c: Avoid clobbering 'errno' when handling 'pread' errors
POSIX.1-2024 states that the 'free' function "shall not modify errno if
ptr is a null pointer or a pointer previously returned as if by malloc()
and not yet deallocated". However this is a fairly recent addition
and non-compliant allocators might still clobber 'errno', causing
'mpool_get' to return the wrong error code. Fix this by saving
and restoring 'errno' after calling 'free'.

Sponsored by:   Klara, Inc.
Reviewed by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D55463
MFC after:      1 week
bce0c14fe19defeef4f02cfebc018e9adf979783 Bojan Novković 2026-02-23 15:30:26
system(3): Improve signal handling
Ignore SIGINT and SIGQUIT and block SIGCHLD, as POSIX requires.

To deal with the concurrency problem described in POSIX, we keep track
of the count of concurrent invocations.  We ignore and block signals
only when the counter was zero before we incremented it, and restore
them only when the counter reaches zero after we decrement it.

Note that this does not address the issue of thread cancellation.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, sef, kevans
Differential Revision:  https://reviews.freebsd.org/D55471
6e589e6e8e64793adb437c561ec084dbb6ad1ced Dag-Erling Smørgrav 2026-02-25 21:12:21
system(3): Fix null case
Our manual page states that if given a null pointer, system() returns
non-zero if the shell is available and zero if it is not.  This is
consistent with the C standard's description of system(), but it is not
what we actually do.  What we actually do is always return non-zero, as
required by POSIX.

As the POSIX rationale explains, implementing the logic required by the
C standard does not violate POSIX, since a conforming system always has
a shell, therefore the logic will always return non-zero.

Since our libc is commonly used in non-conforming situations such as
chroots or thin jails, we should implement the full logic required by
the C standard.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    obiwac, bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55484
8ae3f44991948cc97b09adc248a9a46db71bf9e0 Dag-Erling Smørgrav 2026-02-25 21:12:42
libnetbsd: add math.h and sys/time.h
- `math.h`: `isinff(..)`
- `sys/time.h`: `timespec*(x)`

These two headers are used by tests in newer snapshots of
`contrib/netbsd-tests`.

MFC after:      1 week
2a6c2d9c38dc421025b6c18cac68fe9965c574c0 Enji Cooper 2026-02-25 23:19:56
Refinements to the output when the EXTERROR_VERBOSE environment is set
When kernel external errors are available they are included in the
err(3) library function messages. In addition to the extended error
itself, the kernel also tracks the kernel file and line number at
which the error was generated. This additional information is not
included in the err(3) messages unless the EXTERROR_VERBOSE environment
variable is present. Currently, when EXTERROR_VERBOSE is present,
all the internal extended error information associated with the
error is printed most of which is redundant with the formatted error
message printed by err(3). This change will add only the kernel
file and line number to the err(3) message when EXTERROR_VERBOSE
is present and set to "brief".

Sample output with bad protection bits to mmap:

guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8)

guest_16 % setenv EXTERROR_VERBOSE
guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8 errno 22 category 1 (src sys/vm/vm_mmap.c:200) p1 0x8 p2 0)

guest_16 % setenv EXTERROR_VERBOSE brief
guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8 (src sys/vm/vm_mmap.c:200))

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55494
MFC-after:    1 week
Sponsored-by: Netflix
6fd98877de633f5ec6f028e78d5a2d94527d63d0 Kirk McKusick 2026-02-26 06:20:12
lib/libnetbsd: bring in `__type_m{ax,in}*` macro family
These macros are used by some of the NetBSD tests which calculate the
size of types, e.g., `__type_max(time_t)`.

This wraps up the set of macros needed in order to update to the a
netbsd-tests snapshot from this past month.

Obtained from:  https://github.com/netbsd/src (55b4b44)
MFC after:      1 week
db5344a7445f1a796bc3cacd32a46e88e3e589a7 Enji Cooper 2026-02-26 02:29:49
libiscsiutil: Record dependency on libmd
MFC after:    3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=6378393308bc ("Add an internal libiscsiutil library.")
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55596
05ca4837a3e9a413aabcf005abb14fff35088476 Dag-Erling Smørgrav 2026-02-28 18:11:10
mt(1)/libmt: Add LTO-10 density codes and specs.
These were obtained from IBM specs and actual tapes/drives.

Standard LTO-10 cartriges hold 30TB raw, 75TB with 2.5:1 compression.
Premium LTO-10 cartridges hold 40TB raw, 100TB with 2.5:1 compression.
LTO-10 tape drives are not backward compatible with previous generation
LTO tapes. (This is a change from older generation drives.)

Since the Premium tape is a new thing for LTO, we'll call this density
code LTO-10P vs. the standard LTO-10.  The barcode identifier for LTO-10
tapes is "LA"; the barcode identifier for LTO-10P tapes is "PA".

LTO-10 cartridges contain 1035m of tape, while LTO-10 Premium
cartridges contain 1337m of tape and have slightly higher density.
(Obtained from MAM data on actual tape cartridges and the density
report, obtained via 'mt getdensity'.)  LTO-10 cartridges use a
polyethylene naphthalate (PEN) film substrate. LTO-10 Premium
cartridges use an Aramid (aromatic polyamide) substrate that is thinner
and stronger, allowing a longer tape to fit in the same cartridge form
factor.

usr.bin/mt/mt.1:
        Add density codes and specs for LTO-10 and LTO-10P.

lib/libmt/mtlib.c:
        Add density codes for LTO-10 and LTO-10P.

Sponsored by:   Spectra Logic
MFC after:      3 days
930486f9be5c884d1d2f0aae9f81a3f5af1f2718 Kenneth D. Merry 2026-03-02 19:13:47
libutil: take a size_t in trimdomain()
INT_MAX is already larger than a reasonable hostname might be, but
size_t makes some of this easier to reason about as we do arithmetic
with it.  This would maybe not be worth it if we had to bump the
soversion because of it, but libutil does symbol versioning now so we
can provide a compat shim.

While we're here, fix some inconsistencies in argument names in the
manpage.

Reviewed by:    des
Obtained from:  https://github.com/apple-oss-distributions/libutil
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54622
7e70589b1bee4853cb11e3d8eb963079b18ff534 Kyle Evans 2026-03-03 22:51:01
libutil: avoid an out-of-bounds read in trimdomain(3)
memchr(3) will happily believe we've passed in a valid object, but
hostsize could easily exceed the bounds of fullhost.  Clamp it down to
the string size to be safe and avoid UB.  This plugs a potential
overread noted in the compat shim that was just added.

Reviewed by:    des
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54623
f268f95955f5f0f91f4d39e13bcd69a24e0d8ce4 Kyle Evans 2026-03-03 22:51:02
system(3): Unwrap execve()
There is no need to call execl(), which will allocate an array and copy
our arguments into it, when we can use a static array and call execve()
directly.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55648
40e52e0edd038460a2a2aca017b3ac5a513fe37b Dag-Erling Smørgrav 2026-03-04 15:22:42
getnetconfig: make nc_error a thread local variable
Remove a bunch of complexity at the cost of 4 bytes of storage per
thread.

Reviewed by:    jhb
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D55310
db1ecd5854d4d9ed596d6411a01de0df6e41e629 Brooks Davis 2026-03-05 10:30:30
libc/armv7: remove default version for alloca
The alloca() interface has been a macro expanding to __builtin_alloca()
since 2003 (commit 79806b4cdce0, included in FreeBSD 5.2).  Even before
that virtually every compiler version I was able to test replaced
alloca() with compiler generated code when targeting C.

Hide it to prevent future (mis)use.

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D51858
4dd517acb6949d6fed5b16f26fbffb150749b121 Brooks Davis 2026-03-05 10:33:53
libc/quad: narrow list of symbols exposed for 32-bit arm
lld doesn't notice, but ld.bfd complains.

Reviewed by:    brooks
Differential Revision:  https://reviews.freebsd.org/D55657
27cfa8ec633ae7527dc6187c6a78db04983c9ccf John Baldwin 2026-03-05 19:07:09
libc/quad: Switch to per-arch lists of symbols
This more closely mirrors libc/quad/Makefile.inc and is easier to
read.

Reviewed by:    brooks
Differential Revision:  https://reviews.freebsd.org/D55658
54bf594851f671e231d2786cdacaf68f290ff738 John Baldwin 2026-03-05 19:07:09
libc/quad: fix missing closing #endif in Symbol.map
Without this lib32 libc.so.7 would be missing critical symbols,
including malloc / free and all syscall wrappers.
8dd28e13e41b6200e58d6e99981ff8323cff3711 Xin LI 2026-03-06 08:22:06
libc: Fix dtor order in __cxa_thread_atexit
The thread_local variable may creates another thread_local variable
inside its dtor. This new object is immediately be registered in
__cxa_thread_atexit() and need to be freed before processing another
variable.

This fixes the libcxx test thread_local_destruction_order.pass.cpp.

Reported by:    kib
Approved by:    lwhsu (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55826
9d26b82826d9962d5085bc5d9df7f8a762c57602 ShengYi Hung 2026-03-12 13:40:34
libpcap: Update to 1.10.6
16cef5f7a65588def71db4fdfa961f959847e3b6 Joseph Mingrone 2026-03-15 01:42:55
realpath: Improve prev_len logic
* Save prev_len after having checked for and appended a trailing slash,
  not before.  This requires us to back up if we end up returning a
  partial result, but previously we would sometimes return a partial
  result with a trailing slash and sometimes without.

* Replace strlcat() with a faster strlcpy() since we know exactly how
  far into the buffer we are.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55914
99d295e471bc362a7927047c89472e1ee2d0da6b Dag-Erling Smørgrav 2026-03-19 01:26:16
libc/db: Remove unused hash functions in hash_func.c
Prune unused code hidden behind 'notdef', bringing us in sync with
the changes in OpenBSD. Despite the `__default_hash` function pointer
having external linkage, no ABI change is expected since it was
never exported.

Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55842
Reviewed by:    allanjude, des
MFC after:      2 weeks
c09ccfc2665bef0d81d1db4e3713e4f2a0b5a064 Bojan Novković 2026-03-13 11:03:26
rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()
svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:    so
Security:       FreeBSD-SA-26:08.rpcsec_gss
Security:       CVE-2026-4747
Reported by:    Nicholas Carlini <npc@anthropic.com>
Reviewed by:    rmacklem
Fixes:          https://cgit.freebsd.org/src/commit/?id=a9148abd9da5d
143293c14f8de00c6d3de88cd23fc224e7014206 Mark Johnston 2026-03-24 02:12:42
Commit group #50: libc/amd64/strrchr.S: rewrite and fix scalar implementation
libc/amd64/strrchr.S: rewrite and fix scalar implementation

The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character.  It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().

Rewrite the function with logic that actually works.  We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.

This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)).  The default configuration is not affected.

The bug was unfortunately not caught by the unit test inherited
from NetBSD.  An extended unit test catching the issue is proposed
in D56037.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293915
Reported by:    safonov.paul@gmail.com
Tested by:      safonov.paul@gmail.com
Fixes:          https://cgit.freebsd.org/src/commit/?id=2ed514a220edbac6ca5ec9f40a3e0b3f2804796d
See also:       https://reviews.freebsd.org/D56037
MFC after:      1 week
253f15c016ca699906f78b8e522a3f7ed675929b Robert Clausecker 2026-03-22 12:37:06

libc/amd64/strrchr.S: fix rebase error

I accidentally dropped a part of the patch on squash rebase.
Should be fine now.

Fixes:          https://cgit.freebsd.org/src/commit/?id=253f15c016ca699906f78b8e522a3f7ed675929b
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293915
MFC after:      1 week
23d6516773916d8f324bea51867b0713c476f379 Robert Clausecker 2026-03-26 13:00:21
fenv.h: stop declaring feclearexcept() extern inline
The function is already exported from libm.  We only need to stop
declare it extern inline, and instead provide a macro which uses the
internal inline function __feclearexcept_int() instead.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim (x86)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55975
f39754d51b7dc65c4cf9f8b41b6fc1fc135554e7 Konstantin Belousov 2026-03-19 17:19:09
msun/x86: convert rest of the extern inline fenv functions to proper linkage
namely
        fegetexceptflag(3)
        fetestexcept(3)
        fesetround(3)
        fegetround(3)
        fesetenv(3)
Same as it was done in f39754d51b7dc65c4cf9f for feclearexcept(3).

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
5bc64b7d417dd1f105755e093f8e807bcdc2a666 Konstantin Belousov 2026-03-28 22:36:55
msun/aarch64: convert fenv functions to proper linkage
namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
3a01e1e1a50cb9a9594aac2148dc920a6b295428 Konstantin Belousov 2026-03-28 23:13:44
msun/riscv: convert fenv functions to proper linkage
namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
6b89f5360f8441ffd1a3e8db7375ed3ccdba7d2a Konstantin Belousov 2026-03-29 01:27:30
msun/powerpc: convert fenv functions to proper linkage
namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
e4505a58a77f6f4f2df60d26ea99710af6c6b3cf Konstantin Belousov 2026-03-29 02:06:02
msun/arm: convert fenv functions to proper linkage
namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
70674434e2424d61262322702d0415e54d8cc1a2 Konstantin Belousov 2026-03-29 03:10:18
msun: remove requirement to have C99 inline semantic
The 'extern inline' usage is removed.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
d15733065c4221dcd5bb3622d225760f271f6fc9 Konstantin Belousov 2026-03-29 01:30:03

Filesystems

nfsd: Fix handling of hidden/system during Open/Create
When an NFSv4.n client specifies settings for the archive,
hidden and/or system attributes during a Open/Create, the
Open/Create fails for ZFS.  This is caused by ZFS doing
a secpolicy_xvattr() call, which fails for non-root.
If this check is bypassed, ZFS panics.

This patch resolves the problem by disabling va_flags
for the VOP_CREATE() call in the NFSv4.n server and
then setting the flags with a subsequent VOP_SETATTR().

This problem only affects FreeBSD-15 and main, since the
archive, system and hidden attributes are not enabled
for FreeBSD-14.

I think a similar problem exists for the NFSv4.n
Open/Create/Exclusive_41, but that will be resolved
in a future commit.

Note that the Linux, Solaris and FreeBSD clients
do not set archive, hidden or system for Open/Create,
so the bug does not affect mounts from those clients.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292283
Reported by:    Aurelien Couderc <aurelien.couderc2002@gmail.com>
Tested by:      Aurelien Couderc <aurelien.couderc2002@gmail.com>
MFC after:      2 weeks
a6d57f312f18bbeeda8a34e99d0a662b0db9a190 Rick Macklem 2026-01-08 16:27:32
fusefs: support FUSE_IOCTL
MFC After: 1 week
Signed-off-by: CismonX <admin@cismon.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1470
17ba6f428683b661178b50a9d59f8b9e0dd2138a CismonX 2025-07-05 12:46:27
Commit group #51: nfscl: Fix handling of case insensitive file systems
nfscl: Fix handling of case insensitive file systems

Name caching must be handled somewhat differently
for case insensitive file systems.  Negative name
caching does not work and, for rename, all names
associated with the rename'd vnode must be disabled.

For a case insensitive ZFS file system that is exported,
the unpatched code did work, since the change in mtime
or ctime of the directory when other case names were
created or rename'd would disable the false name cache
hit.  However, an export of an msdosfs file system
breaks the NFS client, because it only works if ctime/mtime
is changed whenever a name is added/removed.  Depending
on what the server file system is, this may not happen,
due to clock resolution or lack of support for these
attributes.

This patch checks to see if the server file system is
case insensitive and modifies the name caching to handle
this.

There is still a problem if a case insensitive file system
is a subtree of a non-case insensitive is exported by the
NFSv4 server.  This can be fixed someday, when the NFSv4
client gets support for submounts within the mount.

Suggested by:   kib
MFC after:      2 weeks
f2155a6fb5681c3dca4524a3b2b862a72218a541 Rick Macklem 2026-01-21 00:21:52

nfscl: Fix the build

Fixes:  https://cgit.freebsd.org/src/commit/?id=f2155a6fb568 ("nfscl: Fix handling of case insensitive file systems")
053449fa5c6c9fdbff1d1014482a5842bc860811 Rick Macklem 2026-01-21 01:32:23
fusefs: Implement support for the auto_unmount option kernel-side
libfuse clients may pass the "-o auto_unmount" flag to ensure that the mountpoint
will get unmounted even if the server terminate abnormally. Without this flag
sending KILL to a FUSE daemon leaves its mountpoint mounted.

Approved by:    asomers
Differential Revision:  https://reviews.freebsd.org/D53086
10037d0978f8b16dc6746b0b942788e5edc6e84f Gleb Popov 2025-10-14 16:15:50
devfs: unlock the directory vnode around the call to dev_clone handler
The lock around dev_clone is unfortunate because cloner might need to
take its own locks that establish the order with devfs vnodes, and then
transiently participates in further VFS locks order.  For instance, this
way the proctree_lock or allproc_lock become involved.

Unlock dvp, we can unwind if the vnode become doomed while cloner was
called.

Reported and tested by: pho
Reviewed by:    kevans, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55028
a8e92198f854c2766eedec5a2ea3cc23c64d7b12 Konstantin Belousov 2026-01-26 01:49:32
bectl: Add -E flag to create an empty boot environment
Signed-off-by: Pat Maddox <pat@patmaddox.com>
Reviewed by:    kevans
MFC after:      1 week
Closes:         https://github.com/freebsd/freebsd-src/pull/1975
2e020c84cb5ee1452e448f27ff7a7b6076c0147a Pat Maddox 2026-02-05 03:54:09
ext2fs: Use __sdt_used for variables only used by SDT probes
Reviewed by:  imp, markj
Differential Revision:  https://reviews.freebsd.org/D55164
83e5b79c7c98a7f8c94a99b102bc8a90c195769a John Baldwin 2026-02-09 16:27:44
fusefs: remove the obsolete rename_lock
This lock was included in the original GSoC submission.  Its purpose
seems to have been to prevent concurrent FUSE_RENAME operations for the
current mountpoint, as well as to synchronize FUSE_RENAME with
fuse_vnode_setparent.  But it's obsolete, now that ef6ea91593e added
mnt_renamelock .

MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D55231
7755a406a6ae3801e885a79f714155f97c4d2bc6 Alan Somers 2026-02-10 20:45:23
nullfs: Fix handling of doomed vnodes in nullfs_unlink_lowervp()
nullfs_unlink_lowervp() is called with the lower vnode locked, so the
nullfs vnode is locked too.  The following can occur:
1. the vunref() call decrements the usecount 2->1,
2. a different thread calls vrele() on the vnode, decrements the
   usecount 0->1, then blocks on the vnode lock,
3. the first thread tests vp->v_usecount == 0 and observes that it is
   true,
4. the first thread incorrectly unlocks the lower vnode.

Fix this by testing VN_IS_DOOMED directly.  Since
nullfs_unlink_lowervp() holds the vnode lock, the value of the
VIRF_DOOMED flag is stable.

Thanks to leres@ for patiently helping to track this down.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288345
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55446
8b64d46fab87af3ae062901312187f3a04ad2d67 Mark Johnston 2026-02-25 15:31:30
ffs snapshots: pass valid args to vn_start_write
If the initial no-wait vn_start_write fails, we pass the old
PCATCH flag to the following sleepable vn_start_write.
Following a75d1ddd74, that flag should be V_PCATCH.

Sponsored by:           Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D55512
722fbfef0abb4de31fb91fd35f9b85fd534725c4 Eric van Gyzen 2026-02-25 16:26:06
nfsclient: convert to use vn_delayed_setsize()
Reviewed by:  rmacklem
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55595
5c71df9850355e20cf8f89fb656b18ef79cdf178 Konstantin Belousov 2026-02-28 16:26:12
nfs_clstate.c: Handle the same stateid case correctly
When an NFSv4.1/4.2 sarver upgrades a read delegation to
a write delegation, it does not need to change the
delegation's stateid.

Without this patch, a DELEGRETURN of the stateid was done
for the case where the delegation stateid had not changed.
This return was bogus, since the delegation stateid now
represents the new write delegation.

This patch fixes the priblem by checking for "same stateid"
and only doing the DELEGRETURN when it is not the same.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289711
Tested by:      Peter Much <pmc@citylink.dinoex_sub.org>
MFC after:      2 weeks
016570c4463d5908953355ee1cf9a385ad9601b4 Rick Macklem 2026-03-08 21:09:36
p9fs: locking improvements for p9fs_stat_vnode_dotl()
If the vnode is share-locked:
- Use vn_delayed_setsize() to avoid calling vnode_pager_setsize() with
  the vnode only shared locked.
- Interlock the vnode to get exclusive mode for updating the node
  fields.

Reciprocally, interlock the vnode in p9fs_getattr_dotl() to observe the
consistent values on read.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293492
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55665
2b256f00aaee4713b8e6f0e3c0f3493065f710c4 Konstantin Belousov 2026-03-05 12:35:43
p9fs: use atomics for updating node->flags
This should prevent seeing inconsistent flags values when updating it
under the shared vnode lock.

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55665
c2012c7faf74c9e7b4e3de2472e10b58ed096996 Konstantin Belousov 2026-03-08 04:44:33
Commit group #52: fusefs: redo vnode attribute locking
fusefs: redo vnode attribute locking

Previously most fields in fuse_vnode_data were protected by the vnode
lock.  But because DEBUG_VFS_LOCKS was never enabled by default until
stable/15 the assertions were never checked, and many were wrong.
Others were missing.  This led to panics in stable/15 and 16.0-CURRENT,
when a vnode was expected to be exclusively locked but wasn't, for fuse
file systems that mount with "-o async".

In some places it isn't possible to exclusively lock the vnode when
accessing these fields.  So protect them with a new mutex instead.  This
fixes panics and unprotected field accesses in VOP_READ,
VOP_COPY_FILE_RANGE, VOP_GETATTR, VOP_BMAP, and FUSE_NOTIFY_INVAL_ENTRY.
Add assertions everywhere the protected fields are accessed.

Lock the vnode exclusively when handling FUSE_NOTIFY_INVAL_INODE.

During fuse_vnode_setsize, if the vnode isn't already exclusively
locked, use the vn_delayed_setsize mechanism.  This fixes panics during
VOP_READ or VOP_GETATTR.

Also, ensure that fuse_vnop_rename locks the "from" vnode.

Finally, reorder elements in struct fuse_vnode_data to reduce the
structure size.

Fixes:          https://cgit.freebsd.org/src/commit/?id=283391
Reported by:    kargl, markj, vishwin, Abdelkader Boudih, groenveld@acm.org
MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D55230
7e68af7ce2c1b892954df415774fe59fd2f1b62f Alan Somers 2026-01-23 21:23:51

tests/fusefs: fix sign-compare warning on armv7

Fixes:          https://cgit.freebsd.org/src/commit/?id=7e68af7ce2c1b892954df415774fe59fd2f1b62f
Reviewed by:    asomers
Approved by:    emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D55846
736d8852e190f69dc93206ed3fb2d1f712dc3ad1 Siva Mahadevan 2026-03-14 03:48:31
Commit group #53: zfs: merge openzfs/zfs@f8e5af53e
zfs: merge openzfs/zfs@f8e5af53e

Notable upstream pull request merges:
 #17358 4975430cf Add vdev property to disable vdev scheduler
 #18031 c77f17b75 Add snapshots_changed_nsecs dataset property
 #18080 dbb3f247e cmd/zfs: clone: accept `-u` to not mount newly created
                  datasets
 #18089 -multiple Zstd: Update bundled library to version 1.5.7
 #18091 2301755df Fix zfs_open() to skip zil_async_to_sync() for the
                  snapshot
 #18093 -multiple L2ARC: Rework write throttling with DWPD rate limiting
                  and parallel writes
 #18095 2dbd6af5e Rename several printf attributes declarations to
                  __printf__
 #18096 8605bdfdd FreeBSD: unbreak compilation on i386
 #18105 794f1587d When receiving a stream with the large block flag,
                  activate feature
 #18115 765929cb4 DDT: Add locking for table ZAP destruction
 #18118 09e4e01e9 Fix history logging for `zpool create -t`
 #18119 2f1f25217 icp: emit .note.GNU-stack section for all ELF targets
 #18131 3fffe4e70 Fix --enable-invariants on FreeBSD
 #18133 d2f5cb3a5 Move range_tree, btree, highbit64 to common code
 #18136 54b141fab FreeBSD: Remove references to DEBUG_VFS_LOCKS
 #18138 cdf89f413 Flush RRD only when TXGs contain data
 #18139 a157ef62a Make sure we can still write data to txg
 #18140 cd895f0e5 remove thread unsafe debug code causing FreeBSD double
                  free panic
 #18144 4f180e095 Fix activating large_microzap on receive
 #18146 35b2d3970 Lock db_mtx around arc_release() in couple places
 #18154 b36472052 nvpair: chase FreeBSD xdrproc_t definition
 #18160 21bbe7cb6 Improve caching for dbuf prefetches
 #18177 -multiple Multihost Improvements
 #18179 2646bd558 Allow rewrite skip cloned and snapshotted blocks
 #18180 aa29455dd Restrict cloning with different properties
 #18184 040ba7a7c libzfs: improve error message for zpool create with
                  ENXIO
 #18188 1412bdc6c zfs_vnops_os.c: Move a vput() to after
                  zfs_setattr_dir()
 #18198 cc184fe98 Fix `send:raw` permission for send `-w -I`
 #18208 ba970eb20 Cleanup allocation class selection
 #18212 0f9564e85 Simplify dnode_level_is_l2cacheable()
 #18214 370570890 Remove parent ZIO from dbuf_prefetch()
 #18218 bfb276e55 freebsd: Fix TIMESPEC_OVERFLOW for PowerPC
 #18222 d06a1d9ac Fix available space accounting for special/dedup
 #18225 d48967728 ICP: AES-GCM VAES-AVX2: fix typos and document
                  source files
 #18226 c8a72a27e ICP: AES-GCM assembly: remove unused Gmul functions
 #18230 -multiple Fix zdb --key crash for unencrypted datasets, and
                  teach tests to understand this better
 #18233 -multiple icp: add SHA-512 implementation using Intel SHA512
                  extension
 #18245 991fc56fa Introduce dedupused/dedupsaved pool properties
 #18251 6a717f31e Improve misleading error messages for
                 ZPOOL_STATUS_CORRUPT_POOL
 #18254 7744f0496 SIMD: libspl: test the correct CPUID bit for AVX512VL
 #18255 6495dafd5 range_tree: use zfs_panic_recover() for
                  partial-overlap remov
 #18256 3408332d7 zhack: Fix importing large allocation profiles on
                  small pools
 #18258 f8457fbdc Fix deadlock on dmu_tx_assign() from vdev_rebuild()
 #18263 f8e5af53e Fix redundant declaration of dsl_pool_t

Obtained from:  OpenZFS
OpenZFS commit: f8e5af53e92fa7c03393fbd4922cb9c1d0c15920
8a62a2a5659d1839d8799b4274c04469d7f17c78 Martin Matuska 2026-03-14 12:14:56

Unbreak LINT after ZFS import

Fixes:          https://cgit.freebsd.org/src/commit/?id=8a62a2a5659d ("zfs: merge openzfs/zfs@https://cgit.freebsd.org/src/commit/?id=f8e5af53e")
356415aaaa8caa18a76ea74eed5c7de6e4d3b5fd Dag-Erling Smørgrav 2026-03-15 17:36:27

zfs: Fix build after merge of openzfs/zfs@f8e5af53e

The change causing it is the introduction of the test over __BMI2__ in
'module/zstd/lib/common/bitstream.h'.

This is a stop-gap commit whose content needs to be upstreamed (after
possibly having been improved).

Fixes:          https://cgit.freebsd.org/src/commit/?id=8a62a2a5659d ("zfs: merge openzfs/zfs@https://cgit.freebsd.org/src/commit/?id=f8e5af53e")
Sponsored by:   The FreeBSD Foundation
5f659f2b8533fd6063880080618e940b3a9ee370 Olivier Certner 2026-03-15 23:01:08
tarfs: swap deprecated ZSTD_resetDStream() with ZSTD_DCtx_reset()
ZSTD_resetDStream() is deprecated since 1.5.4: https://github.com/facebook/zstd/commit/5d8cfa6b96a6442ab1251f9de3b47a0eb12561a0

This change is needed to MFV zstd 1.5.7.

Approved by:    emaste (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55835
922d73540d2d9897e5e8160c445cefa13581564e Siva Mahadevan 2026-03-14 03:54:46
nfs_nfsdserv.c: Fix handling of archive flag for mkdir
An NFSv4.1/4.2 client can set/clear the archive, hidden
and system flags when creating non-regular files, such
as directories.

Without this patch, the setting of va_flags causes an
EPERM failure, since they are specified for VOP_MKDIR(),
VOP_MKNOD() and VOP_SYMLINK().

This patch sets va_flags == VNOVAL for the above VOP_xxx()
calls and then sets/clears the flags after creation,
which fixes the problem.

This bug only affects the Windows NFSv4.1/4.2 client.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293691
Tested by:      Dan Shelton <dan.f.shelton@gmail.com>
MFC after:      2 weeks
6580d040861dfbf6c630a93cbf41f2a2c7e7b327 Rick Macklem 2026-03-16 23:22:37
zfs: merge openzfs/zfs@3ee08abd2
Notable upstream pull request merges:
 #17000 -multiple cmd/zfs: support creating parents with canmount=no
 #17926 b481a8bbb Make zpool status dedup table support raw bytes -p output
 #18238 -multiple Report space metrics per allocation class
 #18240 5dad9459d Add --no-preserve-encryption flag
 #18257 1eace5906 libzfs: use mount_setattr for selective remount including
                  legacy mounts
 #18259 1e2c94a04 More consistent use of TREE_* macros in AVL comparators
 #18262 c58b8b7dc Fix check for .cfi_negate_ra_state on aarch64
 #18264 f109c7bb9 Add the --file-layout (-f) option to zdb(8)
 #18268 304de7f19 libzfs: handle EDOM error in zpool_create
 #18275 753f1e1e2 zstream: add a drop_record subcommand
 #18276 0f90a797d Fix vdev_rebuild_range() tx commit
 #18277 1e1d64d66 Fix log vdev removal issues
 #18278 06b0abfe6 Fix the send --exclude option to work with encryption
 #18281 e73ada771 libzpool: lift zfs_file ops out to separate source file
 #18284 d97945776 zstream: consolidate shared code
 #18285 -multiple Separate SIMD compile checks for userspace and kernel
 #18288 c5905b2cb Implement lzc_send_progress
 #18289 -multiple L2ARC: Add depth cap and write budget fairness for
                  persistent markers
 #18290 d45c8d648 FreeBSD: Improve dmesg kernel message prefix
 #18294 b403040c4 draid: fix data corruption after disk clear
 #18296 -multiple libzfs: mnttab cleanup
 #18300 d35951b18 zpool clear: remove undocumented rewind flags
 #18301 ae7fcd5f9 fix libzfs diff mem leak in an error path
 #18303 65165df12 zilstat: add man page
 #18314 7f65e04ab libzfs: scrub: only include start and end nv pairs if
                  needed for scrub
 #18315 -multiple Sync ZVOLs block cloning conditions with file systems
 #18330 f80338fac zarcsummary: add man page
 #18337 f259a47c7 zpool-iostat.8: clarify first report shows per-second
                  averages

Obtained from:  OpenZFS
OpenZFS commit: 3ee08abd2fcef3123188e9ad61a9cd80b9b7831c
80aae8a3f8aa70712930664572be9e6885dc0be7 Martin Matuska 2026-03-19 20:25:34
nfs_nfsdsocket.c: All Copy and Clone across file systems
For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.

As such, this patch allows the Copy/Clone to be attempted
when the file handles are for files on different file systems.

This fixes a problem for exported ZFS file systems when a
copy_files on file_range(2) between file systems in the same
NFSv4 mount is attempted.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294010
MFC after:      2 weeks
b65e7b4944cc2f594c9d9e6abc9b8618d3d62ff8 Rick Macklem 2026-03-28 19:39:10
nfs_nfsdsocket.c: Allow Copy/Clone from a read-only fs
For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.

However, without this patch, the Copy/Clone will fail with
EROFS if the input file is on a read-only mounted file system.
This happens because Copy/Clone will try to do a VOP_SETATTR()
of atime to set the atime.

This patch pretends the VOP_SETATTR() of atime worked for
read-only file systems.  It fixes a problem when copying
files from a ZFS snapshot.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294010
MFC after:      2 weeks
b5815ee99a015c6ac118d7e9646d0c95b72e9f2d Rick Macklem 2026-03-29 21:41:36

Kernel

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

linuxkpi: Don't clobber result on failure
In kstrto*(), don't assign to *res until we know the conversion is
successful, and address issues that may result in warnings if code
that uses <linux/kstrtox.h> is compiled at high warning levels.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    bz, emaste
Differential Revision:  https://reviews.freebsd.org/D54440
3542d60fb8042474f66fbf2d779ed8c5a80d0f78 Dag-Erling Smørgrav 2026-01-02 07:30:06
linuxkpi: Correct kstrtobool
Implement the exact same logic as in Linux:

* Accept 'e', 't', 'y', '1', "on" for true.

* Accept 'd', 'f', 'n', '0', "of" for false.

* Disregard any characters beyond that.

* Check that the string is not null, but don't check the result pointer.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    bz, emaste
Differential Revision:  https://reviews.freebsd.org/D54451
f86148d2777d4d7985ed8f4ae957c41c44bd2484 Dag-Erling Smørgrav 2026-01-03 09:09:41
cam: Minor comment cleanup
Some minor comment cleanup, add a comment about an unused value, etc.
No functional change.

Sponsored by:           Netflix
8ac77ea6a3c6ce99d39e1dd4e19adb444b2b4d5a Warner Losh 2026-01-03 17:50:04
linuxkpi: Add option to skip trailing newline in `lkpi_hex_dump()`
This will be useful in the upcoming implementation of
`hex_dump_to_buffer()` which doesn't add one.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51844
43b5a264c6f665ac451102d828a8f51307efe626 Jean-Sébastien Pédron 2025-08-09 10:28:27
linuxkpi: Add hex_dump_to_buffer()
This function prints a single line of hex dump to the given line buffer.

The implementation relies on `lkpi_hex_dump()` to format the string.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51559
b1bef9f7e0e182a9eee222639ffc8af4883ec0fa Jean-Sébastien Pédron 2025-07-10 23:03:51
vm/vm_object.h: clarify the OBJ_ONEMAPPING semantic
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D54459
9c923575606bbd29dcf0ec3384150d2d67136cbb Konstantin Belousov 2025-12-31 22:26:38
Commit group #54: linuxkpi
linuxkpi: Define `PCI_POSSIBLE_ERROR()` macro

It comes with `PCI_ERROR_RESPONSE` and `PCI_SET_ERROR_RESPONSE()` but we
don't use them so far. Therefore `PCI_POSSIBLE_ERROR()` will always
reture false.

As written in the comment, this macro is a bit weird given the Linux
`pci_read_*() functions can return an error code separately from the
read value.

The `PCI_POSSIBLE_ERROR()` macro started to be used by the amdgpu DRM
driver in Linux 6.10.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54487
ace666bd21a204c62807f2c899402a7dc9ab161a Jean-Sébastien Pédron 2025-08-09 16:14:05

linuxkpi: Add a dummy <linux/kdebug.h>

The DRM generic code started to include it in Linux 6.10 but doesn't
seem to use anything inside.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54490
65d7e9033439581af5bc1668827850663f84a5a5 Jean-Sébastien Pédron 2025-08-12 21:58:44

linuxkpi: Split <linux/compiler.h>

On Linux, they split the content into three headers:
1. <linux/compiler.h>
2. <linux/compiler_types.h>
3. <linux/compiler_attributes.h>

The first includes the second, which includes the third.

<linux/compiler_types.h> is also included on the compiler command line
by default! I added that to the compilation flags of the DRM drivers.
This allowed me to drop at least one:

    #ifdef __FreeBSD
    #include <linux/compiler.h>
    #endif

Note that our copy of <linux/compiler.h> contains definitions which are
not defined by Linux' <linux/compiler.h>. I left them alone.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54495
33fa585a0e9032b31c563c8aae001c0c2a4866d4 Jean-Sébastien Pédron 2025-08-17 11:10:43

linuxkpi: Replicate Linux #includes between headers

The DRM drivers (and probably other parts of the Linux kernel) had a
significant cleanup w.r.t. which source file includes what in Linux
6.10. Nonetheless, the DRM drivers still depend on implicit namespace
pollution because some source files do not include all the headers they
should.

This cleanup broke the build with FreeBSD because we do not replicate
the same `#include` directives everywhere.

This commit adds the same `#include` directives in several headers in
order to get the same namespace pollution.

This fixes the build of the DRM drivers from Linux 6.10. An example is
`drm_dp_tunnel.c` which needed `str_yes_no()` defined by
<linux/string_helpers.h> (technically <linux/string_choices.h> in
Linux). It gets it through:

    <linux/i2c.h> -> <linux/regulator/consumer.h> -> <linux/suspend.h> ->
    <linux/swap.h> -> <linux/memcontrol.h> -> <linux/cgroup.h> ->
    <linux/seq_file.h> -> <linux/string_helpers.h>

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54496
b5f7a0b0fd8953c00b154d96b79ba0208c2e1aca Jean-Sébastien Pédron 2025-08-17 11:17:49

linuxkpi: Add support for statically-allocated kfifo

The main difference with the dynamically allocated version is that the
structure is initialized with `DECLARE_KFIFO()` which takes the number
of items as an additional argument compared to `DECLARE_KFIFO_PTR()`.

The declared structure is then initialized with `INIT_KFIFO()` which
sets all fields to 0, except `total` which is computed from the size of
the array passed to `DECLARE_KFIFO()`.

The amdgpu DRM driver started to used this in Linux 6.10.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54497
55bd09ae0fc437c9eb135952ac278540b7388add Jean-Sébastien Pédron 2025-09-07 08:37:27

linuxkpi: Add a dummy <linux/fpu.h>

The amdgpu DRM driver started to include in from Linux 6.10, but either
it does not use any of it, or linuxkpi provides the necessary API from
another header.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54498
242beec703f771312fac3be1b4ce3092bbc93e25 Jean-Sébastien Pédron 2025-09-07 23:22:05

linuxkpi: Add `rol64()`

This is used by <linux/siphash.h> added in a separate future commit.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54499
a9462e32fa75a9a1e3f49964bc42b5303e0dd092 Jean-Sébastien Pédron 2025-09-07 23:22:22

linuxkpi: Add get_unaligned_le64()

This function was the only one missing in the `get_unaligned_*()`
family. This is going to be used by the imported `linux_siphash.c` in a
future commit, which itself is used by DRM drivers starting from Linux
6.10.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54500
15f29e1e1978bbc4ed24975ad3666596281076fc Jean-Sébastien Pédron 2025-09-15 21:40:31

linuxkpi: Add <linux/siphash.h>

The file is copied as is from Linux 6.10 as it dual-licensend under the
GPLv2 and BSD 3-clause.

The amdgpu DRM driver started to use it in Linux 6.10.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54501
d448578b445da95806ef9af996a0db9754daadeb Jean-Sébastien Pédron 2025-09-07 13:43:11

linuxkpi: Add `radix_tree_deref_slot()`

We don't do reference counting, we only dereference the pointer and
retunr the value.

The amdgpu DRM driver started to use it in Linux 6.10.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54502
4c89b333808a7eae0dad595b13686e9cf60bd4e6 Jean-Sébastien Pédron 2025-09-07 13:45:10
Commit group #55: Add ASMC_DEBUG make option
Add ASMC_DEBUG make option

This allows folks to enable debug statements in asmc(4) using kernel
configs via the `options ASMC_DEBUG` directive.

While here, remove a duplicate `device vt_efifb` directive in `NOTES`
as it's already handled in the `GENERIC` config

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54511
f224591746bdaf14ad5f63de4738a3146cc2f55f Enji Cooper 2026-01-04 08:27:57

i386: Fix kernel compilation after introduction of ASMC_DEBUG option

Fixes:          https://cgit.freebsd.org/src/commit/?id=f224591746bd ("Add ASMC_DEBUG make option")
Sponsored by:   The FreeBSD Foundation
fde9fe18219f6e987279a9d042345e7c6fc170d1 Olivier Certner 2026-01-09 16:25:52

sys/x86/NOTES: Add vt_efifb

Contrary to what is stated in commit f224591746bd ("Add ASMC_DEBUG make
option"), the various NOTES files should list all available options.

Since vt_efifb is supported also on i386, add it back to x86/NOTES
instead of amd64/NOTES.

Fixes:          https://cgit.freebsd.org/src/commit/?id=f224591746bd ("Add ASMC_DEBUG make option")
Sponsored by:   The FreeBSD Foundation
67599eef01f5417715f673ec81fc1467917c7a10 Olivier Certner 2026-01-09 16:23:59
kern_syscall_deregister: document syscall 0 no-op logic
Document syscall #0 being handled specially in
`kern_syscall_deregister(..)`: it's a reserved syscall and not
dynamically registered, and hence does not need to be deregistered in
the function.

Co-authored-by: ngie@
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54326
f384784289dba13b90138a89d3df3a8ea063aff9 Anagh Verma 2026-01-06 07:42:56
linker: Reset DMAP protections in link_elf_unload_file()
On x86, when a preloaded kernel module is unloaded, we free the backing
(physically contiguous) pages.  The ET_REL linker will have adjusted
protections on segments of the preloaded file, which updates the direct
map, so the original protections must be restored when unloading the
module.

Previously this was handled in kmem_bootstrap_free(), but there is no
apparent reason not to handle this within the kernel linker.  Moreover,
we were not resetting permissions in the kernel map on arm64.

Reviewed by:    alc, kib
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D54438
203e5a1eeec1153b0bcb230ccfb90531fa8cbeb5 Mark Johnston 2026-01-06 16:48:54
Commit group #56: linuxkpi
linuxkpi: Define `raw_spinlock_t` in <linux/spinlock.h>

For now, it is synonymous to `spinlock_t`. The DRM generic code uses the
`struct raw_spinlock` and not `raw_spinlock_t`, that's why the
definition is a struct embedding a `struct mtx`, compared to
`spinlock_t` which is a simpler typedef.

The DRM generic code started to use it in Linux 6.10.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54489
ac341353a0434408eec6388f3451be8517252c5f Jean-Sébastien Pédron 2025-08-12 21:55:04

linuxkpi: Add <linux/font.h>

The header defines the minimum to allow the DRM generic code to build.
The only function used so far is `get_default_font()`, as part of a
DRM-specific panic handler. We do not use this panic handler on FreeBSD.

For now, it returns a NULL value. It should probably map to a vt(4)
font.

The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54491
514d37fa268b8b181e3632d7f138bd09aa15683c Jean-Sébastien Pédron 2025-08-12 22:00:10

linuxkpi: Add <linux/kmsg_dump.h>

This header declares register/unregister functions to allow a piece of
code to tell what function to call in case of a panic. Several panic
handlers may be registered.

The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54492
e86e4f161e7232b7ac19af906368c664d6167cdc Jean-Sébastien Pédron 2025-08-12 22:02:18

linuxkpi: Add WARN_RATELIMIT()

The i915 DRM driver started to use it in Linux 6.10.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54493
3942e85b992138056841cd7c96ea20436a66b740 Jean-Sébastien Pédron 2025-08-12 23:14:52

linuxkpi: Replicate the chain of #include in the `cec*.h` headers

The i915 DRM driver depends on this namespace pollution to access
`debugfs_*` functions, after several explicit #include of
<linux/debugfs.h> were removed in Linux 6.10.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54494
10c6f1f627cd4267f9b95f60a9a30e4609566f8a Jean-Sébastien Pédron 2025-08-13 19:13:10

linuxkpi: Add `rol32()`

`rol64()` and `rol32()` are used by <linux/siphash.h>. The former was
added previously, before <linux/siphash.h> was added. However the latter
was not, and it broke the build on armv7.

Reported by:    adrian
Reviewed by:    adrian, rpokala
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54588
6c0bcd15e4782ff2e23119a37396d693d09c695d Jean-Sébastien Pédron 2026-01-07 21:18:38
vm_object.h: tweak OBJ_ONEMAPPING comment even more
The formulation that pages are allowed to have at most one mapping is
not quite clear.  Nothing prevents pages from having more than one
mapping, but the flag must be cleared then.

Reviewed by:    alc, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D54570
dcb80621bbf9a733b91f1a011af873318fac2709 Konstantin Belousov 2026-01-07 06:25:46
tty(4): Consistently use ISO C99 bool
61002e0371f09fcd024434144657496d9caa3908 Marius Strobl 2026-01-07 17:12:24
Commit group #57: cam
cam: Start adding dtrace provider 'cam'

Start to provide robust tracing in cam now that clang has broken my
fbt-based dtrace scripts a couple of times.

Sponsored by:           Netflix
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D54468
ecb1f465836a40c7cdcbcfb67d7d23c36b48c1eb Warner Losh 2026-01-08 06:19:03

cam: Add probes for xpt actions

cam::xpt:action(union ccb *)
cam::xpt:done((union ccb *)
cam::xpt:async-cb(void *cbarg, uint32_t async_code, struct cam_path
        *path, void *async_arg);

Called when xpt_action(), xpt_done*() and the xpt async callbacks are
called.

Sponsored by:           Netflix
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D54469
1a7151f79664644b2e7c8e69427be8b846e9c1a4 Warner Losh 2026-01-08 06:19:10

cam: When inq data isn't valid, pass NULL

When the device isn't there, we don't have valid inq data. Pass NULL in
this case. All the routines that receive this test against NULL already.

Sponsored by:           Netflix
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D54470
aaec2a90b5cecd38520ecb0ffa23f116d36933f3 Warner Losh 2026-01-08 06:19:21
Commit group #58: cache
cache: avoid hardcoded zone alignment

Previously, this was underaligned on CHERI system where pointers are
larger than time_t.

Use the alignment of struct namecache_ts which picks up time_t via strut
timespec and pointers via struct namecache.  This arguably overaligns
cache_zone_small and cache_zone_large on i386 kernels, but I suspect the
actual microarchitectures most i386 binaries are run on do better with
64-bit alignment.

Reviewed by:    olce, markj
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=cf8ac0de8150 ("cache: reduce zone alignment to 8 bytes")
Differential Revision:  https://reviews.freebsd.org/D54376
fb0bdbea2ed4f63ef07061313f8cef89a3d73579 Brooks Davis 2026-01-09 14:15:22

cache: avoid hardcoded cache padding

Replace CACHE_LARGE_PAD with rounding up to the alignment of struct
namecache_ts.

No functional change.

Reviewed by:    olce, markj
Suggested by:   jhb
Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54553
258ad800929b397c79bd1fc8178e14bfec9ebe78 Brooks Davis 2026-01-09 14:15:35

cache: avoid hardcoded CACHE_PATH_CUTOFF

Compute the cutoff at compile time instead which will avoid the need
for a CHERI case.

Correct the comment about CACHE_PATH_CUTOFF.  It dates to 5.2.0 not 4.4
BSD.  Historic values are:

32 - introduced (c2935410f6d5f)
35 - NUL terminated and bumped (5d5c174869104)
39 - sized to alignment (bb48255cf5eff)
45 - bumped to improve efficency on 64-bit (3862838921eb8)

No functional change.

Reviewed by:    markj
Suggested by:   jhb
Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54554
1b425afa8d5fb611b17f951e5099c177fd97ffea Brooks Davis 2026-01-09 14:15:43
conf: remove powerpcspe
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 4a5a1c17ac43356fae053524187bb16f8fc1ac70)
c5d4a124d093f11784833f25d1332a54465678fb Minsoo Choo 2025-12-03 04:06:10
device_delete_child should be destroying the child, not the dev
MFC After: 1 week
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1934
930a1341d62ccc4be969c2261e3abaf0c0573a9f AZero13 2025-12-18 02:09:31
linux: support termios2 ioctls
Signed-off-by: mothcompute <mothcompute@protonmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1949
85bf328868c8f6d8fede9d8d4b4ff8a589636990 mothcompute 2026-01-06 03:19:21
linux: add hidraw ioctl handler
First step towards getting the Linux version of SDL with HIDAPI gamepad
drivers to work. Not quite complte as SDL expects to find some
information in sysfs as well.

Signed-off-by: Alex S <iwtcex@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1938
d5e5fed1edfc3828f594fa8727d1c62c36b54e16 Alex S 2025-12-31 09:11:53
ixl(4): Enable building driver on ARM64
For consistency with other drivers enable building ixl
on ARM64 target.

Please be advised that it is only compile tested.
Intel will continue to test Ethernet drivers only on x86-64
platforms, and is not going to provide support for issues,
which cannot be reproduced in such environment.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Suggested by:   Dave Cottlehuber <dch@FreeBSD.org>
Reviewed by:    manu
Approved by:    kbowling (mentor)
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D54289
a3d472219c5aa3c211371aebd2effbfade61cb5c Krzysztof Galazka 2026-01-09 22:36:10
rge: Add to amd64 GENERIC and to sys/conf/NOTES
Reviewed by:  adrian
Differential Revision:  https://reviews.freebsd.org/D54609
e28529ca4d34084452ca9acf63aa40279787239a Brad Smith 2026-01-10 03:57:17
cddl: remove sparc and mips code
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1910
c29ec2ee9871cc21c3406bf6ed398980acbedcb5 Minsoo Choo 2025-12-01 15:10:06
sys: do not allow entering vm_fault() on boot until VM is initialized
On amd64, a hack sets td_critnest to 1 in hammer_time(), and then clear
it before returning from hammer_time(), which is too early.  Instead,
set TDP_NOFAULTING for thread0, and clear the flag after vm_init() finished.

Noted by:       adrian
Reviewed by:    adrian (previous version), markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54768
83d98828867591b5d842573ed6edcec7392f82df Konstantin Belousov 2026-01-18 21:14:59
compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches
uint64_t is 4-byte aligned on i386, but is 8-bytes aligned on all other
32bit arches FreeBSD supports.  Provide the freebsd32_uint64_t type and
the FU64_CP() macro, which are intended to be used where 32bit ABI uses
(u)int64_t type, and do proper layout and copying for the aggregate type.

Reviewed by:    des, emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54663
96acaa960023c20e852e04e7cc5c6a5faca36c67 Konstantin Belousov 2026-01-12 04:45:36
sys/abi_compat.h: fix UB for bintime32 handling
Do not cast and then access potentially unaligned uint64_t in the BT_CP()
macro.  Use freebsd32_uint64_t type and FU64_CP() for the frac member.

Noted by:       des
Reviewed by:    des, emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54663
be1b2da855cc38531733b5c97891cd4a40a993bc Konstantin Belousov 2026-01-12 04:46:15
Commit group #59: LinuxKPI: 802.11: factor out rate logic for mandatory channels
LinuxKPI: 802.11: factor out rate logic for mandatory channels

I was looking at rate work for another problem and found more flags
in ath9k (which we will likely never need).  The documentation then
revealed the "mandatory" flags as well and with discussions about
cfg80211 going on I decided to use the momentum and split our
"supp_rates" setup between lkpi_lsta_alloc() and wiphy_register().

There should be no functional change.

While there also initialize max_rc_amsdu_len.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
768332d619484834a7866fde4bf2695d4262355a Bjoern A. Zeeb 2026-01-20 13:33:16

LinuxKPI: 802.11: fix build for non-debug kernels

lkpi_nl80211_band_name() is only available under LINUXKPI_DEBUG_80211.
IMPROVE in theory should be as well or defined to nothing but we cannot
do that in cfg80211.h mac80211.h where we possibly (re-)define this.

Put an #ifdef around the IMPROVE call for now (untested).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=768332d61948
Reported by:    CI
c592d54a24b984f2e23b337a6abeac09b9c357b5 Bjoern A. Zeeb 2026-01-20 17:16:50
ktrace: do not enqueue request if the process' ktrioparams are freed
The p_ktrioparms are freed on termination of tracing.  Any ktr requests
added to the queue after that would hang there and leak on the struct
proc recycling, or trigger an assert in the process destructor for debug
builds.

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54804
6bb3f208617b58a54e2204eb31bae3f9a86117a7 Konstantin Belousov 2026-01-20 15:01:08
rpctls_impl.c: Use a direct cast to uintptr_t instead of __DECONST
This fixes the build on CHERI architectures where the compiler warns
about a direct cast between uint64_t and const void * inside of
__DECONST.  However, GCC would also complain about this on 32-bit
kernels due to uint64_t not being the same size as a pointer.  Also,
a direct cast to uintptr_t to right-size the cookie value is more
direct than using __DECONST given that there is no "const" pointer
involved in the expression.

Reviewed by:    brooks, glebius
Obtained from:  CheriBSD
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54797
5eb1d4eec67685a933cedd5a20fbec86febcd3a9 John Baldwin 2026-01-21 16:10:53
LinuxKPI: 802.11: Management MIC element can have 8 or 16 octets MIC
Management MIC element (MME) can have 8 or 16 octets MIC.  Add a second
structure used by at least iwlwifi and update reference to latest
standard version.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
e4a4841d7acbded7862175d46dfe325b44016495 Bjoern A. Zeeb 2026-01-20 18:55:00
Commit group #60: LinuxKPI
LinuxKPI: 802.11: add new field to struct cfg80211_bitrate_mask

rtw89(4) accesses eht_mcs[].
Add the field to struct cfg80211_bitrate_mask.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
18de28308c2916d18fca4e9d8988910176b14951 Bjoern A. Zeeb 2026-01-20 22:44:43

LinuxKPI: 802.11: rename enum ieee80211_tx_rate_flags and move file

What we used to call enum ieee80211_tx_rate_flags is now used as
enum mac80211_rate_control_flags for the ieee80211_tx_rate.flags
in rtw89(4).  Rename the enum and move it to mac80211 as it seems
to belong there.

Sponsonred by:  The FreeBSD Foundation
MFC after:      3 days
b2c90d106c66daf6dc7fb300c250b4ad0aa274f5 Bjoern A. Zeeb 2026-01-20 22:47:13

LinuxKPI: skbuff: implement skb_queue_splice()

Add skb_queue_splice() and use it in skb_queue_splice_init() which
already had that functionality (plus the init bit).
The new function is used by rtw89(4).

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
f1d7eea9dc1e78ecd247e060f4e8395ba4e77346 Bjoern A. Zeeb 2026-01-20 22:49:05

LinuxKPI: 802.11: set extra tx info flag for EAPOL for mt76

mt76 requires IEEE80211_TX_CTL_USE_MINRATE to be set for EAPOL, so
add it.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
c529e1a8f8edb575de6b109981c4ca7ffdd3b81c Bjoern A. Zeeb 2026-02-04 22:25:50

LinuxKPI: 802.11: make sure we are scheduled before wake_tx_queue()

If we are not scheduled before calling wake_tx_queue() packets may
never go out, which at first will look like EAPOL fails (as
wpa_supplicant suggest possibly with a wrong key).  Using monitor
mode it will be clear what is going on.
Pass a flag down to wake_tx_queue() to call ieee80211_schedule_txq()
in case (*wake_tx_queue)() is supported or not, which solves the
problem for the lkpi_80211_txq_tx_one() which was failing.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
7d60647a1a6c19e7be33428c33b77faadfe863a1 Bjoern A. Zeeb 2026-02-04 22:39:01

LinuxKPI: 802.11: catch possible NULL pointer deref with mt76

With mt76 we, for the first time, see that txstat->skb or
txstat->info may not be filled in linuxkpi_ieee80211_tx_status_ext().
Guard for these cases checking for skb and info to be not NULL and
assume a TX failure in case info is NULL.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
94be5dbdfd22de4ec9ad699803ae18d9d209d824 Bjoern A. Zeeb 2026-02-04 22:46:47

LinuxKPI: expand dma_sync_single_for_cpu() in lkpi_dma_unmap()

In case lkpi_dma_unmap() would call dma_sync_single_for_cpu() we get
into a lock recursion which will trigger a panic with debug kernels.

It would be hard to provide an internal "locked" version for
dma_sync_single_for_cpu().  In the old days this would not have
been a problem but (long before we added the missing sync calls)
some locks got folded into one in a6619e8d9c1a3.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Observed with:  iwlwifi mld
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D54841
b615b4805a9ce83b9b86dd66d46a9f220f9f89c6 Bjoern A. Zeeb 2026-01-23 19:14:18

LinuxKPI: pci: make sure a tailq and lock are initialized

Move the initializations of the tailq and lock from
linux_pci_attach_device() into lkpifill_pci_dev() so that they are
initialized in all cases we create a device (see all the possible
callers of lkpifill_pci_dev()).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D54861
1f19fc2632c98cfe653a082b5fcb02d16053ed06 Bjoern A. Zeeb 2026-01-24 22:16:36

LinuxKPI: move MODULE_DEVICE_TABLE from pci.h to module.h

Move the MODULE_DEVICE_TABLE macro to module.h where it belongs
in preparation for different bus (e.g., USB, SDIO) support.
The various struct <bus>_device_id, if not elsewhere, should be
defined in mod_devicetable.h.

This is the next step after 2f5666c1727c.

No functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D54900
1f4fbcf342f41fecc8dff4e0d9a1f9bdb1cdf784 Bjoern A. Zeeb 2026-01-26 20:31:24

LinuxKPI: mod_devicetable, add comment about [future] LinuxKPI USB

USB structures are defined with the native USB implementation.
Just leave a comment why they are not here.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D54991
020ff5e29431f5b55f2e3876c0e4828205e17cd5 Bjoern A. Zeeb 2026-01-26 21:00:24

LinuxKPI: add scoped_guard(), spinlock guard support

The "cleanup.h" implementation got a bit more complicated.

For one we now use a macro to concatenate a prefix, the name, and a
suffix for variable and function declarations.  This was triggered
by the fact that the "guard_" prefix we used was confusing.  We now
use a generic "cleanup_" which is only encoded in the single place
rather than all over the file.

As already indicated by the comment the DEFINE_LOCK_GUARD_0()
macro got split up and a _1 version which also takes a type got
implemented and is used for a spinlock variant used by rtw89(4)
via the new scoped_guard() bits.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54808
31393810a168b74cf13ace0e1d35dae6b4a12bf5 Bjoern A. Zeeb 2026-01-20 22:54:30

LinuxKPI: 802.11: adjust assoc check before key deletion

There is a discrepancy between the vif assoc state and the sta state
(see comment in lkpi_sta_run_to_init()).
Adjust the check in lkpi_iv_key_delete() and add it to
lkpi_sta_del_keys() so that we can take way the keys after whatever
comes first: the sta went away from AUTHORIZED (RUN) or if the vif is
no longer marked assoc.
This is needed as we may only take the sta down partially back to
State 2 (cf. 802.11-2024, Figure 11-23) and key material is no longer
valid before the vif gets cleaned up and the sta is removed entirely.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
96a57fc4bf4edca9a579cc47f9058253c11f8313 Bjoern A. Zeeb 2026-02-24 23:51:43

LinuxKPI: 802.11: improve crypto debug logging

Add a log entry to lkpi_ieee80211_iterate_keys() in order to be able
to determine if there are still keys available when a driver calls
into this (e.g., iwlwifi does before removing the sta to make sure
the keys are gone).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
acba7a62b92ff62ca4ae831e9c28fc6ed4f6455a Bjoern A. Zeeb 2026-02-25 00:05:36

LinuxKPI: 802.11: fold the sta state machine again

In and around d9f59799fc3e7 we adjusted the initial sta state machine
implementation and unfolded some functions, duplicating code.
This version tries to undo some of that as it seems that we can get
away with doing it more cleanly these days.

There are 5 main functions for the path from INIT to RUN (UP1,2,3.1,3.2,4)
and 4 main functions for the path from RUN to INIT (DOWN1,2,3,4).
The reason there is one more on the patch up is that we can go directly
from AUTH to RUN without going through ASSOC first.
In addition there are further functions relying only on these 9 base
state change functions in order to implement the remaining possible
state transitions net80211 can do (without CSA and SLEEP).

Another change is that we no longer take a sta always through INIT/SCAN
first and then back up to AUTH, that is, we are no longer deleting the
sta from the firmware unless net80211 would also take us down to that
state and in a follow-up back up.

This is a preparation for another fix to come in order to import a
newer version of iwlwifi (v6.19).

I have run a few days of mlme_assoc (see tools) and some other basic
regression tests.  The only thing I managed was to deadlock net80211
for other reasons (ieee80211_waitfor_parent()).  But this will need
excessive user testing as the various options which may have an
effect on the subtle details are great as we learnt in the past years.

Sponsored by:   The FreeBSD Foundation
MFC after:      5 days
48f55a49a1d142c616edbc7ee6745dd6b83393e4 Bjoern A. Zeeb 2026-02-25 00:13:22

LinuxKPI: 802.11: move linuxkpi_ieee80211_handle_wake_tx_queue()

No functional changes.  Just moved the function within the file.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
3d3303b756ad4ee3ae520f6d07df6978d049a871 Bjoern A. Zeeb 2026-03-04 08:11:03

LinuxKPI: 802.11: improve prep_tx_info

Over time struct ieee80211_prep_tx_info has grown further fields.
One which is becoming mandatory is the subtype (of the mgmt frame).
iwlwifi(mld) has a WARN for it if it does not match, so we now have
to set this for proper operation.  In addition we are tyring to improve
the situation of setting/unsetting (prepare_tx/complete_tx) in various
states and cleanup the use of other fields but link_id which we now
leave as a marker for the future everywhere.
The general problem we are facing is that our hook surface in this case
is the state machine but likely would have to be tx/rx mgmt frames but
we would alos have to driver the TX queues from there which is tricky.
The long-term answer is to change net80211.

Further the hardware flag DEAUTH_NEED_MGD_TX_PREP is dead and was
removed again in favour of leting drivers deal with it.  iwlwifi(mvm)
likely being the only driver which ever used this.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
8f532c7b25d54906c307bfda6cb679632cc26313 Bjoern A. Zeeb 2026-03-02 12:51:55

LinuxKPI: pass attrs in more places in dma-mapping.h

Various macros (dma_map_sg_attrs, dma_unmap_sg_attrs,
dma_map_single_attrs, and dma_unmap_single_attrs) currently supress
passing on the attrs argument.  Their implementation (even though at
times still marked the argument __unused; we remove that) have long
gained support for handling the argument.
With ofed fixed (5edf24aac1d09), pass the argument through so that
other drivers using these functions may hopefully work just a bit
better as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D55391
31c3cba807839a1a16e6f4bca91d530d9342b61a Bjoern A. Zeeb 2026-02-19 23:17:47
LinuxKPi: 802.11: add more defines
Add more defines and a mac80211 op function pointer used by
mt76(4) at Linux v6.19-rc6.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
d4898c6e01d80850e4a93a1aa805c44b5f8ca63f Bjoern A. Zeeb 2026-01-21 13:52:04
LinuxKPI: netdevice: add structs net_device_path, net_device_path_ctx
mt76(4) is using this along with a mac80211.h functiontion pointer to
resolve a path in an offload case.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
275c7f513114a8808ba246a1304cbcf7bafbcc21 Bjoern A. Zeeb 2026-01-21 13:55:28
buf_ring: Rename some variables
The elements we store in buffer rings are buffers, so refer to them as
`buf` throughout instead of a mixture of `buf`, `ret`, and `new`,
especially since the latter breaks C++ code that directly or indirectly
includes this header.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    siderop1_netapp.com, markj
Differential Revision:  https://reviews.freebsd.org/D54827
498fe07257aa75f0f1eb4639f4a6ae39fafda901 Dag-Erling Smørgrav 2026-01-23 11:35:52
mt76: update Mediatek's mt76 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Notable change: license got switched from ISC to BSD-3-Clause-Clear.
util.h is now imported from upstream given it is no longer GPL-only.
See the upstream repository 909675fd4344f73aad5f75f123bd271ada2ab9fb
and a96fed2825d8dfb068bf640419c619b5f2df4218.

For us the new version should also help with page pools and DMA32.

Sponsored by:   The FreeBSD Foundation
b1bebaaba9b9c0ddfe503c43ca8e9e3917ee2c57 Bjoern A. Zeeb 2026-01-23 13:52:47
netinet6: store ND context directly in struct in6_ifextra
Stop using struct nd_ifinfo for that, because it is an API struct for
SIOCGIFINFO_IN6.  The functional changes are isolated to the protocol
attach and detach: in6_ifarrival(), nd6_ifattach(), in6_ifdeparture(),
nd6_ifdetach(), as well as to the nd6_ioctl(), nd6_ra_input(),
nd6_slowtimo() and in6_ifmtu().

The dad_failures member was just renamed to match the rest.  The M_IP6NDP
malloc(9) type declaration moved to files that actually use it.

The rest of the changes are mechanical substitution of double pointer
dereference via ND_IFINFO() to a single pointer dereference.  This was
achieved with a sed(1) script:

s/ND_IFINFO\(([a-z0-9>_.-]+)\)->(flags|linkmtu|basereachable|reachable|retrans|chlim)/\1->if_inet6->nd_\2/g
s/nd_chlim/nd_curhoplimit/g

Reviewed by:            tuexen, madpilot
Differential Revision:  https://reviews.freebsd.org/D54725
576ee62dd2e5e0454a5316eb9207f4ebaa543171 Gleb Smirnoff 2026-01-23 22:17:40
linuxkpi: Implement <linux/seq_buf.h>
It is a wrapper above a `char *` to track the overall available space in
the buffer as well as the used space. This wrapper does not manage
memory allocation.

The DRM generic code started to use this in Linux 6.10.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54488
710167623d82664ab4276776aed502ab6f91d8ff Jean-Sébastien Pédron 2025-08-11 17:51:59
Commit group #61: LinuxKPI
LinuxKPI: PTP add (*settime64) to struct ptp_clock_info

While iwlwifi supportes PTP, LinuxKPI does not and we only add the
definitons to avoid mangling upstream drivers.
iwlwifi(4) does not even support the (*settime64) callback but only
returns -EOPNOTSUPP.

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D54802
bf4aa758dd79dcb3f5d5abde79d679d17b18afa0 Bjoern A. Zeeb 2026-01-20 18:58:22

LinuxKPI: implement dmam_free_coherent()

dmam_free_coherent() is used by an updated mt76 driver at v6.19-rc6.
We need to surgically find the devres information and destroy it before
calling dma_free_coherent.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D54810
0a575891211eff545bab1e4de5e2b7adf4a4c1da Bjoern A. Zeeb 2026-01-21 13:57:55

LinuxKPI: add umin()

Add a version of umin() simply using MIN() assuming that the Linux
upstream code properly check that the arguments are unsigned, etc.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D54807
44d1153ddaf8f961520a8f33222b65170196b90e Bjoern A. Zeeb 2026-01-20 22:43:19

LinuxKPI: improve hweight<n> if complie time constant

rtw89(4) uses a static_assert() with hweight<n> calls.  In order to
avoid compile time errors, deal with the case when the arguments to
hweight<n> are complie time constant.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D54806
7e4a2b381dcb5b2bcaf528e010096fd2d14868b1 Bjoern A. Zeeb 2026-01-20 22:41:12
freebsd32_rusage_out(): bzero the compat32 structure
There is some padding on non-x86.  Unconditionally bzero the memory to
avoid a leak.

Noted by:       markj
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
6af3cf27ed0072f2dcb17380ab63228f9aa28708 Konstantin Belousov 2026-01-21 14:14:10
kern/kern_fork/exit.c: organize includes
Remove sys/cdefs.h.
Remove sys/param.h.
Order the sys/*.h includes alphabetically.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
472c32a83b273b3f15f18bca36ee8a90bb8dad8d Konstantin Belousov 2026-01-08 00:26:54
kern/kern_fork.c: define the exterror category for fork
Convert EINVALs in kern_fork.c into EXTERRORs.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
7211cd2cce746972af2d60d4b5bf0c087f016731 Konstantin Belousov 2026-01-08 00:31:22
sys: add AUE_PDRFORK
Reviewed by:  asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
d0d4b9b9df2ade9085b6318e3fdbc9b67b3f666c Konstantin Belousov 2026-01-08 01:07:52
sys: add pdrfork(2)
Reviewed by:  asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
5c2ee618d5ec21f110c4da40e9f17833b2ab8b76 Konstantin Belousov 2026-01-08 00:32:11
Commit group #62: kern/kern_exit.c
kern/kern_exit.c: define the exterror category for exit/wait

Convert EINVALs in kern_exit.c into EXTERRORs.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
109b9f48ec4e26e12ab5765747f3d5156aa62406 Konstantin Belousov 2026-01-08 04:03:51

kern/kern_exit.c: extract some helpers from proc_to_reap()

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
2b67cfa39d8367a021d165681a1e7f54c6020470 Konstantin Belousov 2026-01-08 04:19:04

kern/kern_exit.c: extract wait6_check_alive() helper

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
7fe33d58a82680fcb75de7deea5a071998830b35 Konstantin Belousov 2026-01-08 04:50:03
audit: handle AUE_PDWAIT
Reviewed by:  asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
a560abedfb4f9626d5193c235822fbf7b1e7b390 Konstantin Belousov 2026-01-08 07:57:12
sys: Add cap_pdwait_rights
Suggested by: asomers
Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
aa72df78d799b06552dc3d4d8926e0199ae4faba Konstantin Belousov 2026-01-09 04:23:51
procdesc: postpone freeing the zombie' pid until procdesc is freed
Requested by: asomers
Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
09984871d8caff9263b955a94bb9fb5354af1b4c Konstantin Belousov 2026-01-15 05:28:31
Add pdwait(2)
Reviewed by:  asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
4d707825bf62ee73a32b615846eff9c4a9bda538 Konstantin Belousov 2026-01-08 03:37:42
Regen syscall tables after pdfork(2) and pdwait(2) additions
e878df0d3b1ecb409c21c808f7c3d623277353af Konstantin Belousov 2026-01-08 03:50:26
eventfd: Add refcounting
An eventfd file descriptor can be used by drivers such as DRM drivers
through linuxkpi. A driver can hold a reference to such a file
regardless of the fact it is used by userland or not.

This patch introduces a refcount in `struct eventfd`, plus the
`eventfd_get()` and `eventfd_put()` functions to acquire and release
references. These functions will be used by DRM drivers for instance.

This structure is internal to `sys/kern/sys_eventfd.c` and not used
anywhere else. Thus it is safe to add a field without breaking anything.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50849
5931649751847cc3ca54255bb767424dcb8a3e97 Jean-Sébastien Pédron 2025-05-26 17:18:24
eventfd: Add eventfd_signal()
The `eventfd_signal()` function is the equivalent to a write to an
eventfd file descriptor: it bumps the internal counter and wakes up
processes waiting for it.

`eventfd_signal()` is meant to be used by kernel drivers. DRM drivers
will call it through linuxkpi.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50850
28d6ffe37cf928c5b13e0aa34c39c4414a0f09e4 Jean-Sébastien Pédron 2025-05-26 17:36:49
linuxkpi: Add eventfd_*()
Add <linux/eventfd.h> and expose the `eventfd_*()` API. This is used by
DRM drivers for some time, but the code was commented out so far.

Note that Linux uses `struct eventfd_ctx`, but FreeBSD defines `struct
eventfd`. We define `eventfd_ctx` as a synonym to `eventfd`.

Reviewed by:    christos, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50853
a200c8e51cdb4586ad2eb20d2b45ba367f00beaf Jean-Sébastien Pédron 2025-05-26 18:12:40
Bump __FreeBSD_version to 1600011 after changes to eventfd
This covers the commits that updated the API and the commit that exposes
that API in linuxkpi for DRM drivers.

Sponsored by:   The FreeBSD Foundation
d185e9fae91a48041363e36a6ee4a2a9c567fc16 Jean-Sébastien Pédron 2026-01-24 19:46:12
sys/module.h: allow MODULE_DEPEND to accept macros
Allow MODULE_DEPEND to accept macros by adding an extra level of
indirection. Some drivers in the tree actually depend on this being the
case.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54874
6ecaa8dfb64b796085afdf597ec3a79878bde12f Ahmad Khalifa 2026-01-26 09:27:59
Commit group #63: devstat: Provide 32-bit compatibility
devstat: Provide 32-bit compatibility

If a 32-bit process running on a 64-bit kernel requests kern.devstat.all,
translate each struct devstat to its 32-bit equivalent before copying it
out.

Also fix a bug where an early error would be ignored if there were no
devices to report.

MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54591
a11d132f6c62f32abe44b19f7527d97ddc239058 Dag-Erling Smørgrav 2026-01-26 12:01:39

freebsd32: Fix includes

The previous commit added <sys/cdefs.h>, which isn't actually needed.
Conversely, <sys/event.h> is needed (and has been for a long time) but
was not included.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=a11d132f6c62 ("devstat: Provide 32-bit compatibility")
Reported by:    gallatin@
0eb2c9d39b5f5cfb68b404bca358aa5fb11ac60c Dag-Erling Smørgrav 2026-01-26 16:24:54
witness: Provide facility to print detailed lock tree
When witness(4) detects lock order reversals (LORs), it prints
information about the stack trace which caused the LOR. If available,
it can also print information about the first stack trace which
established the other lock ordering. However, it only does this for
"simple" LORs where the two locks in question were directly locked
in the opposite order. When the lock order was established through
a more complex pattern of intermediate locks, WITNESS only prints
the stack trace where it detected the LOR.

This commit provides new functionality to provide more verbose
information about the lock chain(s) which established the lock
ordering. The new functionality can be disabled by setting the
debug.witness.trace sysctl/tunable to 1. The new functionality
is also available through the debug.witness.badstacks sysctl,
which has been modified to always show the more verbose
information.

Reviewed by:    markj, glebius (previous version), kib (previous version)
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D54785
MFC after:      1 month
fb4b0c91195195561560bb2fb2c1ba8da81f7ccf Jonathan T. Looney 2026-01-17 01:20:26
witness: mark relationships defined in order_lists[]
Mark the lock relationships defined in order_lists[] and use that
information to print better messages when a LOR violates one of these
relationships.

Suggested by:   markj
Reviewed by:    kib, markj
MFC after:      1 month
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D54903
37d86e9487754b8541cd4418a4c42999bbb2761f Jonathan T. Looney 2026-01-27 02:11:10
linuxkpi: Add tag support to radix tree
The tag is used to perform lookup in a different way.

New functions were introduced:
* to set, check and clear a tag
* to walk through a radix tree based on a given tag

Furthermore, the `radix_tree_delete()` function was modified to clear
tags on deletion.

The amdgpu DRM driver started to use this in Linux 6.10.

While here, the `radix_tree_gang_lookup()` function was added because it
is very close to `radix_tree_gang_lookup_tag()`, but it is not used by
the DRM drivers as of this commit.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54503
79b05e7f80eb482287c700f10da9084824199a05 Jean-Sébastien Pédron 2025-09-07 20:53:09
LinuxKPI: 802.11: only announce netdev_features if any are set
Printing an empty netdev_features= line makes little sense even under
bootverbose.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
5cfe09e3a442347fe408fa95126dfbc051d064c3 Bjoern A. Zeeb 2026-01-29 11:17:25
maybe_preempt(): make static in sched_4bsd.c
Reviewed by:  olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
57bb132e98b0736d15881eb80aba6c2c5dd8ac28 Konstantin Belousov 2026-01-22 05:22:15
sys/sched.h: make sched_clear_tdname() function prototypes unconditional
There is no harm in having unused prototypes.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
8515934ce3c290765df9254003f3c6d79da7e538 Konstantin Belousov 2026-01-22 04:00:59
sched_4bsd: remove unused function sched_pctcpu_delta()
It is not used since c72188d85a793c7610208beafb83af544de6e3b7.

Noted by:       jrtc27
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
610d7062c60b0f1f7c193e01c5238088b2b56c96 Konstantin Belousov 2026-01-24 01:43:25
kern/sched_{ule,4bsd}.c: cleanup headers
Reviewed by:  olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
a556ec46d313f2ed8facd46280d35875e6e50ebe Konstantin Belousov 2026-01-22 04:20:05
sys/sched.h: add SCHED_STAT_DECLARE()
Tested by:    pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
0b474a48dc5866d94988ed3af24019d7074f5e5b Konstantin Belousov 2026-01-24 06:00:50
Add kern/sched_shim.c
This is the infrastructure to allow scheduler implementation to be
selected on boot, supported by ifuncs.

The DEFINE_SHIM() macros and their usage provided by jrtc27@.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
ce38acee8d0bb35223b227479b9998c77b47f41b Konstantin Belousov 2026-01-22 04:19:52
kern/sched_shim.c: Provide a scheduler selection machinery
Reviewed by:  olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
bab24f22ba4518e640d14765dbd196e7709e1f0e Konstantin Belousov 2026-01-22 05:09:57
kern/sched_shim.c: provide required SYSINIT hooks
Reviewed by:  olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
7efbfd6ff6490fa6b7144cc341eaf282a21fab32 Konstantin Belousov 2026-01-22 13:59:32
Commit group #64: sys
sys: Make sched_ule a sched instance

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
d14e018024bb094705dd218ceeeea124706f6ec0 Konstantin Belousov 2026-01-22 04:36:15

sys: Move ULE sysctls under kern.sched.ule

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
eb454937a3c04e5d1bde4f58d0ebb2dc48472ced Konstantin Belousov 2026-01-22 05:41:21

sys: Make sched_4bsd a sched instance

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
b125c4d13095b3f26d105a985099dfe1cc3ac0b3 Konstantin Belousov 2026-01-22 05:22:58

sys: Move 4BSD sysctls under kern.sched.4bsd

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
8aa8289d991bc369b6739ce4c4bcd7d5234f48a2 Konstantin Belousov 2026-01-22 05:46:25
kern/sched_shim.c: Add sysctl kern.sched.available
Reports all compiled-in schedulers.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
ba8f429f42ecae1881d0face52df87ad1489af15 Konstantin Belousov 2026-01-22 05:57:49
x86/local_apic.c: remove direct SCHED_ULE use
Move the code to decide on the timer accounting into the scheduler hook.
Since there were no inclusion of opt_sched.h, it is probably done
unconditionally anyway.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
c384b35e42ee5712dda6360ffa287c0350055580 Konstantin Belousov 2026-01-22 13:24:37
net/iflib.c: move out scheduler-depended code into the hook
Add sched_find_l2_neighbor().  This really should be not
scheduler-depended, in does not have anything to do with scheduler at
all.  But for now keep the same code structure.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
b602ba1b5fd92bb226e32f5720885f856a5cb0bb Konstantin Belousov 2026-01-22 13:38:20
sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized
Reviewed by:  olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
5a6e0e31bc2e8ed8f655be63fa5b8c41f3d60753 Konstantin Belousov 2026-01-23 15:09:56
sched_shim: restore kern.ccpu sysctl
It is apparently should be considered part of the ABI, and is used by
the base top(1).  But do not declare the ccpu variable in headers, it is
needed only by 4bsd. So put the variable definition into sched_shim.c to
make the kernel buildable without SCHED_4BSD.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
ff870b783f098cafd8b938379eada6b8cfe9a4fb Konstantin Belousov 2026-01-23 15:15:43
sys: enable both SCHED_ULE and SCHED_4BSD for some configs
Globally enable both schedulers for LINT.
Enable both schedulers for GENERIC on amd64.

Reviewed by:    olce
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
1322760fd1274930cbb61048d9a6ba3bc1782b2a Konstantin Belousov 2026-01-23 16:15:09
Commit group #65: kern/sched
kern/sched: move duplicate preemption stat vars into sched_shim.c

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
a84a39dfe5d1fd98afdf29a74017fce29441b730 Konstantin Belousov 2026-01-24 06:01:48

kern/sched: deduplicate sdt probes

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
9409e86980302cd495376861de3475b78734bc37 Konstantin Belousov 2026-01-24 06:16:42

kern/sched: deduplicate dtrace hook vars

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
783b8a0fd880255a8315db7f59d0450bd7276f4d Konstantin Belousov 2026-01-24 06:22:01
lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panics
I have hit the case multiple times that some LinuxKPI field may not be
set during driver bringup and lindebugfs would cause a panic.
The backtrace goes like:

  strlen() at strlen+0x54
  pfs_create_dir() at pfs_create_dir+0x41
  debugfs_create_dir() at debugfs_create_dir+0xa1
  ...

While the problem is clearly in LinuxKPI or the driver, we likely
should at least add an assert to pfs_create_dir() if name is NULL
like we have for pfs_add_node() but for lindebugfs at least make
this a graceful error and continue without creating the dir instead
of panicing.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    kevans
Differential Revision: https://reviews.freebsd.org/D54944
4b32fdb4a614de602d288ac5a414cb43e9f2163e Bjoern A. Zeeb 2026-01-29 11:16:50
SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread
maybe_resched() needs to schedule TDA_SCHED for curthread, but this
requires taking curthread lock while owning some other thread lock.
To avoid introducing the order:
- Use a scheduler-private TDP flag.
- Register an unconditional TDA_SCHED_PRIV for 4BSD.
When an AST needs to be scheduled, i.e. the current thread must do
context switch in the return to userspace path, set the flag.
Then the ast handler calls ast_scheduler(), which gives the same
effect as scheduling TDA_AST.

The overhead is a single function call on each userspace return, for
4BSD case.

Reported and tested by: pho (previous version)
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54945
b249cb2b18b3fddae186d45fe6d984fc7bde10c4 Konstantin Belousov 2026-01-29 08:09:00
firmware: Fix inverted FIRMWARE_GET_NOWARN logic
The try_binary_file() function has inverted logic for the
FIRMWARE_GET_NOWARN flag.  When the flag is set (meaning "don't warn"),
the code sets warn=true and makes noise anyway.

Invert the assignment to warn to correctly suppress warnings when
FIRMWARE_GET_NOWARN is set.

Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D54955
fdcd67be8274d237ae2c87d6475d9d34b440b8d8 Abdelkader Boudih 2026-01-30 00:02:47
ktrcsw(): should not be called when the thread is owning interlock or on sleepq
The issue is that for ktrcsw() we lock the ktrace_mtx mutex while owning
the interlock from a subsystem that called msleep().  In particular, the
VM subsystem might call msleep() if page allocation failed.  This
establishes order VM locks (e.g. domain free queue lock) -> ktrace_mtx.
Calling free() while owning ktrace_mtx gives the reverse order.

Worse, msleep_spin_sbt() call s ktrcsw() while the thread is put on
sleep queue.  Then, since the mutex might be contested, the thread needs
to be put on turnstil, which cannot work.

Move the ktrcsw() call for switch-out after the wakeup, when the thread
does not yet re-obtained any locks.  From there, we call a special
version of ktrcsw(), which is passed the actual time when the context
switch occured.

The drawback is that the switch-out record is only written in the
ktrace.out file after the switch-in occurred, but this is probably not
too serious.

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54831
245157fd8a382c3989075789ee98582665f3b31d Konstantin Belousov 2026-01-22 21:46:01
riscv: Enable the zifencei extension explicitly in -march
clang is more tolerant and implies this extension whereas GCC is
stricter and requires it to be included.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D54965
31b259049e2b932ae6527d1dc850c2bec58e94e0 John Baldwin 2026-01-31 17:10:56
libkern: Add libcalls for ffs and __ffsdi2
These are needed when compiling a RISC-V kernel with GCC which does
not inline __builtin_ffs*.

The __ffsdi2 is adapated from the previous ffsl.c.

This partially reverts commit f4db342d44198973c1c7b9005d0c5683a582707e.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D54967
4c822dd4a15c533c08271b2286da949fffafc89e John Baldwin 2026-01-31 17:20:50
riscv: Add ffs.c and ffsdi2.c
These are only needed for GCC, but it doesn't hurt to include these
always.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D54968
f4c40a5acb16e542934ed17ee475183b87420eae John Baldwin 2026-01-31 17:21:11
sctp: fix socket type created by sctp_peeloff()
When calling sctp_peeloff() on a SOCK_SEQPACKET socket, the created
and returned socket has the type SOCK_STREAM.
This is specified in section 9.2 of RFC 6458.

Reported by:    Xin Long
MFC after:      3 days
d195b3783fa4de5c1a95f6d95eb9444abce6778b Michael Tuexen 2026-01-31 18:11:08
arm: Implement kernel ifunc
Add kernel ifunc support on arm.

MFC after :     3 weeks
Reviewed by:    kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D54970
d78cbf483fe73c987573967042f57f15bf590629 Michal Meloun 2026-01-24 10:41:10
sdt: Use the "cc" operand modifier for the address of probes for GCC 15+
This is required for GCC on RISC-V.  The GCC 15 docs claim that "cc" is
similar to "c" except that it "tries harder".

NB: I have not yet found a way to make the DTrace probes compile on
RISC-V with older versions of GCC.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54964
f7144a9c4a11214a71a3091ce1b232a8243b83ea John Baldwin 2026-02-02 17:19:51
Re-introduce kern.sched.topology_spec
Move it back from kern.sched.ule.topology_spec.
Make it scheduler-agnostic.
Provide trivial report for UP kernels.

Apparently the MIB is used by some third-party software.  Obviously it
did not worked on UP or 4BSD configs.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292574
Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55062
120ca8d74b46caa260702485e30fe5f9f9984682 Konstantin Belousov 2026-02-02 20:22:46
unmount(2): do not allow MNT_DEFERRED or MNT_RECURSE flags from userspace
Repprted and tested by:       pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
cd8d44173adc375b59a24b1363476c086a7c86b4 Konstantin Belousov 2026-02-02 22:38:32
vm_phys: Check `RB_FIND()` return value in case it is NULL
When trying to unregister a fictitious range in
`vm_phys_fictitious_unreg_range()`, the function checks the properties
of the looked up segment, but it does not check if a segment was found
in the first place.

This can happen with the amdgpu DRM driver which could call
`vm_phys_fictitious_unreg_range()` without a fictitious range registered
if the initialisation of the driver failed (for example because
firmwares are unavailable).

The code in the DRM driver was improved to avoid that, but
`vm_phys_fictitious_unreg_range()` should still check the return value
of `RB_FIND()` before trying to dereference the segment pointer and
panic with a page fault.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55076
465ba08bb53796b24dceca0d2ccde5a0e2630a2b Jean-Sébastien Pédron 2026-02-03 12:04:58
Commit group #66: sockets: let protocols be responsible for socket buffer mutexes
sockets: let protocols be responsible for socket buffer mutexes

Sockets that implement their own socket buffers (marked with PR_SOCKBUF)
are now also responsible for initialization of socket buffer mutexes in
pr_attach and for destruction in pr_detach (or pr_close).

This removes a big bunch of reported LORs, as now WITNESS is able to see
that tcp(4) socket buffer mutex and netlink(4) socket buffer mutex are two
different things.  Distinct names also improve diagnostics for blocked
threads.

This also removes a hack from unix(4), where we used to mtx_destroy().
Also removes an innocent bug from unix(4) where for accept(2)-ed socket
soreserve() was called twice.  This one was innocent since first call to
soreserve() was asking for 0 bytes of space.

This slightly increased amount of pasted code in TCP's syncache_socket().
The problem is that while for sockets created with socket(2) it is
pr_attach responsible for call to soreserve() (including !PR_SOCKBUF
protocols), but for the sockets created with accept(2) it was
solisten_clone() doing soreserve(), combined with the fact that for
accept(2) TCP completely bypasses pr_attach. This all should improve once
TCP has its own socket buffers.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D54984
64f7e3c9c178ab35cb1f8fdf791aec74ede6f6b2 Gleb Smirnoff 2026-02-03 17:09:49

sockets: repair sctp_peeloff(2)

The shim function soattach() may be passed a non-listening socket by SCTP.

NB: the change makes soattach() more hairy, but long term plan is that
this function goes away.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293010
Fixes:  https://cgit.freebsd.org/src/commit/?id=64f7e3c9c178ab35cb1f8fdf791aec74ede6f6b2
f5923578eb67c6363e4575c107d3be3180ac9371 Gleb Smirnoff 2026-02-06 18:51:38
Commit group #67: sysctl(9): Booleans: Accept integers to ease knob conversion
sysctl(9): Booleans: Accept integers to ease knob conversion

In sysctl_handle_bool(), if the output buffer (for the old value) has
room for exactly 4 bytes (sizeof(int)), then output the current boolean
value as an integer rather than a 'uint8_t'.  Conversely, if 4 bytes
exactly remain in the input buffer (for the new value), treat them as an
integer and derive the new boolean value from it.

Doing so allows to convert existing integer syscstl knobs that are
interpreted as a boolean into true boolean ones while staying
backwards-compatible.

That brings no drawback as no code currently uses sysctl_handle_bool()
as part of a series of calls to sysctl_handle_*() functions for
(de)serialization of some compound structure.  If that case ever
materializes, it can be easily solved, e.g., by creating
a sysctl_handle_bool_strict() variant.

In the future, we might want to go further and generally be more liberal
in the external type of integers we accept and output, by tolerating any
kind of supported integers (8-bit to 64-bit), enabling integer type
changes of knob's internal representations without breaking the ABI for
consumers hardcoding the passed integers (instead of relying on sysctl
knob type information).

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54925
406da392ef8d77b39fe9bfd36bdb440eb3e5ae0a Olivier Certner 2026-01-27 09:45:03

sysctl(9): Booleans: Fix old value length discovery

When calling sysctl(3) with a null 'oldp', i.e., length discovery mode,
'oldix' can be equal to 'oldlen', and we should not fail.

More generally, let SYSCTL_OUT() and SYSCTL_IN() handle corner cases,
simply removing the comparisons between 'oldidx' and 'oldlen' and
'newidx' and 'newlen' done by hand as the test just after is an equality
that does not require to know if 'idx' is smaller than 'len'.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292917
Reported by:    cy
Fixes:          https://cgit.freebsd.org/src/commit/?id=406da392ef8d ("sysctl(9): Booleans: Accept integers to ease knob conversion")
Sponsored by:   The FreeBSD Foundation
895e1c6567d9561c86f8d20b47e924911bce989e Olivier Certner 2026-02-03 22:25:46
LinuxKPI: add str_read_write()
Needed by a wireless driver.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    kib, emaste
Differential Revision: https://reviews.freebsd.org/D55029
6ea242cc305b7ec5b44488c9f04d413ebbf0b731 Bjoern A. Zeeb 2026-01-31 23:16:06
LinuxKPI: string_choices.h: use ternary operator
Switch from using if () else to a direct return (?:) code.
No functional changes.

Suggested by:   kib (D55029)
Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste (before removing more () as suggested by him)
Differential Revision: https://reviews.freebsd.org/D55088
8df7af9c9ecf7fc0b1c664f3d95893a9fcc16fcd Bjoern A. Zeeb 2026-02-03 18:50:00
sys/power.h: enum power_sstate_transition
Turn POWER_SLEEP_STATE_* defines into enum power_sstate_transition.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52497
d35e369d0a7f37c580b89485a148d007faf05b52 Aymeric Wibo 2026-02-05 14:55:17
riscv: implement kernel ifunc resolution
This completes the set of architectures implementing this feature.

Move the calls to sched_instance_select() and link_elf_ireloc() later in
initriscv(), after identify_cpu(0). There will be more information
available to any resolver functions at this time.

Reviewed by:    imp, kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55082
cf41d1113377c44be5aad20c2f7ff2c5324ca89f Mitchell Horne 2026-02-05 16:11:25
sched_shim: Drop the no-ifunc case
Now all architectures support kernel ifunc resolvers. Therefore, the
alternate implementation can be removed.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55114
0d3652f67d246348e2c017205c6782caf4484449 Mitchell Horne 2026-02-05 16:12:03
sys/subr_module: remove useless macro gates
These constants are always defined by sys/sys/linker.h.

Reviewed by: vexeduxr
Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by: Defenso
MFC after: 2 weeks
Closes: https://github.com/freebsd/freebsd-src/pull/2004
912418193ed1f9a0f58b083037751b1fbc4c30ef Quentin Thébault 2026-02-05 14:57:11
sys/conf/options: remove improper full stops
Only keep them when used in a sentence.

Reviewed by: vexeduxr
Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by: Defenso
Closes: https://github.com/freebsd/freebsd-src/pull/2004
87b2c0168d9deb79aacf3f13dbd3201054371b2b Quentin Thébault 2026-02-06 06:03:21
STACKALIGN: Reimplement in terms of __align_down
This changes STACKALIGN to be type-preserving when operating on
pointers.

Reviewed by:    brooks, kib
Effort:         CHERI upstreaming
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54920
e9a697bf20ccbb2a19f6ad01fa3e0c14e0390847 John Baldwin 2026-02-06 15:30:50
linux_file.c: Fix handling of NFS getdents() emulation
Bugzilla PR#292282 reports a problem, where a Linux
binary running in the Linuxulator gets bogus entries
in a readdir()/getdents() reply when the directory is
an NFS mount.

This appears to be caused by the NFS client including
entries with d_fileno == 0, which are always ignored by
BSD, but are not ignored by Linux.

This patch filters out the "d_fileno == 0" entries and
the reporter of the bugzilla PR notes that it fixes the
problem for him.

It could be argued that the NFS client should filter out
the "d_fileno == 0" entries, but the NFS client readdir
code is "fragile" and any change to it runs a significant
risk of causing regression type problems.

As such, since the LInuxulator is already broken for this
case, it seems safer to filter them out there.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292282
Tested by:      Jerry Williams <jwillia3@proton.me>
Reviewed by:    markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54679
110f2567cb51f1eeddbd5d9937000ad64f6dc746 Rick Macklem 2026-02-07 22:12:55
vt: Fix handling of backtab
5fec99caff3ac4f476bb88078ebf85fbecf6afb3 Nathaniel Braun 2026-01-17 17:14:42
aw_gpio: Add support for H616
This adds padconf files for the two gpio ranges on the H616 SOC and adds
the SOC include.

Reviewed by:    manu
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54915
e506af08bb52bcf02553a35a385b7ef0b8692589 Tom Jones 2026-02-09 10:06:33
arm64: Assume get_kernel_reg returns true
It now only returns true so this can be assumed and doesn't need to be
checked.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55105
a8c3933840448eaf04ecfe162c0d05caf11090a4 Andrew Turner 2026-02-09 17:24:27
kern/vfs_unmount.c: promote flags to uint64_t
to prevent sign-extension, causing unexpected flags to be passed to
dounmount().  The mnt_flags and MNT_* constants are 64bit wide.

Suggested and reviewed by:      jah
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55197
8066b8923ebfd438dc8cb840d2f57066f4daa45d Konstantin Belousov 2026-02-09 03:11:15
Commit group #68: sys/abi_compat.h
sys/abi_compat.h: normalize include guard name

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
c3a04a9585ae233c98ee2eef73e6a80d17512578 Konstantin Belousov 2026-02-05 19:06:16

sys/abi_compat.h: move freebsd32_uint64_t and FU64_CP() there

Use private names for uintXX_t types.
Remove conflicting (but equal) PTR_IN() definition from dev/mfi.c.

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
e651c64bcab08c7b12d8ad6e3ad0b1ef3af3b875 Konstantin Belousov 2026-02-05 19:08:06

sys/abi_compat.h: add Foundation copyright for uint64_t stuff

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
9ce0c190d8b3570c0a537f84952dca8c6e462ec3 Konstantin Belousov 2026-02-05 19:10:00
sys/event.h: use freebsd32_uint64_t for kevent32 64bit members
Reviewed by:  brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
ad639400dc9f1c5aec470996473bb54edc113dba Konstantin Belousov 2026-02-05 19:22:44
Commit group #69: sys/compat/freebsd32
sys/compat/freebsd32: use freebsd32_uint64_t for struct kinfo_knote32

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
485e916a67b4e700de5f50873e1e7b64de394b16 Konstantin Belousov 2026-02-05 19:29:46

sys/compat/freebsd32: use freebsd32_uint64_t for struct ffclock_estimate32

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
3dc72107d29d304ba21f04426ec82077d23cedcd Konstantin Belousov 2026-02-05 19:35:01

sys/compat/freebsd32: use freebsd32_uint64_t for several struct stat's

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
beee89472e3e0e3640c9db5c34a6e422830ff00f Konstantin Belousov 2026-02-05 19:39:27

sys/compat/freebsd32: ki_pd is missing from struct kinfo_proc32

This is missed by the sizeof(struct kinfo_proc32) assert due to another
bug: namely, the use of uint64_t type that has different alignment on
i386 than on amd64 host.

Fixes:  https://cgit.freebsd.org/src/commit/?id=85078b8573332c2c83a79adea8a61b519fb3b6af
Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
154778e3585166f613fd3d2978a0cab2262d1611 Konstantin Belousov 2026-02-05 20:02:27

sys/compat/freebsd32: use freebsd32_uint64_t for struct kinfo_proc32

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
31fab773613b21183fbd5a313fa8c69d37fcb196 Konstantin Belousov 2026-02-05 19:40:55
openzfs sys/types32.h: use abi_compat.h for time32_t
The time32_t typedef leaks into openzfs compilation environment
through sys/event.h.  Simultaneously, openzfs provides its own
definition that is only correct for amd64 on FreeBSD.

Try to fix it by using sys/abi_compat.h directly.  Since toolchain build
from the make buildworld uses host abi_compat.h, add a preprocessor
symbol __HAVE_TIME32_T to signal consumers that time32_t is typedef'ed.
If not defined, fall back to old and wrong time32_t, which is enough for
bootstraping toolchain.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
87632ddf67b01f3d4787d10332afc1eeece52e2d Konstantin Belousov 2026-02-06 23:47:13
sys/user.h: remove XXXSKE markers
Reviewed by:  brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55135
ec6cf0c52698f9056cb17456717849653a03f7e4 Konstantin Belousov 2026-02-05 20:19:24
sys/event.h: reduce namespace pollution from sys/abi_compat.h
Split out types definitions into sys/abi_types.h, and only include
abi_types.h into sys/event.h.

Tested and reviewed by: bz
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55202
ecadac729a1b855fe0d77a682ee424c3da1eb3db Konstantin Belousov 2026-02-09 20:13:21
tcp: restrict flowtype copying to specific RSS TCP types
Reviewed by:  gallatin, tuexen
Differential Revision:  https://reviews.freebsd.org/D55196
a485399f88348efbe52aad2fa9b14af8b9ae55c7 Cheng Cui 2026-02-09 22:39:50
asan: Use memset_early() to fill shadow memory
__builtin_memset() calls are replaced with calls to memset(), but that
can't be used before ifunc relocations are processed if the
implementation is selected at boot time.  Meanwhile, the sanitizer may
emit calls to __asan_set_shadow_*() as soon as locore jumps into C code,
before ifuncs are selected.

Just unconditionally use memset_early() to work around this.

Reported by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55079
4c23a98ba3af3a00004fd7ef54e6330b4d665d55 Mark Johnston 2026-02-10 13:53:52
kernel dump: dumpsys_gen_pa_next(): Fix "no more chunks" condition detection
In the (improbable) cases where either:
- All entries in dump_map[] are used, so there is no guard entry filled with zeros.
- Some dump region has size 0.
We would respectively access dump_map[] out-of-bounds or omit further
dump regions when iterating.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
7e5f4bb3a1c999d1893528faa75559f37365de47 Olivier Certner 2026-02-04 13:04:20
brcm80211: add LinuxKPI files and module Makefiles
sys/compat/linuxkpi/common/include/linux/platform_data/brcmfmac.h
is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

Currently only PCIe is made to compile.
It does load firmware (if needed, e.g., on arm64 with an alignment
issue fixed), and starts to come up.

To make it work there is a cfg80211 layer and netdevice integration
to do, so do not hold your breath just yet.
902136e0fe112383ec64d2ef43a446063b5e6417 Bjoern A. Zeeb 2026-02-10 21:33:09
LinuxKPI: 802.11: add cfg80211 (*change_bss) and related structs
Needed by brcmfmac v6.19.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b02def7c4a10fa3e2b05ebec379c5c634b87484d Bjoern A. Zeeb 2026-02-11 00:44:36
rpc: Improve socket locking in svc_vc_accept()
so_state modifications must be synchronized by the socket lock.  For the
listening socket this probably doesn't matter but for the child socket I
think it's possible that this unlocked update clobbers a state
transition if the nascent connection is being disconnected for some
reason.

Also fix the line which potentially clears SS_NBIO in the listening
socket.

It is unclear whether this code is used at all.

Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55247
7c1c0e94363db09af0c260d9292160cdd2230f23 Mark Johnston 2026-02-12 14:00:43
kmsan: Implement __msan_test_shadow()
This is needed when building OpenZFS with KMSAN enabled, as the bundled
zstd uses it.

MFC after:      1 week
bf149f2e88cb3836e02ddabd9944eb58650a72ae Mark Johnston 2026-02-13 15:42:19
filt_timerexpire_l(): re-insert restarted timer into head instead of tail
of the resumed timers list, so that kqtimer_proc_continue() does not
iterated into the same timer again.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293141
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55264
75a30ea09f4e75480743fae5c2369d50a6d8526c Konstantin Belousov 2026-02-12 20:24:13
kqtimer_proc_continue(): correct calculation of 'now'
It must be sbinuptime(), this is how kc->next is set up.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293141
Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55264
e7f86f8b1383d278fff1d973230972325072ead6 Konstantin Belousov 2026-02-13 15:32:40
elf_common.h: Add some AArch32 relocations
Reviewed by:  mmel
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55268
10ac7413c060b1496ef54e2338f487ea84f66206 Ed Maste 2026-02-12 21:18:32
sys/compat/freebsd32: FF clock struct: Don't pack, use 'ffcounter32'
Packing 'struct ffclock_estimate32', in absence of substitution of
'ffcounter' (some 'uint64_t') by a 32-bit compatible type, was necessary
on amd64 since 'uint64_t' is 8-byte aligned, which leaves a padding gap
of 4-byte between fields 'update_time' and 'update_ffcount'.  This gap
does not exist on i386 (or amd64 32-bit mode), as 'uint64_t' there is
only 4-byte aligned.

Change the type of the 'update_ffcount' and 'leapsec_next' fields to the
recently introduced 'freebsd32_uint64_t', and adapt copy-in and copy-out
accordingly.  Using `CP()` previously worked due to the '__packed__'
attribute.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55282
7c2fc4419db43a8a7d1886b0b8e08aa97bfa31e4 Olivier Certner 2026-02-13 17:03:31
sys/abi_types.h: time32_t is 64-bit on non-x86 architectures
As long as 'sys/compat/freebsd32/freebsd32.h' is used unconditionally on
all platforms (in 'kern_umtx.c' at least), the rule of thumb is to
ensure that 'struct foo32' on a 32-bit arch is type-compatible with
'struct foo' on the same arch.  In practice, this is very simple to
achieve: All 'foo32' types should be compatible with 'foo' on 32-bit
architectures, which is what we are supposed to do already for compat'
structures by design.  The recently introduced 'freebsd32_uint64_t' type
typically supports that.

This change fixes commit 87632ddf67b0 ("openzfs sys/types32.h: use
abi_compat.h for time32_t") which was defining 'time32_t' to 'in32_t'
for all 32-bit architectures, which is wrong but on i386.  By luck, this
did not change the size of whole 'struct ffclock_estimate32' (whose size
is compile-time asserted) because 'struct bintime32''s one would stay
the same, as even if its field 'sec' was incorrectly sized after that
commit, the 'frac' one is 64-bit and 64-bit aligned on all non-x86
architectures so its offset in 'struct bintime32' would stay the same.

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=87632ddf67b0 ("openzfs sys/types32.h: use abi_compat.h for time32_t")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55283
4ccca2100887943b11187787004bc8efc2a149c6 Olivier Certner 2026-02-13 17:20:13
vmm: Allow the use of PCI passthrough in a jail
After commit e11768e94787 ("vmm: Add PRIV_DRIVER checks for passthru
ioctls"), it is not possible to use PCI passthru from jails, as
PRIV_DRIVER is not granted to jails.  Apparently some users expect this
to work, understanding that jailing bhyve provides little security
benefit in this configuration.

I believe we should disable ppt access in jails even when allow.vmm is
configured.  To provide an escape hatch for users, add a new
allow.vmm_ppt jail configuration knob, and check it when handling ppt
ioctls in jails.  Also add a new PRIV_VMM_PPTDEV to replace the use of
PRIV_DRIVER.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292750
Reviewed by:    corvink
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55066
c71354030a26900e564f0c80a8abdff7e77b3c9e Mark Johnston 2026-02-16 14:56:25
pdrfork(2): do require RFPROCDESC | RFPROC
when RFSPAWN is not specified, as stated in the man page.
rfork(2) cannot modify non-curproc, which is why RFPROC is required,
the syscall cannot act on arbitrary process descriptor.
If RFPROCDESC is not specified, the syscall does not make sense,
use rfork(2).

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
b05be03ceea0a95f7783ddc890885f34bb4023d4 Konstantin Belousov 2026-02-14 16:38:23
dtrace: Implement ustackdepth for arm64
MFC after:    2 weeks
Differential Revision:  https://reviews.freebsd.org/D52475
afd64316c869eb00dde4d6b4af61bca0cb2197f1 Mark Johnston 2026-02-17 17:37:42
bus: Document special ranges of IVARs
Some IVAR indices are special in that they have global meaning across
multiple buses where as other IVARs are always private to the local bus.
Try to document this a bit and add constants for the various ranges to
avoid future conflicts.

This is a no-op, but IVAR indices are now generally defined as enums
as that makes it easier to define them in terms of ranges.

Reviewed by:    imp, royger, andrew
Differential Revision:  https://reviews.freebsd.org/D54159
6cf4e30252fe48b230b9d76cac20576d5b3d2ffa John Baldwin 2026-02-17 20:45:13
bus: Change a few bus drivers to use consistent IVAR ranges
A few bus drivers used 1 instead of 0 as the starting index of their
private IVARs.  Fix those drivers to start at BUS_IVARS_PRIVATE for
consistency.

Differential Revision:  https://reviews.freebsd.org/D54934
e3d2108a6e90098010c62638ab9f8bdf974e2c39 John Baldwin 2026-02-17 20:45:25
arm gicv3: Use private IVAR range for GICV3 IVARs
Suggested by: andrew
Differential Revision:  https://reviews.freebsd.org/D54191
dc47d99c5022540477489d2b850b92a537965c0f John Baldwin 2026-02-17 20:45:48
bus: Renumber global IVAR ranges
Use a more consistent scheme for allocating shared IVAR index ranges.

Differential Revision:  https://reviews.freebsd.org/D54161
87984eddde4dca3ded908f70d2699788e9d8d019 John Baldwin 2026-02-17 20:46:06
sdt: Disable SDT probes in kernel modules for GCC on aarch64
For PIC code, the existing assembly constraints do compile on aarch64.
Some kernel modules build ok using the 'p' constraint with the 'a'
operand modifier, but not all.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55166
5a02f004fbacee9b2d59b59b11f8910e5736b89c John Baldwin 2026-02-17 20:48:04
vfs_mount.c: Don't call VFS_MOUNT() if only exports are being updated
PR#293198 reports a hang within ZFS when exports
are being updated concurrently with a VOP_SETEXTATTR().
The hang appears to be caused by mishandling of the
z_teardown_lock, but fixing handling of this lock appears
to be a major effort. Since the hang occurs when
VFS_MOUNT() acquires a write/exclusive z_teardown_lock,
which rarely occurs, except when exports are being updated,
this patch avoids the VFS_MOUNT() call for this case.

Avoiding a VFS_MOUNT() call fixes the hang for the case
reported by PR#293198 and is also an optimization.
As such, this patch avoids the VFS_MOUNT() call when only exports
are being updated similar to what was already being done
within vnet prisons.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293198
Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55318
935cf3284f520c90a63baaadb762caaa30084f5c Rick Macklem 2026-02-17 22:57:42
smp: Use bitwise operation to count cpu number
Previously, we iterated over all CPUs using CPU_FOREACH and checked
individual bits to count valid CPUs. Refactor this to use a bitwise AND
and popcount to count the number of enabled bits directly.

Approved by:    markj (mentor)
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D54474
e387d9438ba0258b88ebe03ef139bc6fd70b5a46 ShengYi Hung 2026-01-03 16:32:50
intrng: Shuffle unhandled interrupts too
When interrupt vectors are first allocated, they get assigned to
CPU #0; at SI_SUB_SMP / SI_ORDER_SECOND (aka once we have multiple
CPUs), the intr_irq_shuffle SYSINIT clears their CPU sets with the
effect of forcing them to be assigned to new CPUs later.

In case where interrupt vectors were allocated *but not yet bound*
this code did not run, with the effect that those interrupts would
remain pinned to CPU #0 forever.  This affected the ena(4) driver,
which allocates interrupts for I/O when the device is attached but
doesn't set them up until the interface is brought up much later in
the boot process (and, crucially, long after intr_irq_shuffle runs).

Adjust intr_irq_shuffle to clear the CPU set for an interrupt source
even if it currently has no handlers, so that it will be properly
assigned to a CPU when it is used later.

Reviewed by:    andrew, mhorne
MFC after:      1 month
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55284
b2ba4131b9b08d6231392c0b798d0ff35809f600 Colin Percival 2026-02-14 00:35:26
kqueue: Make kn_sfflags unsigned
This is used to hold a copy of the original fflags, which is unsigned.

MFC after:      3 days
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D55348
d379432808ed286dc051a34138ae250addbc469c Dag-Erling Smørgrav 2026-02-18 18:28:16
vm_page.h: Materialize a spare bit
No functional change (intended).

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
d18aaeff8fd314e79642062d95110ad174bd1882 Olivier Certner 2026-02-16 12:53:16
sys/syscallsubr.h: assorted tidying
- gc unused struct kevent
- sort kern_frmdirat, kern_funlinkat, kern_kexec_load, and kern_kqueue
- put user_ functions in their own section

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D55309
a31127e6dfbfd96e512e0a238f4359c90849e3fb Brooks Davis 2026-02-19 15:06:29
vmm: Add privilege checks to vmmctl operations
In preparation for supporting creation of VMs by unprivileged users, add
some restrictions:
- Disallow creation of non-transient VMs by unprivileged users.  That
  is, if an unprivileged user creates a VM, the VM must be destroyed
  automatically once the last fd referencing it is gone.
- Disallow destroying VMs created by a different user, unless the caller
  has the PRIV_VMM_DESTROY privilege.

Reviewed by:    bnovkov
MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54740
d4c05edd410e7925875c844c0642929410f22053 Mark Johnston 2026-02-19 14:38:29
vmm: Enable unprivileged bhyve
- Add the vmm group.
- Let /dev/vmmctl belong to the vmm group by default, and give group
  write permissions.
- When creating a VM's device files, make them owned by the creating
  process' effective UID.

Reviewed by:    bnovkov
MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54741
af099eaa5ec3604639807b7c5d3ed5be336e5643 Mark Johnston 2026-02-19 14:38:46
vmm: Start using exterror
For now, just describe the error where an unprivileged user attempts to
run a VM without DESTROY_ON_CLOSE semantics, i.e., monitor mode.

Reviewed by:    bnovkov
MFC after:      2 months
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54743
bc7862bc916c3b81bcdc374e5144ab2f5bf62b19 Mark Johnston 2026-02-19 14:39:12
cpufreq(4): cpufreq_levels_sysctl(): Remove always false NULL test
'sc->levels_buf' is initialized with malloc(M_WAITOK), so can never be
NULL.  Another sysctl handler function (cpufreq_curr_sysctl()) already
relies on that.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
953b9164c3d93e820a53b4fdebbde7fabb7b7644 Olivier Certner 2026-02-12 12:33:46
procctl(PROC_REAP_KILL): use pgrp pg_killsx sx to sync with fork
PROC_REAP_KILL must guarantee that all reaper descendants are signalled.
In particular, it must ensure that forked but not yet fully linked
descendants cannot escape killing. Currently, proc_reap() fullfils the
guarantee by single-threading stopping the target process, which moves
the target to the userspace boundary, so the target cannot fork while
the signal is sent.

Single-threading has undesirable effect of sometimes terminating sleeps
with EINTR.

Since the time that the bug with PROC_REAP_KILL was fixed, we grow
the pg_killsx mechanism that is similarly used by the process group
signalling to ensure that no member of the process group escapes.
Reuse pg_killsx for PROC_REAP_KILL as well.

Besides the functional change of no longer causing spurious EINTR, not
single-threading the target means that we no longer need to delegate the
work to the taskqueue.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290844
Reported by:    bdrewery
Reviewed by:    des, markj
Tested by:      des, pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55288
be140717a0a4bbfa7176d334c36364d34a0b1bc5 Konstantin Belousov 2026-02-15 11:05:36
reap_kill_subtree_once(): reap_kill_proc_work() might drop proctree_lock
Due to this, restart the iteration over the p_reapsiblings if the lock
was dropped.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55288
0e67c3f675eab3a9c00b76e3886ace7700ef1bd4 Konstantin Belousov 2026-02-16 15:20:02
procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
ESRCH from cr_cansignal() means that the target process should be not
visible to the initiator.  So do not report pids with ESRCH result.

Noted by:       markj
Reviewed by:    markj, olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55341
5c8af592f69a31da94c45722dcd74afcf0ab375e Konstantin Belousov 2026-02-18 08:22:51
sysctl: Avoid calling priv_check() unnecessarily
After commit 7d1d9cc440f80 we only serialize large sysctl requests for
non-root users, but we should avoid calling priv_check() unless the
request actually is large, as that's not the common case.  In
particular, priv_check() might not be cheap to evaluate if MAC hooks are
installed.

Reviewed by:    olce, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55377
0fa6ce255661acc984a45deaf2d710149b957ce6 Mark Johnston 2026-02-21 16:16:32
pipe: Avoid unnecessary priv_check() calls in pipespace_new()
Running out of pipe map KVA is a rare case, so reorder checks
accordingly, presuming that calling priv_check() is more expensive than
the calculation.  In particular, priv_check() might not be cheap to
evaluate if MAC hooks are installed.

Reviewed by:    olce, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55378
fa77660a3ccbd5f30e88093703b0f93892ef35d7 Mark Johnston 2026-02-21 16:28:49
HYM8563: Add HYM563 RTC driver to common config.
MFC after:    3 weeks
dc9a7b15b78b2b3d141c3a8c83fb2c88b54c2762 Michal Meloun 2025-11-06 19:52:50
buf: Relax an assertion in BUF_UNLOCK
The BUF_UNLOCK macro asserts that B_REMFREE is not set, as it is up to
the lock owner to complete the dequeue from the free list before
releasing the lock.  However, if the thread has acquired the lock
multiple times, then releasing the recursive lock should be ok.  Modify
the assertion to reflect this.

This was triggered by an out-of-tree filesystem.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55418
eaeb356ce3491f05b6a99ccd485180a42df22c46 Mark Johnston 2026-02-22 19:26:17
arm: Add EARLY_PRINTF for ns8250 on arm/aarch64 platforms.
Reviewed  by: adrian (previous version)
MFC after:      3 weeks
d2dea8b46a8a61359c5185f4af3cc1761139bcb4 Michal Meloun 2025-02-02 14:22:34
sys/_offsetof.h: pacify GCC 12's macro redefinition check
GCC 12 has a strict definition of identity (all characters including
whitespace must be identical) when comparing "redefined" macros. Make
our definition exactly match the stddef.h that comes with GCC to fix
test-includes of netlink/netlink_snl.h.  (Note: later versions of GCC
are a bit more flexible and don't have this problem.)

Reported by:    des
Sponsored by:   DARPA, AFRL
Fixes:          https://cgit.freebsd.org/src/commit/?id=2adc3f0db187 ("stddef.h: centralize definition of offsetof()")
0076f6d1ad05e80d372bef1caf15615cd639fb5c Brooks Davis 2026-02-23 09:45:58
sys: Restore sorting in sys/elf_common.h
These various definitions are meant to be kept sorted by machine prefix.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2bb61497ca76 ("elf_common.h: Add definitions for LoongArch ELF files")
b7ef4f4b230f01968473269f280bd7e4e86a3ec9 Jessica Clarke 2026-02-24 13:52:21
elf_common.h: Sort SHT_ entries
Reviewed by:  jrtc27
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55488
0ff08b8c402b3c555125e4c72df0b80b4d084d56 Ed Maste 2026-02-24 14:26:55
__builtin_align_down: Cast value to __uintptr_t in the fallback
This matches the behavior of the fallbacks for __builtin_align_up
and __builtin_is_aligned.

Reviewed by:    arichardson, ngie, kib
Differential Revision:  https://reviews.freebsd.org/D55161
5faceb84142f3c9886f38a03dd5214785ac6961f John Baldwin 2026-02-24 20:24:17
ccp: Don't name anonymous structure and union types
Keep the dword labels as comments instead.  Anonymous structs and
unions don't have type names in C11+.

Differential Revision:  https://reviews.freebsd.org/D55144
8d3f41dbcb2a949b52660501d7efc6bb12850b09 John Baldwin 2026-02-24 20:25:45
bus: Add a new IVAR accessor to check for the existence of an IVAR
<varp>_has_<var> returns true if the given IVAR can be read.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55352
cb5a0eb05310d06e9853a01a542be55b9adee038 John Baldwin 2026-02-24 20:28:28
bus: Add __BUS_ACCESSOR_DEFAULT
This macro is similar to __BUS_ACCESSOR in that it creates three
helper routines for an ivar, but the "get" wrapper returns a default
value if BUS_READ_IVAR does not return a value.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55353
b937f9bf750907602606691dd92fb6d70e9f88da John Baldwin 2026-02-24 20:29:40
acpi: Split ACPI IVARs into global and private sets
ACPI_IVAR_HANDLE is the only true "global" IVAR that can be used
across multiple bus drivers.  The other IVARs are private to direct
children of acpi0.  However, they need to be numbered after ISA IVARs
as ACPI mimics an ISA bus device.  To ensure this remains true, add an
ISA_IVAR_LAST to use in assert that the private ACPI IVARs do not
overlap with ISA IVARs.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55354
0bb867e9f56500e30948ea7c440dd1166097df7f John Baldwin 2026-02-24 20:30:06
ofed: reduce usage of struct dma_attrs *dma_attrs
ib_verbs.h still uses struct dma_attrs *dma_attrs everywhere.
It is beyond my knowledge when that struct got deprecated upstream but
it is still supported by our LinuxKPI.  The problem is that the
functions called with that argument (dma_map_single_attrs,
dma_unmap_single_attrs, dma_map_sg_attrs, dma_unmap_sg_attrs) so far
are #defines in LinuxKPI and drop the last argument (attrs) so it was
never a problem.

In preparation to pass the attrs to the actual implementation in LinuxKPI,
which has gained support for them, we now pass dma_sttrs->flags which
is the expected unsigned long bit field.

If anyone has serious interest in updating our ofed implementation they
could look into this some more and remove the usage of struct dma_attrs
entirely.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D55390
5edf24aac1d0978d37d62594f42d87c9f118622b Bjoern A. Zeeb 2026-02-19 23:12:29
LinuxKPI: 802.11: do not leak BA sessions when tearing down state
In certain cases we may tear down state of a node with 'ongoing'
BA sessions.  This can trigger a firmware crash with iwlwifi as
reported in [1] when trying to remove the sta from the firmware.

   0x2010303A | ADVANCED_SYSASSERT
   ..
   0x00000000 | umac data1 (sta id=0)
   ..
   0x0088030C | last host cmd (STA_RM)

[1] https://lists.freebsd.org/archives/freebsd-wireless/2025-November/003901.html

I hit the same problem while running regression tests after
reworking some LinuxKPI 802.11 sta state machine bits.

Add the missing calls to lkpi_sta_run_to_assoc() and lkpi_sta_run_to_init()
to make sure (through net80211) we call (*ampdu_action) with
IEEE80211_AMPDU_RX_STOP to avoid the firmware crash.

Note: this specific patch was not excessively tested.  The upcoming
change to the state machine including this fix has seen more testing
but also only needed the change in one place.
The reason for putting this in upfront is to document the case well.

Reported by:    Mohammad Amin (the.madamin20 gmail.com) [1]
Sponsored by:   The FreeBSSD Foundation
MFC after:      3 days
fc9369abef6b6993e79b08de832e1d49f81a17b9 Bjoern A. Zeeb 2026-02-24 12:55:48
kern/sched_shims.c: back to ifunc
Reported by:  kevans
Reviewed by:    kevans, mhorne
Fixes:  https://cgit.freebsd.org/src/commit/?id=0d3652f67d246348e2c017205c6782caf4484449
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differrential revision: https://reviews.freebsd.org/D55490
ef1218add1d3d2baca9d3b8bcfb57e05ef6fc503 Konstantin Belousov 2026-02-24 15:36:26
Do not fail 'devctl clear driver' if another driver is not found
Detaching the bhyve(4) ppt driver from an unsupported PCI device
should not raise a "Device not configured" error.  We do not expect
that a new driver must take over the device in this case.

Reviewed by:    imp, jhb
Differential Revision:  https://reviews.freebsd.org/D52050
fba56be09f1c344cc5805b898fbfef6066950942 Marcin Cieslak 2026-02-25 01:58:59
Commit group #70: sctp: fix so_proto when peeling off a socket
sctp: fix so_proto when peeling off a socket

Reported by:            glebius
Reviewed by:            rrs
Fixes:                  https://cgit.freebsd.org/src/commit/?id=d195b3783fa4 ("sctp: fix socket type created by sctp_peeloff()")
Differential Revision:  https://reviews.freebsd.org/D55454
454212b9718b55b43781f81bef252658e20e0fd3 Michael Tuexen 2026-02-25 12:55:54

sctp: fix NOINET build

Reported by:            ngie
Fixes:                  https://cgit.freebsd.org/src/commit/?id=454212b9718b ("sctp: fix so_proto when peeling off a socket")
MFC after:              3 days
6bd97e9e01ff159eef49b2521fdbe67d5db10d95 Michael Tuexen 2026-02-27 07:51:29
elf_common.h: Add AArch64 Memtag ABI constants
Obtained from the Memtag ABI Extension to ELF for the Arm® 64-bit
Architecture (AArch64) [1]

[1] https://github.com/ARM-software/abi-aa/blob/main/memtagabielf64/memtagabielf64.rst#dynamic-section

Reviewed by:    andrew
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55486
d971bc5220f7adb8a2bdfadc8e3ca7ffcf9ca843 Ed Maste 2026-02-23 21:23:49
LinuxKPI: remove dumm header now in common
page_pool/helpers.h does exist in common/include/net/page_pool/helpers.h
so we can remove the dummy header file.

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
c944960a5bd7725e4d5e6805ec1e55b7de147c35 Bjoern A. Zeeb 2026-02-26 22:46:08
sys: Retire le(4)
We retired most obsolete 10 and 10/100 Ethernet NIC drivers in 2019 --
see commits following ebcf740a32ae ("FCP-101: remove obsolete 10 and
10/100 Ethernet drivers.).

le(4) was retained with with the note "Emulated by QEMU, alternatives
don't yet work for mips64."  MIPS has since been removed from the tree
and emulators and virtual machines offer many other, more suitable
devices.

Reviewed by:    brooks
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55516
7a323f873662dae95a061d1eaf8b1d9d1a0f8a23 Ed Maste 2025-10-24 17:26:03
acpi: build dev/acpi_support/acpi_wmi_if.m on ARM64
Per Wikipedia, ACPI WMI support is available on all x86* platforms
and ARM platforms. Add the source to `files.arm64` so code that relies
on its headers (thunderbolt(4) for instance), can be built on ARM64.

MFC after:      1 month
Reviewed By:    andrew
Differential Revision: https://reviews.freebsd.org/D55535
876d2b8392e6570a835a500d8fd7c4a5b0abf844 Enji Cooper 2026-03-03 04:09:41
Only build USB-related modules if MK_USB != no
This change moves the thunderbolt module and other USB modules under a
MK_USB != no conditional to ensure that users not desiring USB support
can easily build systems without USB-specific drivers using this knob.

MFC after:      1 week
Reviewed By:    imp
Differential Revision: https://reviews.freebsd.org/D55576
c47cefba831240a1b3de375f18134b93cf998f5c Enji Cooper 2026-03-03 04:49:54
nvme xpt: convert restart to a bool.
restart is a boolean. While I'm here, convert to a bool.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55518
3212aa86ac87fcd3b483d3f1668dcb26a3ab84b0 Warner Losh 2026-03-03 17:59:18
Commit group #71: nda
nda: Move ndasetgeom

Move ndasetgeom up in the file. We'll need it here for future
commits. Also, preserve the UNMAPPED_BIO flag since we can't observe
enough data from this routine to set it directly.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55519
b1bd7fed589fb5381fa2595f1f08e74895868941 Warner Losh 2026-03-03 17:59:22

nda: Rescan the drive on open

SCSI and ATA drives rescan the drive on opens to catch changes to the
disk. We do it here to so we catch if a drive has been FORMATed or
SANITIZEd with different parameters. We don't use xpt_rescan() since we
don't want to interfere with boot or keep all busses locked (this rescan
won't change the bus, so we don't need the CAM topo lock).

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55520
5c2186b992546bce212dfad3e49012f4c69c2d0c Warner Losh 2026-03-03 17:59:31

nda: AC_GETDEV_CHANGED calls media chanaged for sectorsize change

When the sector size changes, we assume it's new media. When the
mediasize changes, we'll just resize the disk (we get called for both
events). When neither have changed, don't call either.

Some NVMe drives (but not all) post a async event on page 4 with the
sector size changes via a FORMAT command. We'll notice the new media
right away, rather than the next device open. As a practical effect,
this just means that certain geom operations will see it sooner. Since
most drive interaction goes through open, that will catch those drives
that do not post this event well enough.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55521
628d7a3270b64b6c7fae3b0c98068c670162a154 Warner Losh 2026-03-03 17:59:36
nda: Assume all cases in ndaasync can sleep
The error recovery is nicer if we can wait for the tiny memory we need
to send the messages when the physpath changes. Since we've moved the
async handler into a sleepable context, we can wait for the allocation
to complete since async events are rare enough and it's not an
indefinite wait.

Also add a comment about the scope of AC_ADVINFO_CHANGED for nvme
drives. We could use it for broadcasting INDENTIFY changes in nvme
drives. However, the underlying mechanisms in NVMe don't really allow
for that (they are more fine-grained). So for namespace changes, for
example, we'll send AC_GETDEV_CHANGED instead of a AC_ADVINFO_CHANGED.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D55523
824530a5c4fd59427cda0eae0a4ac85212814958 Warner Losh 2026-03-03 18:00:15
LinuxKPI: avoid -Werror=unused-value in sort() from BUILD_BUG_ON_ZERO()
The BUILD_BUG_ON_ZERO() macro returns an (int)0 if it does not fail
at build time. LinuxKPI sort() has it as a guard for an unsupported
argument but ignores the return value.

This leads to gcc complaining:

/usr/src/sys/compat/linuxkpi/common/include/linux/build_bug.h:60:33: error: statement with no effect [-Werror=unused-value]
   60 | #define BUILD_BUG_ON_ZERO(x)    ((int)sizeof(struct { int:-((x) != 0); }))
      |                                 ^
/usr/src/sys/compat/linuxkpi/common/include/linux/sort.h:37:9: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   37 |         BUILD_BUG_ON_ZERO(swap);                        \
      |         ^~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/dev/rtw89/core.c:2575:9: note: in expansion of macro 'sort'
 2575 |         sort(drift, RTW89_BCN_TRACK_STAT_NR, sizeof(*drift), cmp_u16, NULL);

Change to BUILD_BUG_ON() for the statement version.

Reported by:    CI
Co-authored-by: bz
Approved by:    emaste (mentor)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55634
f26cb4757eb74ceace39144933ae198ebf1b4f28 Siva Mahadevan 2026-03-03 19:09:35
hpts: remove call into TCP HPTS from userret()
This hack introduced in d7955cc0ffdf and e3cbc572f154 proved to have more
ill side effects than benefits.  Sorry for that.

Now the HPTS soft clock is called only after the LRO completion.  Refactor
HPTS module linkage to address that and share the pointer only between
HPTS and LRO.

Reviewed by:            Nick Banks
Differential Revision:  https://reviews.freebsd.org/D55640
776604651ea640d65baa241c90fb0531aba30f29 Gleb Smirnoff 2026-03-05 03:16:00
LinuxKPI: 802.11: split (*bss_info_changed) up for more modern drivers
With the advent of MLO some of the updates (*bss_info_changed) would
have done are not per-link.  This had (*vif_cfg_changed) and
(*link_conf_changed) introduced which are used by iwlwifi, rtw89,
select mt76 drivers, and ath12k currently it seems.
A driver normally only supports on or the other set.

Factor out the call to (*bss_info_changed) into an internal function.
There split the options up depending on whether they are for the
vif or a link and leave a fallback to (*bss_info_changed) for older
drivers.

Add the mac80211 ops implementations for the two new calls along with
a currently unused backup option for (*bss_info_changed) for each
as I assume we will eventually call the directly rather than from the
internal wrapper function.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
9592f563c36bd207d98f1b3a13839b88d5760d97 Bjoern A. Zeeb 2026-01-03 20:10:00
LinuxKPI: 802.11: change teardown order of disassoc and sta rm
In lkpi_sta_auth_to_scan() we remove the sta from the firmware
for everything supporting (*sta_state).

We used to run into issues here with iwlwifi in that we had to
use a specific order: set vif->cfg.assoc = false, .aid = 0,
then remove the sta, and then send the mac update as otherwise
we would either have the sta silently removed (if we run
(*bss_info_change) first and fail then or silently not have the
sta removed and upon sta add we would trigger the fw crash.

The order of events seem to have changed now and especially BE200
(iwlwifi/mld) is picky about this and would crash the firmware with
something like:

        iwlwifi0: 0x20103311 | ADVANCED_SYSASSERT
        iwlwifi0: 0x00000000 | umac branchlink1
        iwlwifi0: 0xC00808AA | umac branchlink2
        iwlwifi0: 0xD00D6E90 | umac interruptlink1
        iwlwifi0: 0x0108C504 | umac interruptlink2
        iwlwifi0: 0x00000000 | umac data1 (link_id? seen weird values there though)
        iwlwifi0: 0x00000006 | umac data2 (fw_sta_id)
        iwlwifi0: 0x00000001 | umac data3

if it would still think we were assoc.

So the new order is as one would have expected initially:
set assoc = false, aid = 0;  do the remaining bss_conf (vif/link) changes
and issue the (*vif_cfg_changed) / (*link_info_changed) or for older
drivers (*bss_info_changed).  That will tell the mac we are no longer
associated.  And only then remove the sta from the firmware.

Update the comment there along so we do have the paper trail as to when
and why this changed.

Tested on:      BE200, AX210 (11ac)
Tested on:      AX200. 9260, 8265, 3165 (11a)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
f68ebebd8ae469e344f10ed2f3c4d9d983a29f41 Bjoern A. Zeeb 2026-03-05 09:58:28
witness: report a thread that can't sleep in WITNESS_WARN
Although this is not related to locking, but seems to be the right
place to catch violators, given that WITNESS_WARN is already used
widely in the kernel.

Reviewed by:            kib, markj
Differential Revision:  https://reviews.freebsd.org/D55316
6feb16b77e7df470c635bc3af65d448fd37deb10 Gleb Smirnoff 2026-03-05 18:43:17
VOP_RENAME(9): add flags argument
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
e486066cf48a89ba87fab6b3d2b56f271f50439b Konstantin Belousov 2026-02-26 18:22:48
kern_renameat(9): add flags argument
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
1f3020067ab3f3c5043d01ea1e3a3d2998a39d4a Konstantin Belousov 2026-02-26 18:30:14
sys: add renameat2(2) syscall
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
28599a1e5f1b90676a818e0a4818cddd0839ad25 Konstantin Belousov 2026-02-26 18:33:33
renameat2(2): implement AT_RENAME_NOREPLACE flag
For msdosfs, tmpfs, and ufs.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
7aaec5f3faecf98e377c97e24dddb9c65f4b2e75 Konstantin Belousov 2026-02-26 18:57:24
linuxolator: translate LINUX_RENAME_NOREPLACE into our AT_RENAME_NOREPLACE
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
8feb8d221cfb842ee11d744d22571baec6c18cd8 Konstantin Belousov 2026-02-26 19:21:08
Regen
ef8292e339572dc669409d233f9e3d43f13acb87 Konstantin Belousov 2026-02-26 18:47:52
vfs: add VOP_DELAYED_SETSIZE() and related infrastructure
The change generalizes code that was initially developed for nfs client
to handle filesystems that needs to call vnode_pager_setsize() while
only owning the vnode lock shared.  Since vnode pager might need to trim
or extend the vnode vm_object' page queue, the vnode lock for the call
must be owned exclusive.  This is typical for filesystems with remote
authorative source of file attributes, like nfs/p9/fuse.

Handle the conflict by delaying the vnode_pager_setsize() to the next
vnode locking to avoid relock.  But if the next locking request is in
shared mode, lock it exclusively instead, perform the delayed
vnode_pager_setsize() call by doing VOP_DEFAULT_SETSIZE(), and then
downgrade to shared.

Filesystems that opt into the feature must provide the implementation of
VOP_DELAYED_SETSIZE() that actually calls vnode_pager_setsize(), and use
vn_delay_setsize() helper to mark the vnode as requiring the delay call.

Reviewed by:    rmacklem
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55595
45117ffcd533ddf995f654db60b10899ae8370ec Konstantin Belousov 2026-02-28 16:11:58
splice: optionally limit worker queues
Add a new tunable/sysctl (kern.ipc.splice.num_wq) which can be used
to limit the number of splice worker queues as a way to limit
splice cpu use.

The default (-1) keeps the current behavior of running one worker
for each core in the system.  An administrator can set it to 0 (either
via tunable, or before the first splice call via sysctl) to
effectively disable splice, or some number smaller than the number of
cores to limit splice thread use.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55579
Sponsored by: Netflix
f1e8b1aca54312a2c7f0d22a83aaae44950dac6b Andrew Gallatin 2026-03-06 14:59:35
kern.post.mk: Replace "mkdir -p" with "install -d"
to create the 'dir' entry in METALOG

Signed-off-by: Marian Cingel <cingel.marian@gmail.com>
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/1967
756500fa4b1ed0807e16c9063f27031544cd7706 Marian Cingel 2026-01-13 17:48:04
LinuxKPI: 802.11: lkpi_sta_auth_to_scan() fail graciously on lsta == NULL
Usually after a firmware crash, we see reports of crashes in
lkpi_sta_auth_to_scan().  One of the last ones was in the PR
mentioned below.

These crashes are often attributed as the problem while the real
problem happened before.

At this point try avoid the NULL pointer and to fail graciously if
lvif->iv_bss (lsta) is no longer set.  This way users have a chance
to possibly recover using netif restart wlan0 rather than dealing
with a panic.

See if this helps us to better track down the original problems
rather than the follow-up crash.

On a debug kernel the KASSERT should normally have caught that
condition as well but we see panics on page faults were the log
line was there but then the lsta->ni deref has happened, which is
after the KASSERT.  I have not checked if this is a reordering problem
or if the people reporting had IEEE80211_DEBUG on but not INVARIANTS.

Sponsored by:   The FreeBSD Foundation
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286219 #chttps://bugs.freebsd.org/bugzilla/show_bug.cgi?id=11
MFC after:      3 days
53c69fd933dc49f69d5603fb27ce51064ebe681e Bjoern A. Zeeb 2026-03-08 12:48:51
vn_delayed_setsize(): post-commit review' changes
Handle doomed vnodes after LK_RETRY.
Rename the flag from VI_DELAYEDSSZ to VI_DELAYED_SETSIZE.
Change signature of vn_lock_delayed_setsize() to take flatten values
list instead of vop args structure.
__predict_true() for VI_DELAYED_SETSIZE not set.
Minor editings like removing tautological assert, and sorting items.

Noted by:       markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=45117ffcd533ddf995f654db60b10899ae8370ec
Reviewed by:    markj, rmacklem
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55681
92d7808d88f0de979d76446c76c7324731c41302 Konstantin Belousov 2026-03-06 00:18:11
pci: Export bus numbers for bridge devices in struct pci_conf
This exports bus information about bridges to userspace via the
less-privileged PCIOCGETCONF ioctl.  Previously if userspace wished to
query this information, it had to use direct PCI config register
access which requires higher privilege.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55771
7e7a1b61531a29b4a0a5cdac66b96f420e6c66e4 John Baldwin 2026-03-10 16:49:21
cam: Add comment about routine
Explain why we bump ref counts here.

Sponsored by:           Netflix
a8b15315b250b067f16d629664caf6358d468bff Warner Losh 2026-03-11 22:29:17
shm: Zero struct kinfo_file in sysctl handler
Reported by: Calif.io in collaboration with Claude and Anthropic Research
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55806
25cc459286a02b646751541ccde5a33319471c73 Ed Maste 2026-03-11 01:59:07
systm.h: don't declare socket and inpcb globally
a68e3a8ae8401fe3ba6c0a85bbd3de87bd2e36f2 Gleb Smirnoff 2026-03-11 18:17:57
compat32: Zero struct to avoid stack disclosure
Reported by:  Adam Crosser, Praetorian
Reviewed by:    philip
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55811
097cb4e9f0432c543c704cec712ce1cd3302335c Ed Maste 2026-03-11 15:02:18
compat/linux: Avoid waitid() kernel stack disclosure
Reported by:  Adam Crosser, Praetorian
Reviewed by:    philip
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55812
9a9f93bcf1aa0059d759b2f3ea6faeb2760a11bd Ed Maste 2026-03-10 13:53:46
sys/elf_common.h: Add the gABI spelling for a dynamic tag value.
b5f564fc5cdb56d6a24e31ca077c5f1f088a597d Joseph Koshy 2026-03-13 10:56:17
kern_time: Honor the precise option when counting diff
When preecise option is used, the true elapsed time should also use the
precise timer.

This fixes the test case sleep_for.signals.pass.cpp in libcxx.

Reviewed by:    kib, imp
Approved by:    lwhsu (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55824
728ae49a6b81edb3eec5ab70a63bb83db8f5dce5 ShengYi Hung 2026-03-12 09:16:24
queue.h: Reorder STAILQ_INSERT_TAIL
The current implementation briefly violates the tail invariant.  This
is not usually an issue, but if an insert is in flight when a panic
occurs, we may then trip the invariant while dumping core.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    obiwac, olce, jhb
Differential Revision:  https://reviews.freebsd.org/D55819
aa15df4597053c0e95a15b2a7036296999cd562a Dag-Erling Smørgrav 2026-03-16 20:36:56
vm_fault: expand KASSERT message in vm_fault_populate_cleanup
Include index values and object pointer in the diagnostic
to improve debugging of pindex mismatches.

No functional change.

Signed-off-by: Isa Isoux <isa@isoux.org>
Reviewed by: kib, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2038
83d7a4966f08f34a699da649bd4f714b450df39b isoux 2026-02-20 19:54:35
LinuxKPI: Clear the sbuf at the start of each call to seq_read
Each invocation of seq_read invokes the seq_file.show callback which
writes into the sbuf.  Then it invokes sbuf_finish before copying the
data into the caller's buffer.  Without this, a second call to
seq_read on the same file would try to append data to a finished sbuf.

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
c181c8f5ca707962359e636ca5aa536e60147eee John Baldwin 2026-03-17 16:05:17
LinuxKPI: Use simple_read_from_buffer in simple_attr_read and seq_read
Reviewed by:  bz
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D55879
58d74d7b0ca9bdf3aacfbe014bd00387f87b9be0 John Baldwin 2026-03-17 16:05:30
lindebugfs: Pass user buffer pointers to the read/write file operations
The Linux file_operations API expects the read and write operations
to take a single user buffer pointer (along with the length and the
file offset as an in/out parameter).

However, the debugfs_fill function was violating this part of the
contract as it was passing down kernel pointers instead.  An earlier
commit (5668c22a13c6befa9b8486387d38457c40ce7af4) hacked around this
by modifying simple_read_from_buffer() to treat its user pointer
argument as a kernel pointer instead.  However, other commits keep
tripping over this same API mismatch
(e.g. 78e25e65bf381303c8bdac9a713ab7b26a854b8c passes a kernel pointer
to copy_from_user in fops_str_write).

Instead, change debugfs_fill to use the "raw" pseudofs mode where the
uio is passed down to directly to the fill callback rather than an
sbuf.  debufs_fill now iterates over the iovec in the uio similar to
the implementation of uiomove invoking the read or write operation on
each user pointer.

This also fixes a tiny bug where the initial file offset from
uio_offset was ignored.  Instead, the operations were always invoked
with a file offset of 0.

As part of this, revert the the changes to simple_read_from_buffer()
from commit 5668c22a13c6befa9b8486387d38457c40ce7af4.

Also as part of this, the simple_attr_read/write methods and seq_read
now also need to accept and handle user pointers (also matching the
API in Linux).

For simple_attr_write*(), copy the user buffer into a kernel buffer
before parsing.  Also, do not permit writes at an offset as it's
unclear what the semantics for those would even be (perhaps you would
write out the formatted value into a buffer first and then allow the
copy_from_user to overwrite/extend that buffer and then re-parse the
integer value?).  The old handling of *ppos for writes was definitely
wrong before and only worked for an offset of 0 anyway.

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D55833
2cf15144daf7ec44cdcd9bf3ef007939b79c361e John Baldwin 2026-03-17 19:45:34
LinuxKPI: Fix simple_read_from_buffer for zero-size and off-the-end reads
I noticed that the buf_size < 0 check can never be true (it's a
size_t) and decided to check for this condition by an alternate
expression, and I also noticed that a read_size of 0 would incorrectly
return -EFAULT.  Instead, return success for both of these cases as
reading beyond the EOF of a normal file also returns EOF, not EINVAL.

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D55845
2353fa1aca553883141a7b5d0aa54312a4610412 John Baldwin 2026-03-17 19:49:01
Delete error-check code that can never happen.
Near the top of kern_mmap() that implements the mmap(2) system call,
it sets

        prot = PROT_EXTRACT(prot);

with

So prot can only be the three PROT_ flags.

The following test of the user's mmap(2) parameters (near line 275
in vm/vm_mmap.c):

        if (prot != PROT_NONE &&
            (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
                return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
        }

can never fail. This commit deletes it.

No functional change intended.

Reviewed by:  kib
MFC-after:    1 week
Sponsored by: Netflix
51446d33c6fbc27ce21f54ebb4c27caace48c3be Kirk McKusick 2026-03-19 00:45:23
Provide more precise error explanations for mmap(2) EINVAL errors.
Reviewed by:  kib
Differential Revision: https://reviews.freebsd.org/D55888
MFC-after:    1 week
Sponsored by: Netflix
dad6e6fc1ea4b737e9f1661ebd30da5d551e3d4a Kirk McKusick 2026-03-19 00:52:10
timerfd: Fix interval callout scheduling
When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.

Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.

This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55790
MFC after:              2 weeks
85c0f1a87da1fd1eb3e646e86f70e630c48da91a Jake Freeland 2026-03-20 06:33:03
sys/time: Add saturating sbt conversions
When converting from timespec to sbintime, the timespec's 64-bit tv_sec
component is shifted to the left 32 bits, causing any information in the
upper 32 bits to be lost.

This data loss during conversion can turn timespecs with very large
tv_sec counters into sbintimes that represent much smaller time
durations.

Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of
tstosbt and tvtosbt. With these routines, any overflow resulting from
the conversion is clamped to [-SBT_MAX - 1, SBT_MAX].

Reviewed by:            imp, markj
Differential Revision:  https://reviews.freebsd.org/D55791
MFC after:              2 weeks
e3799530b3ba38567f8052b9e107884609fc71ea Jake Freeland 2026-03-20 06:33:20
Commit group #72: timerfd
timerfd: Use saturating sbintime conversions

Some timerfd consumers set expirations with timespec tv_sec components
larger than 2^31 - 1. In such cases, converting that timespec to
sbintime results in data loss or sign flip, yielding a shorter
expiration than desired.

To avoid this problem, use saturating timespec-to-sbintime conversion
functions. These will clamp the converted sbintime to SBT_MAX under
circumstances where the normal conversion functions would overflow.

Saturating conversions still result in data loss, but the consequences
are less severe, causing problems only after SBT_MAX (~68 years) of
system uptime elapses.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D55792
MFC after:              2 weeks
0e8f351be7935729bf67dc1b7aa4d178cf154931 Jake Freeland 2026-03-20 06:33:38

timerfd: Wake up on discontinuous jump

If a discontinous realtime clock change occurs and sets any TFD_JUMPED
bits on the timerfd, then wake up waiting readers. This fixes failures
from the timerfd_root__clock_change_notification test case.

MFC after: 2 weeks
b11fba41265ae132acfb05587a6dbf60334d3279 Jake Freeland 2026-03-20 06:33:54

timerfd: Suppress kqueue readability after jump read

Do not report EVFILT_READ after reading a discontinuous clock jump.
This makes the kqueue filter consistent with Linux epoll behavior
and timerfd_poll(), which already checks tfd_jumped != TFD_READ before
reporting POLLIN.

MFC after: 2 weeks
33345b8834859cf1ad7f1256f3a34b4a7c83e8e8 Jake Freeland 2026-03-20 06:34:15
cam (scsi): silence "Medium not present" SCSI sense logging for removable media
Change SS_FATAL to SS_FAIL for SCSI sense code 0x3A (Medium not present)
to suppress console spam when card readers or other removable media
devices have no media inserted.

The error is still returned to callers (ENXIO), but no longer prints to
dmesg during boot/probe.

Verified with Apple SD Card Reader - reduced boot messages from 4 to 2.

Reviewed by:    emaste, imp
Differential Revision: https://reviews.freebsd.org/D55287
3d218b6289cf4675abdeef17a4489e71f8e1935e Abdelkader Boudih 2026-03-20 15:28:42
sys/param.h: bump __FreeBSD_version for amd64 struct trapframe size change
Requested by: jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
6275cd73aca7f31cbb3b9da2d031f6664814d58c Konstantin Belousov 2026-03-19 16:03:14
kernel: Be clearer about what ZSTDIO is for
ZSTDIO is not just for core dumps, and it is now required by ZFS, so
move it (and GZIO, which is still just for dumps) to a new “Compression
support” section in GENERIC, and add them both to MINIMAL.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55940
092687a031064dc08ac198648c6393cc50b06cee Dag-Erling Smørgrav 2026-03-21 07:21:24
sbuf: make assertion message a lot more useable
Saying that we are called with an (un)finished or corrupted sbuf
is like saying "error" (though [un]finished is an extra hint).

Add the pointer to the sbuf so one could easily check it,
add the flags we are checking so one could see quickly about
a possible state mismatch.

Given we already dereference the pointer in the KASSERT there is no
extra harm adding it to the message.

Found while:    testing lindebugfs changes
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    jhb
Differential Revision: https://reviews.freebsd.org/D55919
2ce06d25431a6c96ef5719165cb73e138a0ed89c Bjoern A. Zeeb 2026-03-18 14:43:15
LinuxKPI: add supporting #includes
Compiling drm-kmod on !X86 does not include asm/smp.h which includes
preempt.h on FreeBSD.  In order to compile drm-kmod on other
architectures add the secondary #includes for preempt.h to
spinlock.h and hardirq.h (which now also gets included from highmem.h)
to connect the #include chain.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279864
Reviewed by:    jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D55974
1d18872c2519d7ca726ddc49735180ab1d8916e0 Bjoern A. Zeeb 2026-03-19 20:29:29
sound: Retire SND_DEBUG
Not useful anymore.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55932
5d311c75324a205f3cd8a8a404a25ebdadb18b54 Christos Margiolis 2026-03-24 10:31:17
sound: Retire SND_OLDSTEREO
This is a legacy option and does not serve a good purpose anymore.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55933
bf0e5d987ecd2cbec2200e100bad6d6e724e9315 Christos Margiolis 2026-03-24 10:31:22
sound: Retire SND_FEEDER_MULTIFORMAT and SND_FEEDER_FULL_MULTIFORMAT
There is no reason to have these legacy controls anymore, all these
formats can be handled just fine nowadays.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55937
9318336f2af134b26adcb217f78f70bfdcf5f222 Christos Margiolis 2026-03-24 10:31:34
Commit group #73: snd_dummy: Add to sys/conf/files and sys/conf/NOTES
snd_dummy: Add to sys/conf/files and sys/conf/NOTES

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56040
72e85a4d977eff23fcd2b12a3513f0e8fd2ac332 Christos Margiolis 2026-03-24 10:32:13

snd_dummy: Fix sys/conf/files entry

Fixes:          https://cgit.freebsd.org/src/commit/?id=72e85a4d977e ("snd_dummy: Add to sys/conf/files and sys/conf/NOTES")
Report by:      CI
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D56065
82a066b8593a14e0bbf8e1fcdc75fd9ecf0d9e62 Christos Margiolis 2026-03-24 14:10:44
sound: Retire unused emu10k1-mkalsa.sh
It is a legacy script which is no longer used. Its utility is also
unknown.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56043
71c46c8c901be2a6e0708c912f0d766d49e5b335 Christos Margiolis 2026-03-24 10:32:26
clnt_bck.c: Delete a couple of old diagnostic printfs
There were two debug printf()s that were left in the
code while debugging the handling of callbacks over
a NFSv4.1/4.2 backchannel was being done.

This patch removes them, since they are no longer
of benefit and cause "noise".

Requested by:   wollman
MFC after:      2 weeks
41b423cc4e4dfe3132bb5d287bba03b82ecb5be8 Rick Macklem 2026-03-25 20:53:22
kqueue: Fix a race when adding an fd-based knote to a queue
When registering a new kevent backed by a file descriptor, we first look
up the file description with fget(), then lock the kqueue, then see if a
corresponding knote is already registered.  If not, and KN_ADD is
specified, we add the knote to the kqueue.

closefp_impl() interlocks with this process by calling knote_fdclose(),
which locks each kqueue and checks to see if the fd is registered with a
knote.  But, if userspace closes an fd while a different thread is
registering it, i.e., after fget() succeeds but before the kqueue is
locked, then we may end up with a mismatch in the knote table, where the
knote kn_fp field points to a different file description than the knote
ident.

Fix the problem by double-checking before registering a knote.  Add a
new fget_noref_unlocked() helper for this purpose.  It is a clone of
fget_noref().  We could simply use fget_noref(), but I like having an
explicit unlocked variant.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293382
Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55852
8f3227f527567aef53da845ab78da8e16d9051c1 Mark Johnston 2026-03-27 00:24:18
vm_fault: Avoid creating clean, writeable superpage mappings
The pmap layer requires writeable superpage mappings to be dirty.
Otherwise, during demotion, we may miss a hw update of the PDE which
sets the dirty bit.

When creating a managed superpage mapping without promotion, i.e., with
pmap_enter(psind == 1), we must therefore ensure that a writeable
mapping is created with the dirty bit pre-set.  To that end,
vm_fault_soft_fast(), when handling a map entry with write permissions,
checks whether all constituent pages are dirty, and if so, converts the
fault to a write fault, so that pmap_enter() does the right thing.  If
one or more pages is not dirty, we simply create a 4K mapping.

vm_fault_populate(), which may also create superpage mappings, did not
do this, and thus could create mappings which violate the invariant
described above.  Modify it to instead check whether all constituent
pages are already dirty, and if so, convert the fault to a write fault.
Otherwise the mapping is downgraded to read-only.

Reported by:    ashafer
Reviewed by:    alc, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55536
f404109e90eee7f67ddaae3f52286d524a190fa0 Mark Johnston 2026-03-27 00:25:31
Commit group #74: routing: Retire ROUTE_MPATH compile option
routing: Retire ROUTE_MPATH compile option

The ROUTE_MPATH compile option was introduced to
test the new multipath implementation.
Since compiling it has no overhead and it's enabled
by default, remove it.

Reviewed by:    melifaro, markj
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D55884
254b23eb1f540844cf2a90f2781ae4231c5701ce Pouria Mousavizadeh Tehrani 2026-03-27 11:20:05

routing: Include opt_route.h in route_ctl.c

Fix incorrect removal of opt_route.h header in route_ctl.c

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=254b23eb1f54 ("routing: Retire ROUTE_MPATH compile option")
Differential Revision: https://reviews.freebsd.org/D55884
beab2fe92453861e048cf25ea784d8f82523d288 Pouria Mousavizadeh Tehrani 2026-03-27 23:50:13
vfs: Simplify vfs_write_resume()/vn_start_write_refed()
The call to vn_start_write_refed() from vfs_write_resume() with
'mplocked' set to 'true' exactly boils down to doing an increment of
'mnt_writeopcount', albeit with lots of unnecessary verifications.

Replace it with an inline incrementation.  As the original call was the
last with 'mplocked' with 'true', remove the 'mplocked' parameter from
vfs_write_resume(), simplifying its code accordingly ('mplocked' always
false).

While here, in vfs_write_resume(), initialize 'error' out of the mount
lock.

Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56108
4deb934c1a1051d7ef41e9309d066742722ce180 Olivier Certner 2026-03-27 12:43:24
stat(2): Send to sticky(7) in the S_ISVTX description
Approved by: ziaee
Differential Revision: https://reviews.freebsd.org/D56015
0f147784de1037a662b0bd0aaa5f7f7bd7876e37 Gleb Popov 2026-03-21 11:11:15
rss: make toeplitz.c standard part of the kernel
This will fix LINT-NOIP build.  This actually adds very little to the
kernel text, e.g. 500 bytes on amd64.  A perfect solution would be to
instead declare rss_config.c as 'optional inet | inet6', but that would
fail to build LINT-NOIP in several NIC drivers, that use RSS and
absolutely ignore that both INET and INET6 are optional.  It is very
unlikely that vendors who maintain these drivers will will ever chase the
holy grail of a build that doesn't support IPv4 and IPv6.

Fixes:  https://cgit.freebsd.org/src/commit/?id=d9c55b2e8cd6b79f6926278e10a79f1bcca27a4b
407b1e4980189252fade78438aa08191a9883cdc Gleb Smirnoff 2026-03-31 16:34:51
Jail sysctls: deprecate generic sysctls in favour of allow-flags
- add a missing sysctl to the deprecated list
- add a comment to not add new generic sysctls and point to SYSCTL_JAIL_PARAM instead

Reviewed by:    jamie
Differential Revision:  https://reviews.freebsd.org/D51150
6087050ef52c4e45eeec5ffd773fcc25c9c768c9 Alexander Leidinger 2026-03-31 17:20:25

Build system

Makefile.inc1: Indicate that no-clean builds are on by default
a6afa194f382e4f81277fdc7e81e229d3c8caf5f Ed Maste 2026-01-02 20:16:00
bsd.sys.mk: suppress another gcc warning for libc++
Similar to base 63d1c3c43690, suppress -Wc++20-extensions for gcc.
Otherwise libc++ headers will lead to many -Werror warnings, due to our
use of -Wsystem-headers, which is not officially supported upstream.

MFC after:      3 days
62a7fdc13ab45b48977424ef77bbc0f11f601e39 Dimitry Andric 2026-01-02 20:29:05
release: Use make's `:H` rather than `/..`
In general we want to strip subdir components, rather than appending
`..`s.

Reviewed by:    lwhsu
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54373
3949c2b8c4691a6dff8be7b38805d56faab91187 Ed Maste 2025-12-26 16:36:43
share/mk: Remove trailing '/' from debug info directories
Signed-off-by: Marian Cingel <cingel.marian@gmail.com>
Reviewed by:    emaste
Pull request:   https://github.com/freebsd/freebsd-src/pull/1947
7359df79d3affeccf17f12f16c23ba3d4c5e0346 Marian Cingel 2026-01-04 22:15:01
Makefile.inc1: Allow safe installkernel with pkgbase
Commit 74a6bb524e5b added a check to install{world,kernel} to avoid
people accidentally running this on pkgbase systems and leaving their
system broken.  This had two issues:

(1) The warning was not sufficiently scary, leading people to think
    this was safe to do as long as they set DESTDIR=/.

(2) The installkernel check was too strict, and prevented installing
    kernels that don't conflict with packaged kernels.

Fix (1) by rewording the warning to be scarier, and while here, add
two new variables (ALLOW_PKGBASE_INSTALL{WORLD,KERNEL}) which could
be set in /etc/make.conf for people who want to break their systems
by default.

Fix (2) by improving the installkernel check to see if the kernel(s)
we're actually installing are packaged.  This means a new kernel can
be installed to /boot/kernel as long as there's no packaged kernel
installed there.  This check understands INSTKERNNAME, so if there
is a packaged kernel in /boot/kernel, the new kernel can still be
installed using INSTKERNNAME=testkernel (or whatever).

MFC after:      2 weeks
Reported by:    christos, jhb, others
Reviewed by:    emaste, christos (previous version)
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D54346
89c017d068704c2bc3da9cb22f43da17a9ce8c24 Lexi Winter 2026-01-05 17:39:47
Makefile.inc1: Fix INSTALLEXTRAKERNELS for one-kernel case
If BUILDKERNELS contains a single kernel, and NO_INSTALLEXTRAKERNELS=no,
then ${BUILDKERNELS:[2..-1]} returns the first kernel in the list and
that kernel ends up in both INSTALLKERNEL and INSTALLEXTRAKERNELS.

This breaks the package build because it means we generate that package
twice, once with an incorrect install path of /boot/kernel.NAME instead
of /boot/kernel.

Only set INSTALLEXTRAKERNELS if we're building at least two kernels.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2c0e9a76c1ce ("Makefile.inc1: Make NO_INSTALLKERNEL less of a hack")
Reviewed by:    jrtc27
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D54539
0b298e314a8b47c1f2bf8a9ff86c050accbd744d Lexi Winter 2026-01-06 01:48:04
zstd: Move to a new zstd package
Zstd is a discrete, self-contained system component.  To match how we
package zlib, bzip2 and xz, move it to its own package, with a separate
lib package.

Add the new package to the minimal set, since this is a core component
that users expect to be installed.

This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.

MFC after:      never
Reviewed by:    bapt
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53603
9c401bf14854ef20e5e187395a686b0d1b7bcb5f Lexi Winter 2026-01-06 04:23:22
libypclnt: Move to yp package
This was previously in runtime, because pam_unix uses it and we don't
want to pull in the entire yp package as a dependency of runtime.

However, we can now use LIB_PACKAGE here to create a yp-lib package
to contain the library, which is a much more reasonable dependency.
Since libypclnt clearly belongs in the yp package, move it there.

This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.

MFC after:      never
Reviewed by:    bapt
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53600
bde17e7663efc2e6abfb137d4bbd937226a66674 Lexi Winter 2026-01-06 04:26:53
lib/libbl[ao]cklist: Use LIB_PACKAGE
This avoids e.g. utilities or ssh depending on the full blocklist
package just because they link against libblocklist.

This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.

MFC after:      never
Reviewed by:    bapt
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53605
4028504b4826caf3dac64a30cf0de777e2a6b607 Lexi Winter 2026-01-06 04:28:43
release: stop disabling sendmail
sendmail is already disabled by default everywhere since 14.0

MFC After:      1 week
Approved by:    emaste (re)
Reviewed by:    emaste (re)
Differential Revision:  https://reviews.freebsd.org/D54575
d07198ff72aeddc5a884cfb81b22c22f2abf88f6 Baptiste Daroussin 2026-01-07 13:55:54
Commit group #75: GCE
GCE: Fix growfs path

The sed command was missing the ${DESTDIR} prefix, meaning it was
attempting to modify the build host's /etc/rc.d/growfs instead of
the target image's script. Tested in an arm64 builder that builds
as non-root.

PR:             kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292081
MFC after:      1 day
709c1049fe0c6d0217e81268d4f33f7191474453 William Carrel 2026-01-08 08:49:42

GCE: Enable vtnet(4) Multiqueue.

Removes hw.vtnet.mq_disable=1.

This workaround was originally introduced nearly a decade ago to
address stability issues on KVM that have long since been resolved
in both the FreeBSD driver and the GCE hypervisor. Removing this
allows network interrupts to scale across multiple vCPUs.

Tested on n2-highcpu-16 VM with 15.0-RELEASE and confirmed multiple
queue pairs active and interrupts handling across cores.

PR:             kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292081
MFC after:      1 day
f604d84618ad478fa46ec374480cbcbc1d93bf07 William Carrel 2026-01-08 08:51:11

GCE: ARM64 Support: Add hw.pci.honor_msi_blacklist=0.

This is required for MSI support on GCE ARM64 instances which is
prerequisite to gve(4) not panicking at boot, and nvme(4) also has
a real sad time without interrupts. Tested on a variety of c4a VMs.

This is meant to be a temporary hack; long term fix would be to
check for the hypervisor and quirk gve(4) device with
PCI_QUIRK_ENABLE_MSI_VM.

PR:             kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292081
MFC after:      1 week
9ae43352c89c776c8171f5881a984bc39acf5d6a William Carrel 2026-01-08 08:56:27
Makefile: Update doxygen requirements
MFC after:    3 days
Reviewed by:    imp, ziaee
Signed-off-by:  Minsoo Choo <minsoochoo0122@proton.me>
Closes:         https://github.com/freebsd/freebsd-src/pull/1869
d2f1c8e0d1bebab9fba32d69d261abc101f368ba Minsoo Choo 2026-01-06 18:11:11
release: make sh the default shell
The default shell for root has been changed to sh(1) followup changing
in release images sh(1) the shell for the "freebsd" user.

MFC After:      1 week
Reviewed by:    manu, emaste (re)
Approved by:    manu, emaste (re)
Differential Revision:  https://reviews.freebsd.org/D54602
d64db8892f8519f108d838f8d7e1d3b675ed37cd Baptiste Daroussin 2026-01-08 15:28:34
Makefile*: remove powerpcspe
As reported on the freebsd-announce mailing list[1] FreeBSD is
continuing to retire 32-bit support.  Remove powerpcspe from build
infrastructure.

[1] https://lists.freebsd.org/archives/freebsd-announce/2024-February/000117.html

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    jhibbits, emaste
Pull request:   https://github.com/freebsd/freebsd-src/pull/1914
94d1731e73ccb97df5fc5928bb584cabb8e37f1f Minsoo Choo 2025-12-03 03:57:23
release: remove powerpcspe
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    jhibbits, emaste
Pull request:   https://github.com/freebsd/freebsd-src/pull/1914
7a00382beb3dcdecc75eedc0c4248fe5145ccdc2 Minsoo Choo 2025-12-03 03:49:27
bsd.man.mk fix staging
The STAGE_SETS and STAGE_TARGETS need to match
STAGE_DIR.

For each STAGE_SET we have STAGE_DIR.${STAGE_SET}
and create a target stage_files.${STAGE_SET},
the settings all need to be self consistent to work.
9cd89fc5aa3c0e76375732788fe9d4282d65224f Simon J. Gerraty 2026-01-11 02:44:40
bsd.man.mk simplify staging
We actually only need the high level targets stage_files and stage_links
meta.stage.mk will take care of the details.
9fed072b44223f061a0dbf604741091b3bc09aee Simon J. Gerraty 2026-01-11 02:59:20
powerpc: fix release image building for Apple partitions
awk changed somewhere between 14 and 15 and it stopped accepting
a hexadecimal number as its input - it will always return 0.
This results in a very badly written apple boot block.

So just remove it; do the math in shell.

PR:             kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292341
Differential Revision:  https://reviews.freebsd.org/D54639
Reviewed by:    imp
MFC after:      1 week
7afa03963c448a14b1735a10eaf84941b0b74862 Adrian Chadd 2026-01-11 03:59:41
EC2: Add extra SSM Parameter names for releases
Record releases in the SSM Parameter Store not just as e.g.
  /aws/service/freebsd/arm64/small/ufs/15.0/RELEASE
but also as .../RELEASE/latest, e.g.
  /aws/service/freebsd/arm64/small/ufs/15.0/RELEASE/latest

The latter parameters will be updated when new AMIs are built with
security and errata updates appplied, and have been backfilled for
15.0.

MFC after:      3 days
MFC to:         stable/15 (14.x will not get security-update AMIs)
Sponsored by:   Amazon
b558c92fd0005d311edbcd02953c17d4a34fb909 Colin Percival 2026-01-11 22:25:51
Document pthread_tryjoin_np(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54766
7f026a58691db1763203ab8c7c8f34f738bfd9d5 Konstantin Belousov 2026-01-18 12:53:12
sctp: improve compilation as module
When compiling SCTP as a module, don't compile sctp_crc32.c into
the module. This avoids code and variable duplication since
sctp_crc32.c is compiled into the kernel. In particular, the variable
system_base_info is not duplicated. This fixes the handling of the
statistic counters sctps_sendhwcrc and sctps_sendswcrc when using
sctp_delayed_cksum.

MFC after:      3 days
68a449f09e2a38def9df822d42f91ecd2f27b0e2 Michael Tuexen 2026-01-19 20:38:37
OptionalObsoleteFiles.inc: Treat compat runtime loaders as libraries
Binaries require the runtime loader to use shared libraries, and
removing the runtime loader in `make delete-old` while leaving the
libraries around makes it impossible to use those shared libraries.
Treat rtld as a de facto dependency of shared libraries to ensure it
is not removed until the corresponding shared libraries are removed.

Differential Revision:  https://reviews.freebsd.org/D52210
8e1c85f03260ff9d214fcd99c7ad1a848e3ac23b John Baldwin 2026-01-20 17:07:21
src.conf.5: Add WITHOUT_SOUND description
Fixes: https://cgit.freebsd.org/src/commit/?id=f74f891581bc ("src.opts: Introduce MK_SOUND")
Sponsored by:   The FreeBSD Foundation
466bad427d74e666e85445729b2e63b82e10d18f Ed Maste 2026-01-20 18:07:13
vmimage.subr: Install pkg on pkgbase images
When building VM and Cloud images with a packaged base system, install
the pkg package; this makes it possible for the base system to be
updated without installing pkg from the FreeBSD-ports repository.

Sponsored by:   Amazon
f0ecf357aad984ac3b175f41027baac06d886f16 Colin Percival 2026-01-24 20:12:14
Account for the ctl test needing the ctl(4) module
This testcase does not function unless the /dev/ctl/... node exists,
which is created by the ctl(4) module. Require the ctl(4) module to be
loaded so the test can be executed.

MFC after: 1 week
Differential Revision:  https://reviews.freebsd.org/D54518
da59b3147b01203bb18bcd03cce7a6d5916e87c3 Enji Cooper 2026-01-25 00:17:06
Document pdrfork(2) and pdwait(2)
Reviewed by:  asomers, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
f7b56887cc0725fbe15730dbe062a092d0955058 Konstantin Belousov 2026-01-20 03:31:38
libc: document posix_spawnattr_getexecfd_np(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54862
58580dc0c694b107ba7ba1b14dc8ee8f306e53f6 Konstantin Belousov 2026-01-24 22:22:03
native-xtools: use static LLVM libraries
Set the MK_LLVM_LINK_STATIC_LIBRARIES knob to "yes" when building the
native-xtools target. This reverts to the behaviour prior to
2e47f35be5dc.

This avoids a build failure that occurs otherwise, where compilation
fails looking for a libllvmprivate.so that was not built.

It is unclear if this addresses the issue in all instances---some
replies in the PRs indicate otherwise. Still, some report success, and
in my own testing this fixed creation of a cross-compiled poudriere
jail. Commit this while we continue to investigate...

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286710, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291409
Tested by:      marck, rdunkle@smallcatbrain.com
Reviewed by:    emaste
MFC after:      3 days
Fixes:  https://cgit.freebsd.org/src/commit/?id=2e47f35be5dc ("Convert libllvm, libclang and liblldb into private shared libraries").
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54815
38e5564ecef53064c984d086a040c01100023f40 Mitchell Horne 2026-01-26 14:58:55
METALOG: Order keyword entries
To facilitate comparison with mtree -C generated output, keep the
keywords ordered.

No functional change intended.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54872
fe962e33d86f888b496b17251c8bedebf92be8ee Jose Luis Duran 2026-01-26 20:19:44
libc: document posix_spawnattr_{get,set}procdescp_np(3)
Reviewed by:  asomers
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54899
77c5f29453ed3dbb4ba1a372329ab32ec27c998d Konstantin Belousov 2026-01-26 20:06:44
bhyve: make BHYVE_SNAPSHOT amd64-only
Build fails with BHYVE_SNAPSHOT enabled on non-amd64,
so add it to BROKEN_OPTIONS for these arches.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292686
Reviewed by:            emaste, markj
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54873
b01763b2b2ab2d87f7d3c6ae57783c731ce548dd Roman Bogorodskiy 2026-01-26 18:24:15
bsd.sys.mk: Silence a few GCC warnings for C++
These warnings were already marked with -Wno-error=, but they trigger
so many false positives in libc++ headers to be utterly useless for
C++ code, so disable them entirely for C++.

Reviewed by:    imp, dim
Differential Revision:  https://reviews.freebsd.org/D54867
6fb87a1a6042887550571316fa9e539239f158d1 John Baldwin 2026-01-27 18:39:05
kyua: Workaround unclear warning from GCC
GCC 15 does not like a push_back() invocation in utils::find_core()
and incorrectly believes libc++ will free a non-heap pointer.  Disable
the warning to pacify GCC.

In function 'void std::__1::__libcpp_operator_delete(_Args ...) [with _Args = {void*, long unsigned int}]',
    inlined from 'void std::__1::__do_deallocate_handle_size(void*, size_t, _Args ...) [with _Args = {}]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/new:298:39,
    inlined from 'void std::__1::__libcpp_deallocate(void*, size_t, size_t)' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/new:311:39,
    inlined from 'void std::__1::allocator<_Tp>::deallocate(_Tp*, size_t) [with _Tp = utils::fs::path]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__memory/allocator.h:132:31,
    inlined from 'static void std::__1::allocator_traits<_Alloc>::deallocate(allocator_type&, pointer, size_type) [with _Alloc = std::__1::allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__memory/allocator_traits.h:314:19,
    inlined from 'std::__1::__split_buffer<_Tp, _Allocator>::~__split_buffer() [with _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>&]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__split_buffer:365:31,
    inlined from 'std::__1::vector<_Tp, _Alloc>::pointer std::__1::vector<_Tp, _Alloc>::__push_back_slow_path(_Up&&) [with _Up = utils::fs::path; _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/vector:1504:1,
    inlined from 'void std::__1::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/vector:1526:34,
    inlined from 'utils::optional<utils::fs::path> utils::find_core(const fs::path&, const process::status&, const fs::path&)' at contrib/kyua/utils/stacktrace.cpp:217:25:
/usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/new:274:38: error: 'void operator delete(void*, size_t)' called on pointer '<unknown>' with nonzero offset [24, 9223372036854775807] [-Werror=free-nonheap-object]
  274 |   __builtin_operator_delete(__args...);
      |                                      ^
In function 'void* std::__1::__libcpp_operator_new(_Args ...) [with _Args = {long unsigned int}]',
    inlined from 'void* std::__1::__libcpp_allocate(size_t, size_t)' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/new:289:31,
    inlined from '_Tp* std::__1::allocator<_Tp>::allocate(size_t) [with _Tp = utils::fs::path]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__memory/allocator.h:118:54,
    inlined from 'constexpr std::__1::__allocation_result<typename std::__1::allocator_traits<_Alloc>::pointer> std::__1::__allocate_at_least(_Alloc&, size_t) [with _Alloc = allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__memory/allocate_at_least.h:41:27,
    inlined from 'std::__1::__split_buffer<_Tp, _Allocator>::__split_buffer(size_type, size_type, __alloc_rr&) [with _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>&]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__split_buffer:353:49,
    inlined from 'std::__1::vector<_Tp, _Alloc>::pointer std::__1::vector<_Tp, _Alloc>::__push_back_slow_path(_Up&&) [with _Up = utils::fs::path; _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/vector:1498:47,
    inlined from 'void std::__1::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = utils::fs::path; _Allocator = std::__1::allocator<utils::fs::path>]' at /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/vector:1526:34,
    inlined from 'utils::optional<utils::fs::path> utils::find_core(const fs::path&, const process::status&, const fs::path&)' at contrib/kyua/utils/stacktrace.cpp:216:25:
/usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/new:265:42: note: returned from 'void* operator new(size_t)'
  265 |   return __builtin_operator_new(__args...);
      |                                          ^

Reviewed by:    imp, dim
Differential Revision:  https://reviews.freebsd.org/D54868
5c504c625d1faffd7cc7c3dfece62c72c012b4c5 John Baldwin 2026-01-27 18:39:41
release/tools: use same pkg settings in containers as in /etc/pkg/FreeBSD.conf
Instructions in /etc/pkg/FreeBSD.conf and elsewhere recommend putting
changes in /usr/local/etc/pkg/repos/FreeBSD.conf so bring OCI containers
into line as well.

Reviewed by:    dfr, ivy
Differential Revision:  https://reviews.freebsd.org/D54090

MFC after:      5 days
Sponsored by:   SkunkWerks, GmbH
c73ae67348998a0056145e88debbea9ff6860c4f Dave Cottlehuber 2026-01-27 22:51:22
release: Remove not-NO_ROOT cases
We always use NO_ROOT for release artifact builds, so remove the
alternate code paths.

For the first step we set NO_ROOT unconditionally in cases that invoke
submakes, and turn NO_ROOT being unset into an error in lover-level
targets so that we can catch potential out-of-tree build scripts (or
missed in-tree cases) that expect to run not-NO_ROOT builds.  The second
step will be to remove those entirely.

Reviewed by:    cperciva
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54179
54e006369c9aab4f3a22f026eb6924c0f9cafda8 Ed Maste 2025-12-11 17:16:53
src.conf.5: Cross-reference uname(1) manual page
Reviewed by:          emaste, ziaee
Differential Revision:  https://reviews.freebsd.org/D54688
eb0fc67c45a0fcedf8d5975f80780240f4ed0680 Artem Bunichev 2026-01-29 17:44:28
src.opts: Remove MK_SOUND artifact
Fixes:                https://cgit.freebsd.org/src/commit/?id=f74f891581bc ("src.opts: Introduce MK_SOUND")
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291853
Sponsored by:   The FreeBSD Foundation
MFC after:      4 days
b9289743f40dae677f910be1d3e56198a3a3ff9b Christos Margiolis 2026-01-30 16:14:28
lib/virtual_oss/sndio: Remove trailing backslash
Fixes:                https://cgit.freebsd.org/src/commit/?id=d78291b0e973 ("lib/virtual_oss: don't (over)link to libsamplerate")
Reported by:    pkg-fallout
Sponsored by:   The FreeBSD Foundation
MFC after:      2 days
c88f012faa13c39f13efdcef88d3141253a300ab Christos Margiolis 2026-01-30 16:20:48
release: Ship firmware from kmods repo on DVD
The packages for X.Y-RELEASE are a snapshot of the quarterly branch
for stable/X, i.e. typically built on X.(Y-1)-RELEASE.  (The case of
Y=0 is an exception for obvious reasons.)  This works for most ports
but not for kernel modules, which may need to be built on the release
in question; this is why we have a separate "kmods" repository.

Make sure that we put the packages from the kmods repository onto the
mini-pkg-repo on the DVD rather than shipping unusable firmware.

Reviewed by:    bz
MFC after:      1 week
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D52581
bda8028146694ee490543b35e3349e060936fde4 Colin Percival 2025-09-16 18:43:36
tests: sys/capsicum/functional requires mqueuefs
Skip this test if mqueuefs isn't loaded.  Unfortunately, that will skip
the entire googletest test program, including test cases that don't
require mqueuefs.  But the test's own skipping logic doesn't work, and
we don't yet have a googletest-compatible require_kmods() function.

MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    emaste, ngie
Differential Revision: https://reviews.freebsd.org/D54902
df68a09ea2ec18ee975fb937d46a18250d4663c8 Alan Somers 2026-01-27 00:04:58
wlanstat: Drop unneeded bsd.compiler.mk from Makefile
No functional change, but downstream in CheriBSD this was causing a
link error as the Makefile was overriding CFLAGS set via a side effect
of bsd.compiler.mk.

Reviewed by:    bz, brooks, emaste
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D54894
6e82cb29066765c03408a81c9bec4ed0d99cab81 John Baldwin 2026-01-31 16:58:39
stand: Add compiler builtins needed by GCC for RISC-V
Reviewed by:  mhorne
Differential Revision:  https://reviews.freebsd.org/D54963
fe45651224bea513c7db88abbc53bd1241ab442f John Baldwin 2026-01-31 17:10:36
Remove example tests when MK_EXAMPLES=no
This change cleans up example tests for atf, googletest, plain, and TAP
when MK_EXAMPLES=no. Not having this in results
`kyua test -k /usr/tests/share/examples/Kyuafile` being broken on a host
where the content in that directory tree is stale. I ran into that case
because at some point in time in the past I had specified
`MK_GOOGLETEST=no` one of my dev instances.

MFC after:      1 week
cea2683bb691d6cbcfb7e342c497d018bba712c2 Enji Cooper 2026-02-01 17:12:44
pkgbase-stage.lua: Add *-jail metapackages to the offline repo
Having *-jail metapackage variants on the installation media allows convenient offline jail creation.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1991
638fb31a75f69d8ed243a93eea0aa4a7510916f9 zxbv3 2026-01-27 16:24:14
pkgbase-stage.lua: Add '*-jail-dbg' variant to dvd1
- Add *-jail-dbg variant to dvd1 to match the non-jail variant;
- Remove assertion introduced in the previous commit for consistency with existing code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1991
49d75d93206a9f3e92a5c6ff9cddb80c6cf77581 zxbv3 2026-01-29 06:07:57
Remove bsnmpd tests when MK_BSNMP == no
MFC after:    1 week
51509500acdc5d23285a962e9c55dd9e38d2b30a Enji Cooper 2026-02-03 05:12:25
tftpd: remove tests when MK_TFTP=no
MFC after:    1 week
1ccee516edb681b33182f0a57531752eb98ec838 Enji Cooper 2026-02-03 05:24:33
usr.bin/factor: remove tests when MK_GAMES=no
factor(1) is only installed when MK_GAMES != no. Ergo, remove the tests
when that's not true.

MFC after:      1 week
7baa76c30c833750007e8d8823c9f5d94f5b2925 Enji Cooper 2026-02-03 05:40:50
usr.bin/tftp: remove tests when MK_TFTP=no
These tests require the tftp client, which is not installed when
`MK_TFTP=no`. Remove them when that's not true.

MFC after:      1 week
e1f36b9db9220cf51c6c3d2d2ad230fb9490bc3e Enji Cooper 2026-02-03 05:44:47
Makefile.inc1: Don't mark GCC broken for riscv64
Reviewed by:  mhorne
Differential Revision:  https://reviews.freebsd.org/D54969
dbe9fa0be1d627522a532160f6f8780701b86c72 John Baldwin 2026-02-03 16:56:44
libc/aarch64: Add a Makefile.inc dependency
If we update Makefile.inc it may be to change the contents of these
files.

Reviewed by:    imp
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54774
00f68392130cf597c7c76669c63dab26b31630c1 Andrew Turner 2026-02-03 14:00:46
Commit group #76: Remove additional libtpool and libuutil-related files
Remove additional libtpool and libuutil-related files

This change removes additional library files and tests orphaned in the
commit referenced below.

MFC with:       8b78d412a
Fixes: https://cgit.freebsd.org/src/commit/?id=8b78d412a ("zfs: world changes after https://cgit.freebsd.org/src/commit/?id=89f729dcc merge")
b78806b156f78733f8d6f1e0d593845e5e55221e Enji Cooper 2026-02-04 07:28:41

Remove the tpool Kyuafile as well as the test

This was accidentally missed in b78806b156f78733f8d6f1e0d.

Reported by:    des
Fixes:          https://cgit.freebsd.org/src/commit/?id=b78806b15 ("Remove additional libtpool and libuutil-related files")
d411a5d3a905b53cc61cb1a04cf0bef47f76adbf Enji Cooper 2026-02-08 07:37:52
OptionalObsoleteFiles: Add etc/zfs/compatibility.d
If the world is built and installed with WITHOUT_ZFS, then make
-DBATCH_DELETE_OLD_FILES delete-old-dirs will give the error:

> rmdir: /etc/zfs: Directory not empty

because /etc/zfs/compatibility.d is still there.  While we're here,
clean out /usr/share/zfs as well.

Co-authored-by: kevans
Differential Revision:  https://reviews.freebsd.org/D54758
5c9d988d865cc4ce849507173c0a2e2f399d0f62 Artem Bunichev 2026-02-05 03:35:01
builtin.1: Command list maintenance
+ link to return(1) like the other exclusive builtins
+ fix alphabetical sorting of list in rendered manual

MFC after:      3 days
e54a1ef4ebdf1ea606eb0e00cf2345f9c0db7a7f Alexander Ziaee 2026-02-05 03:37:08
hyperv: Add opt_acpi.h to SRCS
Add opt_acpi.h to SRCS as it is required by the hyper-v pcib sources.

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D48166
b18604ed93766b317dd40438793b714523b50123 Vijeyalakshumi Koteeswaran 2026-02-05 15:34:17
usr.sbin/jail/Makefile: remove riscv linker workaround
It links fine with newer binutils 2.44 (and GCC 15), so the workaround
can be dropped.

Reviewed by:    emaste
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242109
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55083
39148cbead211163f7e5a203d7c88ece5c3e30e0 Mitchell Horne 2026-02-05 16:41:31
release: Pass optional VM_IMAGE_CONFIG to vm-image
`make vm-image` calls mk-vmimage.sh, which supports
`-c CONFFILE`. This file gets sourced before building the image.

One example of how to use it is to define
vm_extra_filter_base_packages() to filter the list of packages
installed into the VM image:

    # vm-nodbg32.conf
    vm_extra_filter_base_packages() {
        grep -v -E '(-dbg|lib32)'
    }

    $ make VM_IMAGE_CONFIG=path/to/vm-nodbg32.conf \
        VMFORMATS=raw \
        -DWITH_VMIMAGES \
        vm-image

Signed-off-by: Pat Maddox <pat@patmaddox.com>
Reviewed by:    cperciva
Closes:         https://github.com/freebsd/freebsd-src/pull/1993
93f482ab3e6b4577f13e85e216a50bdf3704dda3 Pat Maddox 2026-02-06 07:50:20
universe: Bump default GCC version to 15
Reviewed by:  lwhsu, emaste
Differential Revision:  https://reviews.freebsd.org/D55085
f73101fabc74255d70f4e7ce0e71f0f6655c51ea John Baldwin 2026-02-06 15:32:58
qlnxev: Remove now unneeded include for opt_inet.h
Since the change [1], this is not required anymore.

This change partially reverts commit 8a847947153e.

[1] 4012b63889e4 qlnxe: Let ether_ioctl() handle SIOCSIFADDR ioctl

Reviewed by:    kbowling
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D54889
ec7950fe42344900567cb72c83845ea4dc5a7114 Zhenlei Huang 2026-02-06 17:52:54
release: Turn off debugging in pkg(8)
Running `pkg -d` in pkg-stage.sh results in multiple GB of network
traffic being written into the log files, which is less than helpful
when it comes to tracking down build failures.  Remove the -d flag.

MFC after:      5 days
X-MFC-note:     The code in 15 has diverged from 14, but the flag is
                there, just in a different place.
18721be356043f6749a6e2470bc9f7351c450c6e Colin Percival 2026-02-06 21:03:11
mt76: sort bus attachments in module Makefiles for pci and usb
With PCI enabled and USB still disabled add knobs to (i) enabled
them manually in the common Makefile.inc and (ii) add bus
attachment depend knobs where needed to enable them in individual
drivers.  For now the focus is in 7921 and 7925.

Sponsored by:   The FreeBSD Foundation
MFC atfer:      3 days
201fc8a55a4832174b5943e17ac90800aebe5772 Bjoern A. Zeeb 2026-02-02 01:23:10
mt76: module Makefiles fix .PATH
The common Makefile.inc had the .PATH set for the common code.
That .PATH is only needed for the mt76_core module, which shares
code for all other drivers.  We leave the COMMONDIR variable defined
in Makefile.inc as we need it for CFLAGS+= -I for each driver but
migrate the .PATH to avoid drivers picking up the wrong files.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
03f6b1fd6af0bb43f74b38d8b5373f5485da0e8f Bjoern A. Zeeb 2026-02-03 18:26:37
llvm: Link private LLVM libraries against compiler_rt for aarch64
This is required for GCC which uses libcalls for outlined atomics.

Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D55157
ee73475119ff7aa98bd11828625d524f6ab87f06 John Baldwin 2026-02-09 16:26:52
ath10k: modules Makefile bus attachments
Given USB in theory compiles add it to the Makefile.  The upstream
support was never finished and I see little chances it ever will be
so keep USB disabled by default.

MFC after:      3 days
32efafda38288848ec71e97eddf085ee0c108109 Bjoern A. Zeeb 2026-02-07 22:31:59
rtw88: Add bus attachments to the module Makefile
In addition to PCIe we will support USB and also prepare for SDIO (still
disabled locally).  The module SRCS are split up into a common part,
which we always add.  All three bus parts are guarded by a local
variable in the Makefile.
In addition the PCI parts require PCI to be compiled into the kernel.
We add that check in case of, e.g., SoCs with SDIO but no PCI, which
may not have PCI in the kernel config and thus the module would fail
to attach.
USB has no additional check as it is fully loadable and does not have
to be in a kernel config.
SDIO depends on an MMCCAM-enabled kernel but is otherwise loadable.

While we could, we are not splitting the various bus attachments into
individual modules as we generally do not do that in FreeBSD. [1]

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Discussed with: imp and jhb (2022, 2024), see also 17732dd8f01b [1]
OKed by:        imp (KERN_OPTS checks initially suggested by jhb)
Differential Revision: https://reviews.freebsd.org/D55022
9e175561196066a09c1a89202fd60e0433b87868 Bjoern A. Zeeb 2026-01-26 13:19:14
rtw89: module Makefile add USB bus attachments
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
f19cb3c72b001f5ca2204888bfab50e2f388547d Bjoern A. Zeeb 2026-01-31 23:16:55
brcmfmac: deal with bus attachments to the module Makefile
As with LinuxKPI-based wireless drivers, e.g., rtw88, PCI depends
on PCI being compiled into the kernel, SDIO will depend on
MMCCAM in the kernel once supported, and USB can always be
loaded.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
98c44ccb01d9461da477ec8d784c763e4d03fb36 Bjoern A. Zeeb 2026-02-09 01:08:42
libsys/arm: include ARM EABI unwind bits into libsys
libsys required ARM EABI unwind symbols like __aeabi_unwind_cpp_pr0.
These symbols are normally provided by libc, but if a binary does
not link libc, the symbol ends up not being resolved.

Among other problems, this prevented gcc14 and newer from building
on arm.

Add the relevant symbols as hidden symbols into libsys to avoid this
problem.

(this patch was posted by jrtc27 who has asked me to move it along)

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292539
Tested by:      fuz, Mark Millard <marklmi26-fbsd@yahoo.com>
Reviewed by:    mmel
Approved by:    markj (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55255
6265f30cd6b523d633efcc314f8952f24446861f Jessica Clarke 2026-02-11 15:37:08
diff3: use bsd diff3 by default
4d5c434ed16e821003a9c2dc1c1ea245b8d0b678 Baptiste Daroussin 2026-02-13 17:44:12
OpenSSL: install EVP_CIPHER_CTX_get_app_data.3 once
A separate EVP_CIPHER_CTX_get_app_data.3 was added in the OpenSSL 3.5.5
import, but the link to EVP_EncryptInit.3 was still being installed
which stomped on the file and created inconsistent entries in the METALOG.

Reviewed by:    emaste
Found by:       package_check script in Cirrus-CI
Fixes:          https://cgit.freebsd.org/src/commit/?id=1731fc70f734 ("OpenSSL: update vendor sources to match 3.5.5 content")
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D55332
c4130a8a84e1ce0fc9c05d2b48f83e66ade302aa Brooks Davis 2026-02-17 18:24:29
Commit group #77: OptionalObsoleteFiles: Add figpar to dialog section
OptionalObsoleteFiles: Add figpar to dialog section

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=15d781b53233 ("lib: Gate libfigpar under MK_DIALOG")
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D55330
bc6c827078b7ab62271ce7ac1c4439b82fd2f98c Dag-Erling Smørgrav 2026-02-17 22:58:36

OptionalObsoleteFiles: Add missing figpar MLINKS

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=bc6c827078b7 ("OptionalObsoleteFiles: Add figpar to dialog section")
efcfba9b31ad11ec901085c38b79e40289b9e7bc Dag-Erling Smørgrav 2026-02-18 08:12:26
libc: add man page for uexterr_gettext(3)
Reviewed by:  mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D55336
a03f285afafae243396c9bc7892cbe717a3ac37d Konstantin Belousov 2026-02-17 20:46:09
OptionalObsoleteFiles: Add missing dpv MLINK
MFC after:    3 days
32ec8e29a6c3025a864f85678db63a8568c8fc86 Dag-Erling Smørgrav 2026-02-18 10:06:50
ed: convert test suite to ATF/kyua
MFC After:    1 week
f015e48a4a0482787b46e972754619a75475439c Baptiste Daroussin 2026-02-17 16:14:09
build: add stddef.h to define ptraddr_t as required
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Reviewed by:    kib
Co-authored-by: Alfredo Mazzinghi <am2419@cl.cam.ac.uk>
Co-authored-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Differential Revision:  https://reviews.freebsd.org/D55308
89c3ae5fc9cc24af940699b7e282fd24763f7ffa Brooks Davis 2026-02-19 15:05:50
OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete
The intent of the currect code is to ignore anything under
/usr/lib/debug/boot/*.  But we also should make sure that
/usr/lib/debug/boot directory is also ignored and is not marked
obsolete.  If we don't do that, `make DBATCH_DELETE_OLD_FILES
delete-old` will try to rmdir(1) this directory, which will cause an
error, since /usr/lib/debug/boot may have nested directories like
kernel/ and modules/.

Reviewed by:    markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55077
c8191c3d613928d8bd6060aa2f7da349b4090cc1 Artem Bunichev 2026-02-19 19:09:48
packages: Don't create empty packages
If a package plist only contains directories, but no files, do not
create the package.

This fixes an issue where setting "package=foo" in mtree causes the
"foo" package to always be created, even if nothing else installs in
that package, because the mtree entry is always added to the plist.

This most often happens:

* With architecture-specific directories, because mtree can't install
  a directory conditionally based on architecture, and

* With packages that are completely empty when a particular src.conf
  knob is disabled, because mtree will still create the directories.

Although it's theoretically possible that we might want to create a
package that only contains directories, there are no such packages
today.

MFC after:      2 weeks (stable/15 only)
Reviewed by:    manu, des
Differential Revision:  https://reviews.freebsd.org/D55412
Sponsored by:   https://www.patreon.com/bsdivy
7965c93e4d4103ba6ed7ac1e5f1599c93cbcdbf7 Lexi Winter 2026-02-21 20:19:42
build: Move all of lp under LPR option
* Tag related directories with package=lp

* Make the examples/printing directory conditional on MK_LPR

* Make the hosts.lpd(5) manual page conditional on MK_LPR

MFC after:      3 days
d4f6cb75424950ee776833ebc6b57855c094a610 Dag-Erling Smørgrav 2026-02-20 18:20:04
libc: Roll {l,ll,imax}div(3) manpages into just div(3)
No need to have 4 separate manpages for these functions.

Reviewed by:    ziaee, rpokala, des
Approved by:    rpokala, des
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55360
c242bf1b70796313dabb5594b5aacdf4c20377aa Aymeric Wibo 2026-02-21 23:14:23
pkg-stage.sh: Add ext2 and ntfs
Having these packages available on release media may help users who
need to sneakernet other packages (e.g. firmware) from systems running
Linux or Windows.

Suggested by:   vladlen, ziaee
MFC after:      3 days
6881fd278d80ac63b4d511fc130a79ff16d1bb48 Colin Percival 2026-02-22 00:38:01
dtb: generate .DTB for some RK3588 based boards.
MFC after:    3 weeks
67fc0ff33d202bf90d93e0553271742ccd779bab Michal Meloun 2025-11-06 19:44:43
ffs.4: Mlink to ufs.4
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293423
MFC after:      3 days
Requested by:   bms
f0b8355db6ba57a0849c41722e0a09f312d9eef5 Alexander Ziaee 2026-02-24 13:24:16
tools/build/stddef.h: fix stock clang/gcc headers
Both clang and gcc's stddef.h are designed to be included multiple times
with different combinations of __need_* macros defined (e.g
__need_size_t). Remove the #pragma once to accommodate this, ptraddr_t
is guarded by _PTRADDR_T_DECLARED anyways.

Also use __SIZE_TYPE__ instead of size_t since it's not guaranteed to be
defined.

Reviewed by:    brooks, imp, kib
Differential Revision:  https://reviews.freebsd.org/D55453
0c075db78a98de8e3a255597d045bcd24ba27be7 Ahmad Khalifa 2026-02-24 20:11:12
Use NO_SHARED instead of explicitly using -static flag
NO_SHARED is the proper way to declare linking a program without
shared libraries.

Obtained from:  Hewlett Packard Enterprise
MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D44761
de773bcc2ffb8472f68283985bf4b7b698c57914 Stephen J. Kiernan 2026-02-25 05:25:08
syscall_timing: add Makefile.depend
This was part of review D44761. It was separated into another commit for
better clarity.

Obtained from:  Hewlett Packard Enterprise
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44761
0ac5cddebe1e98d7d29493f0e6e829021be7fcef Ka Ho Ng 2026-02-25 05:33:34
tests/kern: put ssl_sendfile under MK_OPENSSL != no
Reported by:  wosch
73d9153fc57bcfb665a4867cb1adc8fa0a8aaa84 Gleb Smirnoff 2026-02-26 20:30:18
rc.8: Add rc.suspend as an alias
Make it consistent with the other lifecycle scripts, thus making it
more findable.

Reviewed by:    ziaee
Signed-off-by:  Pat Maddox <pat@patmaddox.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2047
77dc773ecfcfd177c26dde4e858feb9a35fd970f Pat Maddox 2026-02-24 20:25:15
vmimage.subr: skip -dbg sets for WITHOUT_DEBUG_FILES/WITHOUT_KERNEL_SYMBOLS
This matches non-pkgbase behavior as installworld/installkernel skip the
debug bits if these knobs are set.

MFC after:      1 week
Sponsored by:   Chelsio Communications
Reviewed by:    cperciva
Differential Revision:  https://reviews.freebsd.org/D55572
960409d660486c823615dc4cb2ff91793337ef20 Navdeep Parhar 2026-02-27 02:04:16
share/mk/src.libnames.mk: Sort _DP entries
Requested by: des
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55598
5d9b185c33ae137d4690a02504d94c3315c71a60 Joseph Mingrone 2026-02-28 22:40:45
Run `make obj` before running `make test-includes`
Before this change, `make test-includes` (run as part of buildworld)
would place test files in the current directory, which would clutter up
git clones. Run `make obj` beforehand to ensure that the files are put
in `${.OBJDIR}` instead of `${.CURDIR}`. This helps cut down on the
noise significantly when running commands like `git status`.

MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D55499
912864912b71951f9a636190b1dba80528f588eb Enji Cooper 2026-03-03 05:59:50
src.opts.mk: Retire BSD_CPIO option
Prior to commit 6973701a00e3 ("1. Make the BSD version of cpio the
default [1]") GNU cpio was installed unconditionally.  The BSD_CPIO
option was added when we introduced the BSD licensed, libarchive-based
cpio, to support installation of GNU cpio, libarchive cpio, or both.

GNU cpio was removed long ago and there is no longer a need for this
option.  We can just install BSD cpio unconditionally.

Reviewed by:    des
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55467
b6bb2fc77e37fcb1efb4f83fcb2965f26b4db705 Ed Maste 2026-02-23 19:36:09
me.4: link if_me kernel module to its manual page.
MFC after:    1 week
46ba263d6eeb1c6029841b4c42f54912ad61de5c Eugene Grosbein 2026-03-04 07:29:26
virtual_oss(8): Expose ioctl interface
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293545
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
d15987cc06192f78a31040f2c142bcaf88e8a1ee Christos Margiolis 2026-03-04 18:06:17
Makefile.inc1: Don't force LLVM_BINUTILS off for cross-tools
Because of this setting we were still using ELF Tool Chain tools for
buildworld.  The sets of binary utilities are largely equivalent and
this went unnoticed after commit 1cae7121c667 ("Enable LLVM_BINUTILS
by default").

This was discovered recently because ELF Tool Chain objcopy produces
standalone debug files without phdrs and this caused an issue with a
3rd party ELF parser [1].  Remove the forced setting so that we use
LLVM's binutils to build the system.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=33876

Reviewed by:    imp, jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55650
858f53dd43ecb84cf2597229e9dbda2f242d9dd6 Ed Maste 2026-03-04 15:06:26
cirrus-ci: move package_check after test
Liveness is often more important than minor packaging glitches (which
might well be the fault of a prior commit.)

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55481
ea9bc84658308c8bdef94b2bda00781ef7c473a6 Brooks Davis 2026-03-05 10:23:51
Commit group #78: build: Retire LLVM_CXXFILT option
build: Retire LLVM_CXXFILT option

The LLVM_CXXFILT option was added when we used ELF Tool Chain tools by
default.  ELF Tool Chain's c++filt failed to demangle some symbols, so
we added a special case to install LLVM's version and enabled it by
default.

The rest of the LLVM tools are now used by default, as of commit
9fa94e1c099d ("Turn on WITH_LLVM_CXXFILT by default").  Simplify the
build logic by removing a special case and just include llvm-cxxfilt
with the rest of the LLVM utilities.

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55654
5d757312ad591aae26b39943f113ebf3819718da Ed Maste 2026-03-04 19:03:42

usr.bin: Exclude ELF Tool Chain cxxfilt build

when LLVM_BINUTILS is enabled (which is the default).

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293610
Fixes: https://cgit.freebsd.org/src/commit/?id=5d757312ad59 ("build: Retire LLVM_CXXFILT option")
Sponsored by: The FreeBSD Foundation
42e4df8b853186190b61428f0bd0f923cc525033 Ed Maste 2026-03-06 14:47:53

llvm-cxxfilt: Install as c++filt only with LLVM_BINUTILS

When building WITHOUT_LLVM_BINUTILS /usr/bin/c++filt is the one from
ELF Tool Chain.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293610
Fixes: https://cgit.freebsd.org/src/commit/?id=5d757312ad59 ("build: Retire LLVM_CXXFILT option")
Sponsored by: The FreeBSD Foundation
88dedd16ba659ea43bf5572a85e6f8151ee3fd87 Ed Maste 2026-03-06 15:49:22
bsd.linker.mk: Document ifunc, ifunc-noplt, riscv-relaxations features
Reviewed by:  emaste
Differential Revision:  https://reviews.freebsd.org/D55655
1b77f6ec6b9f5e0e916e2f559f045262645f2364 John Baldwin 2026-03-05 19:07:09
bsd.linker.mk: Sort list of linker features
Reindent the features as well to be friendly to long feature names.

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55656
cf92fa337074b0ac36f89b826ecf0769a1c45609 John Baldwin 2026-03-05 19:07:09
bsd.linker.mk: Retire support for binutils 2.17.50
GNU binutils 2.17.50 is the last GPLv2 version, and we retained support
in FreeBSD while it was part of the in-tree toolchain.  The last parts
of binutils 2.17.50 were removed in commit 74e8d41e0ac8 ("Retire
BINUTILS and BINUTILS_BOOTSTRAP options") and there is no longer a need
for the build infrastructure.

We retain build-id and ifunc in LINKER_FEATURES unconditionally for now,
as they may be tested by 3rd-party Makefiles.  We can however stop
testing for them in the tree.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55674
9cea0f0be79dc080761154cb934db0218ae512f3 Ed Maste 2026-03-05 18:49:58
renameat2(2): document
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
619e49b2ba58e1ffd2ab111fef6d1e87d77e7391 Konstantin Belousov 2026-02-27 00:10:36
Add __unused workaround for linux/sys/types.h
Signed-off-by: Perdixky <3293789706@qq.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2063
9f2eb94736eaf9a86cef75fe54c43c64132ec312 Perdixky 2026-03-05 12:26:03
libc/riscv64: temporarily disable strnlen() implementation until a fix is developed
strnlen() doesn't seem to cope well with a length argument such that
string pointer plus length overflows past the end of the address space.

Reviewed by:    fuz
MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293353, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293296
Differential Revision:  https://reviews.freebsd.org/D55714
2a4e3112c811b9892e14e15cfd23538e7e47329c Strahinja Stanišić 2026-03-07 21:59:25
depend-cleanup.sh: rebuild strnlen.o on riscv64 if it came from strnlen.S
We have to switch back to the previous rule once the temporary
build fix has been replaced with a permanent fix.

MFC after:      1 week
See also:       2a4e3112c811b9892e14e15cfd23538e7e47329c
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293353, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293296
b5514e1c6d9e7ec09b299a983d1ce32852e0d9dc Robert Clausecker 2026-03-07 23:14:25
bsd.progs.mk: Fix incremental META_MODE for prog sources
This fixes recursed builds not having meta mode enabled for them which
disabled dependency and and command change tracking.  We only want common
objects marked .NOMETA when recursing, not non-common objects.  The
common code expects _PROGS_COMMON_SRCS does not contain the prog source
or else it will be marked .NOMETA.

Add comments explaining the intent and cases being covered.

Fixes:  https://cgit.freebsd.org/src/commit/?id=4ea5e107b1 ("<bsd.progs.mk>: Allow using SRCS for common sources")
Differential Revision:  https://reviews.freebsd.org/D55711
Reviewed by:    vexeduxr, sjg
e2ed7ee02f6bda705a7c8df3c512c6a43db56830 Bryan Drewery 2026-03-07 16:38:47
Complete removal of GNU diff
Fixes:                https://cgit.freebsd.org/src/commit/?id=9a44e42a2b8f ("Retire GNU diff3")
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55423
df5b2cf2b31bf66e3b21c772b39f6cc6406dcb7b Dag-Erling Smørgrav 2026-03-10 08:21:32
build: Stop testing LINKER_FEATURES for ifunc and build-id
These features are available in all supported linkers, and we can expect
that they'll be supported by any GNU-compatible linker that we'd use to
link FreeBSD.

Reviewed by:    imp, kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55676
96294c22f7e54a48df44c86a4ee5848e71ac4470 Ed Maste 2026-03-05 19:09:19
llvm-*: Use SYMLINKS for unprefixed LLVM binutils
Previously they were hard links.  This change will support future
packaging changes by decoupling the prefixed (e.g. llvm-ar) and
unprefixed (e.g. ar) names.

Reviewed by:    dim, ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55693
e71bfbe2f58ffff8f16a9da075d98fff41671bac Ed Maste 2026-03-06 17:52:15
Commit group #79: EC2: Don't use unicode in boot loader
EC2: Don't use unicode in boot loader

The boot loader menu is disabled by default in EC2, but if it is ever
turned on, the default (unicode) output breaks EC2's web interface to
the serial console.

Set loader_menu_frame="ascii" instead.

MFC after:      3 days
Sponsored by:   Amazon
277830b4d3ae9999c80bf915b5491850e91c6516 Colin Percival 2026-03-13 20:45:05

EC2: Fix comment re avoiding unicode

We're avoiding *unicode*, not avoiding *ascii*.

Reported by:    marck
Fixes:  https://cgit.freebsd.org/src/commit/?id=277830b4d3ae ("EC2: Don't use unicode in boot loader")
MFC after:      3 days
251907ca480eff7f6177f52959b71a6cfce45579 Colin Percival 2026-03-14 16:30:13
Commit group #80: ecn.9: Add ecn(9) manual
ecn.9: Add ecn(9) manual

Add ecn manual for ip_ecn tunneling functions.

Reviewed by: pauamma_gundo.com, tuexen
Differential Revision: https://reviews.freebsd.org/D53517
ba4298b055642969d30389c5c92dd4d61a124fb6 Pouria Mousavizadeh Tehrani 2026-03-19 10:25:53

ecn.9: Replace non-ASCII characters

Reported by:    maxim
Fixes:          https://cgit.freebsd.org/src/commit/?id=ba4298b05564 ("ecn.9: Add ecn(9) manual")
1c1b494264fad5718e39b9cfaafe4f9626ee885b Pouria Mousavizadeh Tehrani 2026-03-19 17:20:47
ath11k: update module Makefile after vendor import of v6.19[-rc6]
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
09cacabd8ca0cc89c8d46b2f4c1dcdd6bb1e1cab Bjoern A. Zeeb 2026-03-12 20:24:39
ath12k: update module Makefile after vendor import of v6.19
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
03ba27c194ca5937478502cb52a0eda8146f9be1 Bjoern A. Zeeb 2026-03-12 15:47:55
pkg-serve(8): serve pkg repositories over TCP via inetd (8)
Reviewed by:  manu, bdrewery (previous version)
Differential Revision:  https://reviews.freebsd.org/D55895
b42e852e89cb04cceb6e0226d6a08cab13fb6e90 Baptiste Daroussin 2026-03-17 11:02:28
build: Boostrap LLVM_BINUTILS for cross-tools
Reported by:  vexeduxr, jrtc27
Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Pull request:   https://github.com/freebsd/freebsd-src/pull/2084
Differential Revision: https://reviews.freebsd.org/D55923
17494c6e6b7d5e2be34d2469566a59bbd9dceb8a Ed Maste 2026-03-18 15:09:53
dwcotg.4: Initial manual page
Create visibility in apropos and the Hardware Release Notes.

MFC after:              3 days
Reviewed by:            pauamma, ray
Differential Revision:  https://reviews.freebsd.org/D53287
8475cd93fb6db65a02afe435f16306bc18e96ec9 Alexander Ziaee 2026-03-20 14:42:33
krb5: append to LDFLAGS instead of replacing
Sponsored by: Netflix
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55335
632ddb864ee89c275ff5f8f9079522dec33c0d3c Chuck Silvers 2026-03-20 17:19:35
Makefile.inc1: Don't force LLVM_BINUTILS off for cross-tools
Because of this setting we were still using ELF Tool Chain tools for
buildworld.  The sets of binary utilities are largely equivalent and
this went unnoticed after commit 1cae7121c667 ("Enable LLVM_BINUTILS
by default").

This was discovered recently because ELF Tool Chain objcopy produces
standalone debug files without phdrs and this caused an issue with a
3rd party ELF parser [1].  Remove the forced setting so that we use
LLVM's binutils to build the system.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=33876

Re-commit after fixing a bootstrapping issue with LLVM binutils (in
17494c6e6b7d "build: Boostrap LLVM_BINUTILS for cross-tools").

Reviewed by:    imp, jhb
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55650
e296211fd59b6e4e0df38281a6d587b7d025f011 Ed Maste 2026-03-04 15:06:26
EC2: Add clibs-lib32 pkg to small/builder images
The FreeBSD-clang package on amd64 contains libclang_rt.asan-i386.so,
which links to the 32-bit version of libgcc_s.so.1.  It is not clear
if that file belongs in FreeBSD-clang or if it should be placed into
a different package.

For unknown reasons, pkg *sometimes* recognizes this and decides that
it needs to install a package to supply libgcc_s.so.1:32.

In particular, when we initially install the VM with 'pkg install
[long list of FreeBSD-* packages]', pkg does not recognize that it
wants this; but the *next* time 'pkg install' runs, it decides that
it needs libgcc_s.so.1:32 -- even though that particular library is
not needed by the particular package we're trying to install -- and
goes looking for it... and ends up picking gcc12-devel as a provider.

Later in the EC2 image building process, we run 'pkg autoremove' (which
was added during 15.0 to get rid of the "bogus dependencies" which were
added while installing other packages) and pkg is once again confused:
It decides that gcc12-devel is an automatic port which is not required
by anything else, but upon determining that it should be removed it
then determines that FreeBSD-clang depends upon a port which is being
removed and deletes FreeBSD-clang as well.

It's not clear what is breaking in pkg, but as a temporary workaround
add the FreeBSD-clibs-lib32 package to the "small" and "builder" EC2
image flavours in order to satisfy the libgcc_s.so.1 demand.

This commit should be reverted if libclang_rt.asan-i386.so moves out
of FreeBSD-clang, (i.e. if it becomes possible to install a 32-bit-free
amd64 system) or when the pkg issue is resolved (i.e. pkg consistently
recognizes the shared library dependency and installs clibs-lib32
automatically as a FreeBSD-clang dependency).

MFC after:      3 days
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55978
cfe0b7d37e552d78762c029f5b15e0f36d9d0d38 Colin Percival 2026-03-20 00:24:55
EC2: Remove stale comment
MFC after:    3 days
Sponsored by:   Amazon
118699732de1ec99b06d5d73ee61b1b74842c1de Colin Percival 2026-03-21 16:06:37
release.sh: document user-overriddable functions
This helps others attempting to customize the behavior of `release.sh`.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55450 (as part of a larger change)
b24fc79095c640620a643a11fa2f4f833326bfed Enji Cooper 2026-03-22 02:45:57
release.sh: add chroot cleanup routine
The chroot_cleanup routine handles any cleanup needed post-chroot_setup,
etc. This consists of purely tearing down `${CHROOTDIR}/dev` today, but
might involve additional steps, as needed for custom functions. This
allows end-users to override the various chroot functions without having
to modify code in main() or replicate the unmount procedure in an
equivalent routine setup via the trap builtin.

This change modifies the /dev unmount process to use `umount -f` instead
of `umount`. The latter can result in failures if resources are still
mounted or are running post-build, whereas the former will clean up any
resources still in use by processes running in the chroot at time of
build. Moreover, the `chroot_cleanup` routine is now called when the
script is killed with `SIGINT` and `SIGTERM`, as well as at `EXIT`,
better ensuring that the script's resources are cleaned up in relatively common
scenarios that can be detected/handled.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55450 (as part of a larger change)
60baee1fa4848ac969522e03d2c6f273f334edb7 Enji Cooper 2026-03-22 02:57:25
cross-build: Provide mempcpy when building on macOS
We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after:      1 week
47402c9422ec6c9ba76d96414f5a08bd35a9e1fd Jessica Clarke 2026-03-23 16:56:09
packages: Remove stale ftpd-all.ucl
This file was missed when ftpd(8) was removed.

Fixes:  https://cgit.freebsd.org/src/commit/?id=614c8750ce11 ("Remove ftpd(8)")
MFC after:      3 days
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55820
Sponsored by:           https://www.patreon.com/bsdivy
ea25f494b315180c4b48fcdc4d2b2a111c84912c Lexi Winter 2026-03-25 10:36:03
packages: Remove stale libsdp-all.ucl
This package no longer exists since it was merged into bluetooth.

Fixes:  https://cgit.freebsd.org/src/commit/?id=41ee4321cc52 ("libsdp: Move to bluetooth-lib package")
MFC after:      3 days
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55822
Sponsored by:           https://www.patreon.com/bsdivy
6900d8b5c3874814be4fed7ef2f6d124ebc9a920 Lexi Winter 2026-03-25 10:36:31
Makefile.inc1: Remove extraneous }
Reported by:  tijl
Fixes: https://cgit.freebsd.org/src/commit/?id=17494c6e6b7d ("build: Boostrap LLVM_BINUTILS for cross-tools")
e8dac3944dcaa7b1a2691c82def15a1ede6bcfe3 Ed Maste 2026-03-27 03:12:44
packages: Move xz to the minimal set
pkg(8), via its daily periodic script, requires xz.  We don't have
a way to encode dependencies from ports on base packages right now,
so instead move xz to the minimal set so it's always installed.

This isn't an ideal solution, but it's justified in this case since
pkg(8) is always installed, so having its dependencies always
installed is acceptable.

(Following discusson on the diff, new versions of pkg have now been
changed to use zstd instead of xz, but we still think xz is useful
enough to keep in minimal.)

MFC after:      1 week (stable/15 only)
Reviewed by:    des, bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D55630
Sponsored by:           https://www.patreon.com/bsdivy
43773002fa63262d531ce3ee5cf5d3fe872a3388 Lexi Winter 2026-03-27 14:49:30
packages: Add dependency from rc to mtree
/etc/rc.d/var_run uses mtree, which is in the devel set and isn't
installed as part of either minimal or optional, so add a manual
dependency.

Reviewed by:    des, bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D54540
Sponsored by:           https://www.patreon.com/bsdivy
833087185a6e9a2bd26707c57c83a71a541a825a Lexi Winter 2026-03-27 14:52:58
libexec: Add pkg-serve directory
Add pkg-serve to the list of subdirectories in the Makefile.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=b42e852e89cb ("pkg-serve(8): serve pkg repositories over TCP via inetd (8)")
Differential Revision:  https://reviews.freebsd.org/D56009
4f0d0ed5cbe6d66c496ed124110e24fb6092d480 Jose Luis Duran 2026-03-29 16:13:09
mk: Disable blacklist when disabling blocklist
WITHOUT_BLOCKLIST, when set, should enforce WITHOUT_BLACKLIST.
This fixes the build when WITHOUT_BLOCKLIST=yes is set.

Reported by:    ivy
Reviewed by:    ivy
Fixes:          https://cgit.freebsd.org/src/commit/?id=7238317403b9 ("blocklist: Rename blacklist to blocklist")
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56118
0d9676e1ca92febd42fbebef8d6833a0939d3f7c Jose Luis Duran 2026-03-29 16:14:50
packages: Fix caroot deinstall command
The correct syntax is 'post-deinstall', not 'post-uninstall'.

MFC after:      3 days (stable/15 only)
Reviewed by:    jlduran, des
Differential Revision:  https://reviews.freebsd.org/D56109
Sponsored by:           https://www.patreon.com/bsdivy
63ecedb3c2ce75a44d55b9424d74d94e294de313 Lexi Winter 2026-03-29 18:57:23
LinuxKPI wlan drivers: update makefiles to not use WITH_
Up to now the LinuxKPI wlan drivers were using local variables starting
with a WITH_ prefix in their Makefiles.
That is likely to collide with other mechanisms like WITH_ and WITHOUT_
from src.conf.
Adjust the local variables to use a driver name prefix for now to control
what is built and what is not.
These variables are mainly for the time of development so we can
turn off/on a feature or bus attachment while working on it.  Otherwise
they are there for documentation purposes.  The only reason one would
change them locally would be if someone was to build a very custom
image and not want certain bits (e.g., USB support) being compiled into
the modules.

While here, try to harmonize some parts of the Makefiles.

Suggested by:   imp
Discussed with: imp
Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D55977
e8166d7f378bb449315aff535909c153f3e71daf Bjoern A. Zeeb 2026-03-19 23:02:05
vmgenc.4: Add VM Generation ID Counter manual
Document the vmgenc(4) ACPI driver which detects virtual machine
cloning and snapshot restoration via the VM Generation ID
specification. The driver reseeds the kernel entropy pool when
a generation change is detected.

MFC after:              3 days
Reviewed by:            cem (previous), ziaee
Signed-off-by:          Christos Longros <chris.longros@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D56011
59cb18f35617d3a53f7d7e142b4f91ad7951f5e0 Christos Longros 2026-03-31 02:24:16
Makefile.inc1: Drop AS and RANLIB variables
These are not used in our world and kernel build targets.  We use the
compiler driver for assembly, and ar adds the archive index (symbol
table) automatically.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55964
9b1f77e647a8a31993491ba3f5a64090756b7398 Ed Maste 2026-03-18 17:06:36

Internal organizational stuff

copyright: Happy New Year 2026!
We are now one quarter into the 21st century.
8f41677ea4963254a3a190ede7cea16f2486cb1d Xin LI 2026-01-01 00:29:23
git-arc: Try to make patching more useful
Add a raw mode, which fetches the patch file and applies it manually
rather than using arc patch.  This is handy because arc patch will
always try to fetch your remotes if it can't find the base commit in
your repo (even if you ask it not to make a commit).  This is basically
unusable in some of my workspaces where I have 20+ remotes configured,
some of which may be unreachable.

Add a stack mode, which causes git-arc to recursively apply parent
revisions, going up the patch stack.  Thus, to apply a full patch stack,
just apply the final patch with -s.

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D54403
684c762485d31d769b9e1ebeaababa31f684d2de Mark Johnston 2026-01-05 14:17:11
git-arc: Try to improve documentation
When I originally wrote git-arc, the usage string was the documentation.
Later, a man page was added, largely copied from the usage string.  Over
time they have diverged slightly.

It is silly to have two copies of the same information, so let's make
the man page the source of truth.

While here, document some options for git-arc-patch and rewrite a few
sentences here and there in a way that I hope is clearer.

Reviewed by:    ziaee, ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D54405
1c8dafe618878c563c3740061f83a85b0be10720 Mark Johnston 2026-01-05 14:17:21
MAINTAINERS/CODEOWNERS: Add myself to mpr, mps and mpi3mr
Yea, I realize these are decaying, but I'm going to take a run at
automatically tagging reviews for github pull requests. I suspect that
tagging will help with the 'stale' issues with at least CODEOWNER.  As
better data becomes available, especailly for contrib, I'll update
things.

Sponsored by:           Netflix
9b54998d1bdd5098d5538052024f88edcd625b4f Warner Losh 2026-01-11 06:22:41
.github: Disable checklist workflow on forks
Reviewed by:  imp
Obtained from:  CheriBSD
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1973
3a6289e1e53ffe11b91b754d3b8241001b2cbfb8 John Baldwin 2026-01-19 15:56:20
MAINTAINERS: remove stale entry
76ca619f10cc4f75e2eb5750f905f6bc55c8ef02 Warner Losh 2026-01-21 14:39:59
CODEOWNERS: Add myself for openssh and makefs
37de3763b8d589c6916a1207bb46bbaefb75b4c3 Ed Maste 2026-01-21 15:09:05
CONTRIBUTING.md: Tweaks for clarity
Add a few tweaks to clarify the author and signed-off-by lines. Add
clarifying note about the style checker. Refine the AI statements
for clarity, but these will need to be revised once the AI policy
has been completed.

Sponsored by:           Netflix
6b9cbeed643756e90b6323f5b735f9765dcda0ad Warner Losh 2026-01-23 14:00:11
MAINTAINERS: Remove some stale entries
Remove some stale entries, preen some others. Longer term, we need a
better format. Also, if there's mistakes, let us know: we want it to be
useful to people seeking review, not be perscriptive about who can do
what.

Reviewed by: srcmgr@
4990cf83f5fa474f619293c8c8ed1c8ba4b74692 Warner Losh 2026-01-23 18:03:26
CODEOWNERS: Add myself to capsicum-test
5b036b25853349cd3cf26495e628276f79f29c42 Ed Maste 2026-01-27 15:28:39
CODEOWNERS: Add myself to Heimdal and MIT KRB5
19a913c4ed9df1b220dfedfe02ee4d8d90cbccce Cy Schubert 2026-01-27 15:47:36
CODEOWNERS: Add myself to WPA
af9d11303c9bba56d78c79d2b4832f3549f4f0d3 Cy Schubert 2026-01-27 15:49:29
ObsoleteFiles.mk: Remove obsolete MIT KRB5 plugins
d0309745e621dd0554f271f4b7e2bc5e8ff597e4 Cy Schubert 2026-01-19 15:51:47
committers-ports: Belatedly add jwb
8c40c7bb361f0c8b595bfee9dc6f8790e0eb6d68 Alexander Ziaee 2026-02-05 14:12:29
MAINTAINERS, CODEOWNERS: Update capsicum-test
Fixes: https://cgit.freebsd.org/src/commit/?id=670b568ec1c3 ("capsicum-test: Move out of contrib")
Sponsored by: The FreeBSD Foundation
b773da180e02c0c27de48dbba72f3fb7a64656da Ed Maste 2026-02-05 18:21:27
MAINTAINERS, CODEOWNERS: Add myself for vt(4) review
d255b40e2dcce2ec085931bdbd19520bca9136ec Ed Maste 2026-02-08 17:41:58
CONTRIBUTING.md: Fix links to section
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2010
dac3b99e8d8cac2f19e3812c1e126801bdef8088 Minsoo Choo 2026-02-09 05:33:48
ObsoleteFiles: remove the shar(1) manpage as well
Fixes:        https://cgit.freebsd.org/src/commit/?id=3fde39073c ("shar: remove from the tree [...]")
bb0734cf2446ce2be829edfa421af3aa558d2c70 Herbert J. Skuhra 2026-02-09 14:47:41
CONTRIBUTING.md: Clarify GitHub pull requests
Make the guidelines more prescriptive (while remaining clear that Pull
Requests are merely one, not-preferred method for submitting changes).

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55089
97beb0c9116f312c1820adb94455dc3b9a157135 Ed Maste 2026-02-09 15:44:15
ObsoleteFiles.inc: correct entry for zpfind.9.gz
It needs the .gz suffix.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2ace05b65a2c9 ("pfind(9): follow-up fixes and improvements")
9c800a103c03dd4a32f1f6ac8f409fe38f304848 Herbert J. Skuhra 2026-02-09 19:50:04
ObsoleteFiles.inc: remove stale allwinner pages
These were moved out of man/man4/arm into man/man4. Add entries to catch
the stale copies.

Fixes:  https://cgit.freebsd.org/src/commit/?id=15c79c6fa608 ("man4: move allwinner pages and logic to a standard place")
1c9ca4cf71841d5f6cee070143b9e29d541e4124 Herbert J. Skuhra 2026-02-09 19:56:47
rtw88: remove more references to rtw88fw
When I removed the Realtek rtww8x firmware from base I missed to
add rtw88fw.4 to ObsoleteFiles.inc [1].
While adding this, also remove a leftover reference in rtw88.4.

Reported by:    Herbert J. Skuhra (herbert gojira.at) [1]
Fixes:          https://cgit.freebsd.org/src/commit/?id=cf94672363d6
MFC after:      3 days
3f4213f00ac5eea0a56cebeb1ba9f64a2489a956 Bjoern A. Zeeb 2026-02-10 13:30:53
prepare-commit-msg: Sync with committers guide
Add `Discussed with:`, `Closes:`, `MFC to:`, and `Co-authored-by:` to
the commit message template from the committer's guide. While here,
wordsmith these to fit on standard console.

Reported by:            lwhsu
Discussed with:         emaste, jlduran
Reviewed by:            vexeduxr
Differential Revision:  https://reviews.freebsd.org/D54707
261ed379c88a99fa9cb6239a85798f0e578aa485 Alexander Ziaee 2026-02-12 04:46:16
committers-ports: add andy
Following up ziaee's pattern, and add andy's line.
I'm not sure whether the original commit bit creation date should be used,
and use commit bit re-activation date for now.

MFC after:      1 week
0d9b5db9fc652e79e4eb08a2f583e9b825a50b92 Dmitry Morozovsky 2026-02-12 06:08:30
ObsoleteFiles: Deduplicate
Since we dropped support for profile libraries, all optional entries for
them are now non-optional.  Most of them were already duplicated there,
a few were not.

MFC after:      3 days
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D55329
f9f4a022a8583763903771915eafcd064184766a Dag-Erling Smørgrav 2026-02-17 22:58:31
CODEOWNERS: Add myself for sys/arm64/vmm
Sponsored by: Arm Ltd
a6ad3d4ca05058b2b78f91be941e1da0bb272ff5 Andrew Turner 2026-02-17 09:52:47
Use OLD_FILES for libtpool symlink and static libraries
Fixes:                https://cgit.freebsd.org/src/commit/?id=b78806b156f7 ("Remove additional libtpool and libuutil-related files")
a346348e45ec9f61c9fcc0e8f16042cc98f405f0 John Baldwin 2026-02-18 15:47:18
git-arc: Tweak heuristic for email address
In the email address heuristic, assume guest-* are external
contributors. It's a new convention, apparently.

Sponsored by:           Netflix
4fb507cae916d04fcd1e80e69923c5ca5c4340eb Warner Losh 2026-02-09 16:14:16
.github: support all stable branches
If this eventually poses a problem for unsupported branches we can fix
them directly.

Sponsored by:   Innovate UK

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53838
1e189279576497498cafad6f8c0a36a377b786a3 Brooks Davis 2026-02-19 14:43:57
CONTRIBUTING.md: Github to Phabricator move adivce
When moving from Github to Phabricator, request that the original github
pull request be closed with the URL of the Phab. This cuts down on
clutter and helps us track things better.

Sponsored by:           Netflix
80950a079b20ed59616525fbca8ccaf3b6afcebc Warner Losh 2026-02-21 15:28:21
.gitignore: ignore additional unwanted files
Ignore more files generated by toolchains, e.g., `.pico`, etc. Ignore the
`.DS_Store` produced by macOS as well because all they provide is
additional file metadata that shouldn't be committed to `git`.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55096
4544f34f2d30ee63ab1eec9fa52c31bd92d457ca Enji Cooper 2026-02-04 07:39:03
Add records about new ports committer (nxjoseph)
Update Mentor and Mentee Information to follow step
5 of the Committers Guide.

Reviewed by:    osa, vvd (mentors)
Approved by:    osa (mentor)
Differential Revision:  https://reviews.freebsd.org/D55457
477ab960440c5284fb5819c63c6f03aa15606def Yusuf Yaman 2026-02-23 16:04:02
sanitize.lua: A tool to extract interfaces from files
This is a simple too to remove all comments, extra whitespace and other
unnecessary things that may have creative content. What remains can be
just the minimal interface described by the header file. When used with
care, this can mechanically sanitize files, like some device tree
bindings file, that are only #defines that are meant to be used in
multiple context (the dts files and in C code to interpret the resulting
dtb).

Sponsored by:           Netflix
Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D55087
7951411672fab14367d9e785bfc6fe7d9a29668c Warner Losh 2026-02-27 00:40:10
Add .editorconfig
FreeBSD developers use different text editors or sometimes use GUI
editors such as VSCode or Zed on different platforms for convinence.
However, there is lack of unified config for those editors to follow
style(9) including indent rules.

Although most "modern" editors support .editorconfig out of box, basic
editors such as vim needs a plugin for autoloading .editorconfig file.

Sponsored by:   The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2024
75858ca528bfdef7101ac493baa1b43616c4153c Minsoo Choo 2026-02-15 19:14:28
bsd-family-tree: add FreeBSD 14.4
d1180d47c9653335c75f6ec9e18eff19109f0119 Maxim Konovalov 2026-03-10 01:42:40
calendar.freebsd: add myself (khorben@)
This adds my date and place of birth to FreeBSD's calendar file, so I
can let the system(tm) remind me when that counter increments.

Confirmed to be working with the following command:

```
$ calendar -f usr.bin/calendar/calendars/calendar.freebsd -t 18.08
Aug 18  Pierre Pronchery <khorben@FreeBSD.org> born in Nantes, France, 1982
[...]
```

Reviewed by:    philip (mentor)
Approved by:    philip (mentor)
Differential Revision:  https://reviews.freebsd.org/D55825
4c72e5cde0177f19fd10f8bbd6005882075a7830 Pierre Pronchery 2025-11-25 09:51:57
committers-ports.dot: Add new committer (mce)
Update Mentor and Mentee Information.

Reviewed by: osa, fluffy (mentors)
Approved by: fluffy (mentor)
Differential Revision: https://reviews.freebsd.org/D55839
fa341366b1de86ed97e909bfd10241d590212fe2 Kousuke Kannagi 2026-03-13 18:04:12
committers-ports.dot: Add new committer (laurent)
Update Mentor (thierry) and Mentee (laurent) Information.

Reviewed by:    thierry (mentor)
Approved by:    thierry (mentor)
Differential Revision:  https://reviews.freebsd.org/D55856
4efe7fa072d5ec47b673a3c82393c7db9a3568c0 Laurent Chardon 2026-03-14 09:09:08

Testing

Convert fully to Python 3. Remove licence text, only keep
SPDX.

Update to use argparse rather than OptionParser (now deprecated).
eb1c0d74cbb99f329767b3d565ae57a3ec032bee George V. Neville-Neil 2026-01-05 11:40:12
Start adding an exercise mode for programs under test.
In exercise mode we collect data for every available counter on a
program and keep all of that in a directory in /tmp.
4a1b69ade6b5e8665dfb4d0cb683854705192a68 George V. Neville-Neil 2026-01-05 12:30:22
Commit group #81: makefs
makefs: tests: Double the timeout of ZFS compression test

The test makefs_zfs_tests:compression is timing out on ci.freebsd.org.
Double the default timeout to allow it to finish.

While here, check if the file exists before cleaning up, otherwise, cat
may fail.

Reported by:    Jenkins
Reviewed by:    asomers
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54424
9f28e92637e9a29124f407b74d7665a921865a53 Jose Luis Duran 2026-01-05 20:31:40

makefs: tests: Double the timeout of ZFS file_extend test

The test makefs_zfs_tests:file_extend is timing out on ci.freebsd.org.
Double the default timeout to allow it to finish.

Reported by:    Jenkins
Reviewed by:    asomers
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54425
065f02174f76a49fbf537ee51ed8068d3d398b08 Jose Luis Duran 2026-01-05 20:32:24

makefs: tests: Cleanup and remove default flags

Cleanup and remove default atf_check flags for clarity.  The following
two lines are equivalent:

    atf_check $cmd
    atf_check -s exit:0 -e empty -o empty $cmd

Update the links to the reference documents.

Remove the D_flag_cleanup function, as common_cleanup() for these
particular set of tests does two things:

1. Unmount the md(4) device.
2. Destroy the md(4) device.

Essentially, one should only call common_cleanup() if the test body
invokes mount_image().  This is not the case for D_flag_body().

No functional changes intended.

Reviewed by:    ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54427
0a6deb87c2802a47709c58d09b5f9122ed40c157 Jose Luis Duran 2026-01-05 20:32:46

makefs: tests: Fix -D flag test

As stated in the manual page:

-F is almost certainly not the option you are looking for.  To
create an image from a list of files in an mtree format manifest,
specify it as the last argument on the command line, not as the
argument to -F.

This change does exactly that.  Also bug #192839 has already been fixed.

Reviewed by:    ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54428
96efda9cd55689ef3fa067281d8b0a42a7122536 Jose Luis Duran 2026-01-05 20:33:27

makefs: tests: Fix timestamp-related tests

Use a variable for mtree that includes the DEFAULT_MTREE_KEYWORDS, in
order to avoid missing the important "time" keyword or passing an
unimplemented "nlink" keyword.

Unskip the "failing" tests, and comment out the specific failing checks,
these will be addressed (or at least discussed) in a different revision.

For MS-DOS tests, use an even value timestamp, as precision is 2s.

For ZFS tests, use import_image instead of mount_image consistently.

Reviewed by:    bnovkov, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54429
93b15dbc1fbc3c33c9bd53091b28c3b629d0abe1 Jose Luis Duran 2026-01-05 20:34:03
Correct the data collection arguments. Add proper tempdirs.
e018fedef0a6389240322da9fa4b9fa9971f6e59 George V. Neville-Neil 2026-01-06 08:17:38
Split counting from sampling.
77153a491e3b31475f5faddb21271a0a8e0d4a9b George V. Neville-Neil 2026-01-06 08:55:14
pf: tests: Require python3
Reported by:  Jenkins
Reviewed by:    kp, ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54549
301bc149b96e54af4ebfba2822f4b7b411bb76c1 Jose Luis Duran 2026-01-07 17:51:57
tests: Increase timeout
Bump the timeout value, to avoid cutoff on emulated architectures on
ci.freebsd.org.

Reported by:    Jenkins
Reviewed by:    ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54550
47015e4546619151f9bff548a3758b72286d04ed Jose Luis Duran 2026-01-07 17:52:26
Extend the script to collect gprof data
While we're at it, switch to simple waiting from communicate() calls.
e2bedc7d69926426a710d035df51e0a0812d38b1 George V. Neville-Neil 2026-01-08 04:13:04
tools: remove powerpcspe
As reported on the freebsd-announce mailing list[1] FreeBSD is
continuing to retire 32-bit support.  Remove powerpcspe from boot test
tools.

[1] https://lists.freebsd.org/archives/freebsd-announce/2024-February/000117.html

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    jhibbits, emaste
Pull request:   698d3c98d8f5814f705908d5bc6d930e3d4c4eda
0f937f171a8da9fa8cbbd060632e271e150c3acd Minsoo Choo 2025-12-03 03:51:59
Commit group #82: syslogd/tests
syslogd/tests: Use a helper function to log from within a jail

This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change intended.

Reviewed by:    jlduran
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54778
ffdbc1bc2170226547fcad036f01f379625886dd Mark Johnston 2026-01-22 15:50:14

syslogd/tests: Address races

I occasionally see failures in the syslogd test suite.  The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file.  If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.

This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
   variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
   wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
   the last line of SYSLOGD_LOGFILE, instead of using atf_check
   directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
   appears, or the test times out.

With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures.  Without the change
I usually get a failure within 10 loops.

Reviewed by:    jlduran
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54779
560c22937ba96e8bab57de395dcf340ecf8d6794 Mark Johnston 2026-01-22 15:50:25

syslogd/tests: Improve loopback interface initialization

- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by:    jlduran
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54799
92d251472edba6c1c16a899797982251c585d706 Mark Johnston 2026-01-22 15:51:42

syslogd/tests: Fix flakiness in forwarding tests

syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon.  Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by:    jlduran
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54800
14dce731d70686e08ed689729f53c6a5e2225498 Mark Johnston 2026-01-22 15:52:00
tests/kern: add test for SSL_sendfile()
37d11fde8f581a1d18c2fea235085d0d63e09384 Gleb Smirnoff 2026-01-21 04:05:21
stress2: Added two syzkaller reproducers. Updated the exclude file
833f9294b46856dce3028a8ecb65663ed422b629 Peter Holm 2026-01-24 12:28:54
stress2: Added two new test scenarios
c2b513335f688ac5657abc1bc40f6848988958d7 Peter Holm 2026-01-24 12:30:31
fusefs: Add tests for the new -o auto_unmount feature
Add tests for mount_fusefs's new -o auto_unmount feature, recently added
by arrowd.

MFC with:       10037d0978f "fusefs: Implement support for the auto_unmount"
ffb747d587bf09a982df67fba322b91d02f70be6 Alan Somers 2026-01-19 19:11:46
makefs/zfs/tests: Force-destroy md devices
Most of these tests create a md(4) device backed by a makefs-generated
image, then import the pool, using the md device as a pool vdev.  When
a test finishes, it destroys the pool, then destroys the md device.

Once in a while md device destruction fails with EBUSY.  This happens
when a GEOM consumer is holding the device open; kern_mddetach_locked()
simply fails if any consumers are present.  zpool destruction is
synchronous so ZFS is innocent, rather, the problem seems to be that
GEOM re-tastes the device after the zpool reference goes away.  This
operation creates a transient reference that causes the spurious
failure.

Use "mdconfig -o force" to work around this.

MFC after:      2 weeks
d6bc31f92991b6d67da54868f3563278015389ca Mark Johnston 2026-01-25 15:12:19
procdesc: Add a test for pid recycling behavior
MFC With:     09984871d8caff9263b955a94bb9fb5354af1b4c
Sponsored by:   ConnectWise
e35df41f68916cc23893a29e0284f386ec727462 Alan Somers 2026-01-13 00:45:23
Add tests for pdrfork
MFC With:     5c2ee618d5ec21f110c4da40e9f17833b2ab8b76
Sponsored by:   ConnectWise
d1e6057fa47e842c63461b64b29ac5d3e9fdad76 Alan Somers 2026-01-25 16:13:43
Add tests for pdwait
MFC With:     4d707825bf62ee73a32b615846eff9c4a9bda538
Sponsored by:   ConnectWise
277539ae7f2f07a8dd29d4deb318d66414f8ae2a Alan Somers 2026-01-25 16:14:03
pf tests: Set require.kmods in divert-to tests
Tests should declare their dependencies rather than testing for them at
runtime.

Reviewed by:    igoro, kp, glebius
MFC after:      2 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54846
8934c3dc780d6631cb23e4d98c7b988da9a5b703 Mark Johnston 2026-01-26 17:24:25
tests/kern: make ssl_sendfile:truncate and ssl_sendfile:grow less flaky
First problem is a trivial race that the client thread doesn't see updated
c.sbytes.  Second problem applies only to the truncate test.  On a machine
with huge default buffer sizes, there is a chance that sendfile(2) will
fill both buffers with amount of data that is larger than the size we plan
to truncate.  To minimise chances for this scenario, increase file size
and truncate it less aggressively, also try to decrease buffer sizes.
8a9508563542d709b1a42a065e6e99e004a8b3fe Gleb Smirnoff 2026-01-27 21:13:11
capsicum-test: Move out of contrib
Google developed the Capsicum unit test suite[1] as part of the
Capsicum-Linux[2] project, based on unit tests that existed in FreeBSD
and unit tests developed as part of the initial Capsicum-Linux port.

Capsicum-Linux was archived as of October 31, 2022 and is no longer
being maintained.  FreeBSD is currently the only consumer of and
contributor to the test suite.  Move the src into tests/sys/capsicum to
simplify ongoing maintenance.

The makefiles were deleted as we (continue to) use the existing bespoke
FreeBSD Makefile, and CONTRIBUTING.md was removed as the Google CLA is
no longer applicable.

[1] https://github.com/google/capsicum-test
[2] https://github.com/google/capsicum-linux

Reviewed by:    asomers, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54917
670b568ec1c36464c6d55e400382c290b0391ccf Ed Maste 2026-01-27 13:28:23
Commit group #83: touch
touch: Tests for -h flag

Reviewed by:    kevans
Approved by:    kevans
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54836
21efed6cd8442ba9abb6c8a7e54a2433de9bfc60 Aymeric Wibo 2026-01-23 17:48:13

touch: Test for -a flag

Reviewed by:    kevans
Approved by:    kevans
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54852
578b4ec8f1a4134027e66a156e6cf801284aab14 Aymeric Wibo 2026-01-23 22:57:58

touch: Test for -m flag

Reviewed by:    kevans
Approved by:    kevans
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54853
5a733026088f68a0171584045af968d1ea83804b Aymeric Wibo 2026-01-23 22:59:48
ip6_output tests: Remove an unused import
No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
1539a657adb4363e7f12d6fd4c1c8ed2e2d842af Mark Johnston 2026-01-30 15:27:22
atf_python: Run vnet handlers in $HOME
When kyua runs a test, it creates a temp directory and sets $HOME to
point to it.  Tests are run with the cwd set to that temp directory.

When a process attaches to a jail, its cwd is set to the root of the
jail.  Modify atf_python to cd to $HOME instead, so that it's easier for
tests to share files.

Reviewed by:    zlei, ngie
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54971
07940d1d85eb338853fcba0697c6b9a96412a7f2 Mark Johnston 2026-02-02 14:52:43
tests/netgraph: fix tests that depended on connect(in6addr_any)
32c3723f06554db7d0da49c6f361c7b8f1a394c1 Gleb Smirnoff 2026-02-02 20:15:26
libc/tests: Clean up *dir() tests
Mainly, avoid reusing the name of one of the functions we should be
testing (but aren't) for local variables.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55054
d70b9eb74fc4aa430bd2ff4bca37e6a9b6c8004f Dag-Erling Smørgrav 2026-02-03 14:39:21
m4: Convert tests to ATF
MFC after:    1 week
Sponsored by:   Klara, Inc.
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55115
16e073df4a33646fa0e0fba5b41ddc6b44df3605 Dag-Erling Smørgrav 2026-02-07 18:16:17
pwd: Add tests
MFC after:    1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55153
36ec2b1c104f9e5383a160e21109e1308fce0364 Dag-Erling Smørgrav 2026-02-10 14:29:08
stress2: Limit output from test
2b061bd1796dc50eddc41b57f8ecd4596235a657 Peter Holm 2026-02-12 10:31:36
stress2: Fix cleanup
83693c121aecccf3499c52fcf409157ee604cd53 Peter Holm 2026-02-12 10:32:24
mixer/tests: use require.kmods property instead of ad-hoc checks
Reviewed by:  christos
Approved by:    lwhsu (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55221
5fa297f4bcd277dca7eef03e68363fb1e721799e Siva Mahadevan 2026-02-11 21:50:00
pf tests: verify blocked count on log interface
Also check the IPv6 pass/block numbers.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291763
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
d03b6bb766f8c816547f9c39e05af8238242251e Kristof Provost 2026-02-12 13:06:34
tests: Simplify libarchive tests
The ATF tests work by first running the test program with an invalid
flag, which causes it to print an error message, a summary of options,
and a list of available test cases.  Switch to the new -l option which
simply prints the list, and simplify the awk script used to parse the
output.  No functional change.

MFC after:      1 week
394201ce5b4e2f84f1e39a7ce8bdc3f5a5ef8390 Dag-Erling Smørgrav 2025-12-06 13:48:32
atf_python/vnet: Make it possible to set the FIB of vnet interfaces
Reviewed by:  zlei, ngie
MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54972
a8b8feced998c8c74f9a572f069bcb689cabd09d Mark Johnston 2026-02-13 15:50:39
diff: Tweak recursion tests
The -r flag is not required to compare two directories; it is only
required to compare them recursively, i.e. descend into their common
subdirectories.  Adjust tests that use -r needlessly, and adjust the
dirloop test to verify that these two cases remain distinct.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55262
b2532432971fbd9339a9a49eca1b532978bb6d48 Dag-Erling Smørgrav 2026-02-13 20:18:30
Commit group #84: pdrfork(2) tests
pdrfork(2) tests: RFPROCDESC|RFPROC are required

Tested by:      pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
68ba270f4fc7799929a3d59d710f44e5e9087def Konstantin Belousov 2026-02-15 15:00:57

pdrfork(2) tests: do not rely on (int *)-1 being invalid address

Explicitly mmap guard and use it as the invalid address instead.

Tested by:      pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
d6bf2d14a941a88e27a82a3f91790353e134b8f6 Konstantin Belousov 2026-02-15 15:09:48

pdrfork(2) tests: catch runaway child for EFAULT test

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
44843695bc4e36abd15835d627da7d38c06f2219 Konstantin Belousov 2026-02-16 10:04:26

pdrfork(2) tests: split basic_usage

into pdrfork(2) call itself, and basic_usage_tail() that checks the
pdrfork(2) results.

Tested by:      pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
94e4de77dec809fa5a6975e3495a41d1924c25ad Konstantin Belousov 2026-02-15 15:22:19

pdrfork(2) tests: should wait for the child to exit

Tested by:      pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
f90ee665d035a5e4aea0bcaa18793e683ea253ed Konstantin Belousov 2026-02-15 16:53:48

pdrfork(2) tests: enable on x86

Use pfrfork_thread(3) instead of pdrfork(RFSPAWN) to make tests working
on x86.

Tested by:      pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55306
793e891f4ad1ef450f562a241fb0bd3b21d72251 Konstantin Belousov 2026-02-15 15:23:03
pdwait(2) tests: do not rely on (int *)-1 being invalid address
Explicitly mmap guard and use it as the invalid address instead.

MFC after:      1 week
05492ff6f636108c4fac40c259defe9b2eac7833 Alan Somers 2026-02-17 00:25:58
aio(4) tests: do not rely on (int *)-1 being invalid address
Explicitly mmap guard and use it as the invalid address instead.

MFC after:      1 week
dc9a8d300ba5c4c319589d78231e9d0e76576cbf Alan Somers 2026-02-17 00:27:02
capsicum-tests: remove Linux support
Now that this project is part of freebsd-src, it no longer needs to be
portable.  Remove Linux-only tests, cross-os compatibility code, and
compatibility with older FreeBSD versions.  Leave in place some
originally Linux-only tests that could now be ported to FreeBSD, like the
pipe2 tests.

Sponsored by:   ConnectWise
Reviewed by:    oshogbo
Differential Revision: https://reviews.freebsd.org/D54985
fba81b33aabff74ad03d5f9f9663c176cf060fa6 Alan Somers 2026-01-29 20:39:20
ndp tests: Fix an assertion in ndp_prefix_lifetime_extend
Here we have two interface addresses sharing a v6 prefix with finite
lifetime.  The intent was to make sure that adding the second address
didn't cause the prefix's valid lifetime to drop from 20s to 10s, but of
course, while the test is running it may drop from 20s to 19s, causing
the test to fail spuriously.  Relax the check a bit to avoid this.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293152
Fixes:          https://cgit.freebsd.org/src/commit/?id=74999aac5eff ("in6: Modify address prefix lifetimes when updating address lifetimes")
MFC after:      1 week
Sponsored by:   Klara, Inc.
eb425dfab19be8720cf29d560b4e778fc3531106 Mark Johnston 2026-02-17 17:08:34
ndp tests: Fix flakiness in ndp_slaac_default_route
The test sends RAs in order to test SLAAC handling in another host.
The router needs to also set net.inet6.ip6.forwarding=1, otherwise NAs
sent from it have the ROUTER flag clear, and upon receiving such an NA
the host will automatically delete routes learned from the router.

Fixes:          https://cgit.freebsd.org/src/commit/?id=feda329622bc ("netinet6 tests: Add a regression test for default router handling")
MFC after:      1 week
Sponsored by:   Klara, Inc.
1eb727727a9acb5f1e66e3f70b0146e7c9c5f710 Mark Johnston 2026-02-17 19:03:35
tests/ipfw: fix log:bpf test flakyness
There were several problems:

o Using 'netstat -B' is not a reliable way to make sure that all tcpdumps
  have attached to bpf(4).  The problem is that tcpdump (via libpcap) does
  several ioctl(2)s after the attach including two BIOCSETF.  Each of them
  flushes the input buffer.  So we can see tcpdump attached in 'netstat -B'
  and start sending packets and the packet will be captured by bpf(4)
  before BIOCSETF and freed and tcpdump won't read anything.  Instead of
  using netstat(1), use ps(1) and make sure each tcpdump is blocked on the
  "bpf" wait channel, which guarantees it is done with ioctl(2)s and is now
  blocked in read(2).
o Using 'nc -w 0' sets timeout not only on the connect(2) (as documented)
  but also on poll(2), which is not documented.  There is a race in shell
  that will make stdin not yet filled by 'echo foo' when nc(1) does
  poll(2).  With zero timeout, this poll(2) will immediately return and nc
  will exit.
o The waiting loop had two errors: using wrong variable name as well as
  invoking a subshell, that actually can't wait on the pid.
o The reading tcpdump was lacking '-q' option, that prevents any protocol
  interpretations.  Sometimes, when random port chosen by nc(1) would
  match some well-known (to tcpdump) port, the output would differ from
  the expected.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293241
38edf96b1787ce3d8c00e4466348dab891c7a9ea Gleb Smirnoff 2026-02-19 02:39:00
syslogd/tests: use kern.features to detect INET support
This fixes INET feature detection with kernel configs
that do not include the kern.conftxt sysctl, such as
riscv64 currently[0].

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/usr.sbin.syslogd/syslogd_forwarded_format_test/O_flag_bsd_forwarded_legacy/

Reviewed by:    markj
Approved by:    emaste (mentor)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55383
c721ceeb3ef0b29d06e6c3c634579f3bc85cc28b Siva Mahadevan 2026-02-19 20:53:26
system(3): Write our own tests
Replace the somewhat perfunctory NetBSD tests with our own.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    bnovkov, kevans
Differential Revision:  https://reviews.freebsd.org/D55482
7a1ade5109ac57d1f59eaa75b5d0f13fabecf6ba Dag-Erling Smørgrav 2026-02-25 21:12:29
ed: add unicode test cases to ATF test suite
Including examples in Cyrillic suggested by kib@

Differential Revusion:  https://reviews.freebsd.org/D55364
7c2c2c2a2253370c88fe428cf1c0ecebd68fe864 Baptiste Daroussin 2026-02-17 16:38:29
Allow programs run under this program to have arguments.
bc9229035c5f46674cf06b48d66e9f039b3a9875 George V. Neville-Neil 2026-03-03 17:10:26
tests/net/bpf: hexdump(3) the packets if compare fails
d4083fb836cf5d06a2bc2d6fe7297fb5139c8fc6 Gleb Smirnoff 2026-03-05 03:57:59
tests/net/bpf: skip the bpf:inject test when RSS is present
With RSS the epair(4) may reorder packets making the test flaky. See
net/if_epair.c:epair_select_queue().
1abb62867f2a36acb689fdfed62af00b78d8f324 Gleb Smirnoff 2026-03-05 04:04:11
stress2: Added a new test scenario
05cbd5fc2b481d6503c69be95fe9a6d9a287bc6d Peter Holm 2026-03-06 09:03:11
stress2: Updated comments
b15dc3ff28dbb2c3f8eec51803dbca7569439773 Peter Holm 2026-03-06 09:03:53
Commit group #85: system(3): Address test robustness issue
system(3): Address test robustness issue

Don't assume that SIGINT and SIGQUIT are set to SIG_DFL at the start
of the test.  Instead, retrieve their current dispositions and verify
that they are restored at the end of the test.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55709
48368f702423742b2a7dff7ad3191625e8bf26f0 Dag-Erling Smørgrav 2026-03-09 20:41:04

system(3): Fix brain glitch in previous commit

We were saving SIGINT twice instead of SIGINT and SIGQUIT.

Also restore original order of operations (SIGINT then SIGQUIT), which
matches the order in which they're discussed in the POSIX description
of system(3).

MFC after:      1 week
Sponsored by:   Klara, Inc.
Fixes:          https://cgit.freebsd.org/src/commit/?id=48368f702423 ("system(3): Address test robustness issue")
863b5c137a98d29dc6964cba0e0c4fe2a8bebab8 Dag-Erling Smørgrav 2026-03-09 21:00:52
tests/kern/ssl_sendfile: reduce copy & paste
Provide sendme_locked_wait() for a common pattern.  Not functional change.
35b976c6ce6145678ab378b21fdeab687a0a76d5 Gleb Smirnoff 2026-03-10 17:36:21
tests/kern/ssl_sendfile: fix 'random' and 'basic' flakyness
The read of c.sbytes needs to be synchronized with mutex.  The problem was
fixed for 'truncate' and 'grow' with 8a9508563542, but these two suffer
from the same problem.  Provide require_sbytes(), a locked wrapper around
ATF_REQUIRE() to reduce copy and paste.

Submitted by:           olivier
Differential Revision:  https://reviews.freebsd.org/D55781
ded881f9056d2ecb224490e56e95877af54164c4 Gleb Smirnoff 2026-03-10 21:02:02
yes: Add tests
MFC after:    1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55802
67728a18b9c18e55cc60e063380825b80f25b1b9 Dag-Erling Smørgrav 2026-03-11 03:44:10
Commit group #86: tests/netinet: provide test for raw_ip.c:rip_input()
tests/netinet: provide test for raw_ip.c:rip_input()

The test creates differently bound SOCK_RAW sockets and sends different
probe packets.  There is expected results matrix that every probe is
checked against.
c1481c9f4a425db7295332be87f837bfb7d127df Gleb Smirnoff 2026-03-17 22:15:43

tests/netinet/raw: fix ssize_t printf(3) format

Fixes:  https://cgit.freebsd.org/src/commit/?id=c1481c9f4a425db7295332be87f837bfb7d127df
cc6672235c3bbd12fd6006934ba328c5a85f2c3c Gleb Smirnoff 2026-03-18 18:51:42
timerfd: Add tests
Take Jan Kokemuller's timerfd tests from the epoll-shim project,
stripping out code that isn't directly related to FreeBSD.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55789
MFC after:              2 weeks
834c1ba793d900b791e19ff449b1e0b96fb494a0 Jake Freeland 2026-03-20 06:31:30
libc: Fix cxa_thread_atexit{,nothr} test.
After patch 9d26b82, we don't provide recursive call protection anymore.
Therefore, to pass the test, we adjust the testcase by protecting on
caller and the testcase is to make sure the dtors is properly handled.

Reported by:    siva
Reviewed by:    kib
Approved by:    markj (mentor)
Fixes:  https://cgit.freebsd.org/src/commit/?id=9d26b82826d9 ("libc: Fix dtor order in __cxa_thread_atexit")
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55893
c25976f0a9a3a102ce47b45c19b2c93e8069433b ShengYi Hung 2026-03-17 14:53:08
pf tests: verify first-match-wins for nat rules
Sponsored by: Orange Business Services
0b0d34fd2f40e06e4600441b15b26b1cc1941c9f Kristof Provost 2026-03-20 03:16:57
pfctl tests: test rdr-to and nat-to in one rule
OpenBSD fixed this separately (in their 6a338f3f70). We appear to not
have had this bug, but test for it anyway.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
434e1c3d84135d1c3a6e578fdfa4b508f0914494 Kristof Provost 2026-03-22 06:20:48
stress2: Added syzkaller reproducers. Update the exclude file
4f8a1b4dffa8a6fa5fbe7fce05278792afd83a82 Peter Holm 2026-03-23 11:15:29
pf tests: verify that we handle address range rules correctly
There's been a problem where rules which differed only in address ranges
were considered duplicates and not added. Test for this.

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
ab74151e8d097b263237942c0b12277098bc9533 Kristof Provost 2026-03-12 14:23:32
tests/netinet: add test for getsockname() on a disconnected TCP socket
Stack it into existing file that exercises an other corner case of our
TCP and rename the file to a more generic name.
cd05c88058b5b3684f0d7f3086afa21a944d9cd1 Gleb Smirnoff 2026-03-24 20:51:59
ipfw: skip tests if required sysctl is not set
Since this is a configuration prerequisite rather than a test failure, use
atf_skip instead.

Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D56069
648d0fefd7573080b01d44cad8c39ad658f8e44f Olivier Cochard 2026-03-25 15:47:44
tests/netinet: add raw:reconnect test
It tests repetitive connect(2) on AF_INET/SOCK_RAW including connect(2)
to INADDR_ANY that puts socket back into receive-all mode.
f6989880841b89d54ebcd5d12195c40a23627646 Gleb Smirnoff 2026-03-25 18:53:44
Commit group #87: timerfd: Expect periodic timer performance failures
timerfd: Expect periodic timer performance failures

The current timerfd implementation fails to correctly count events on a
nanosecond callout interval. The timerfd__periodic_timer_performance
test detects this and reports failure.

Mark this test as an expected failure so it isn't flagged by CI. A link
to the bug report is attached to the test for reference.

While we're here, clean up some minor style and Make issues.

Fixes:          https://cgit.freebsd.org/src/commit/?id=834c1ba793d9 ("timerfd: Add tests")
MFC after:      1 week
cb692380f1e05ffc4184877844e93051f24ed302 Jake Freeland 2026-03-25 22:57:16

timerfd: Guard expected performance failure

During the timerfd__periodic_timer_performance test, only expect
failures when the expiration count is less than 400000000. This
prevents the test from being reported as a true failure in environments
where scheduling latency is high enough to delay timerfd wakeups.

Fixes:          https://cgit.freebsd.org/src/commit/?id=cb692380f1e0 ("timerfd: Expect periodic timer ...")
MFC after:      1 week
4b16ff49bf4bf875997fe4c80a0afc0d440b7aac Jake Freeland 2026-03-26 16:40:17
tests/netlink: Bugfix on snl_parse_errmsg_capped test
Turn off the NETLINK_EXT_ACK flag to fix bug of snl_parse_errmsg_capped.

Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1660
18ce9e2dd0e062583080da624499927e8df8eaf3 K Rin 2025-04-12 05:41:35
tests: Add grand link-layer event in netinet6/ndp
Add test for ndp to verity link-layer address change event
actually triggers the grand.

Differential Revision: https://reviews.freebsd.org/D55927
2371b24c22f063ef79dc1935419c9854656e265e Pouria Mousavizadeh Tehrani 2026-03-18 22:48:05
pkgbase: Move all of ATF into the atf package
Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294129
MFC after:      1 week
Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D56158
0a6dbf51d8ea112a1d164be260004ec795b4368d Dag-Erling Smørgrav 2026-03-30 14:03:03
tests: Add some simple regression tests for ip_mroute
These use atf_python to create a number of hosts linked to a router.
The router runs pimd (for IPv4) or ip6_mrouter (simplistic IPv6
multicast router that I wrote since I couldn't find one in the ports
tree).  The vnet_host*_handler() methods are invoked in different VNET
jails connected to the router; they register the connected epair with a
multicast group and verify that they can send messages to each other.

The tests are synchronized by sending messages over a unix domain
socket.  The flow is something like:
1) test startup_method() is called, the unix socket is created,
2) the superclass creates jails and links them together using the
   declared topology,
3) we wait for all child jails to start up and send a message on the
   unix socket indicating that they are ready
4) we start the routing daemon in the main jail,
5) the test actually starts; starttest() kicks off the
   vnet_host*_handlers(), which mostly just verify that they can send
   messages to each other using multicast packets
6) once they finish running, they signal their completion, and
   waittest() returns once they're all done

There are two tests, repeated for v4 and v6.  One just exchanges packets
between two hosts, and the other has four hosts divided across two FIBs.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55244
09e702ad40af0067017613070b42d72cbc2bec3a Mark Johnston 2026-03-30 13:32:35

Style, typos, and comments

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

linuxkpi: Avoid trailing whitespaces in lkpi_hex_dump()
We use the return value of the callback to track the number of bytes
written. We use it to determine if a group of characters should be
prepended with a whitespace. This way, we never add a trailing
whitespace.

We need to pay attention to the return value of the callback: if it is
negative, it's an error and we return immediately. Otherwise, we would
decrease the number of written bytes and possibly make it negative.

Reviewed by:    bz, christos
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51558
38d757b6c29c990de72dc51ac123922d3f095f53 Jean-Sébastien Pédron 2025-07-26 15:30:40
aq(4): Style, whitespace and misc cleanup
The compiled objects do not change other than a few diagnostic messages
that include __LINE__.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54304
96156003ec0c70de88a448d48d8e9bd37913589f Ed Maste 2025-11-19 15:34:25
makefs: Fix typo 's/mirrorring/mirroring/'
MFC after:    1 week
73af599fb7be6806b553ac6f470d76711b74286c Jose Luis Duran 2026-01-05 20:35:37
pxeboot.8: Fix mdoc typo for emails, tag spdx
Fixes:                https://cgit.freebsd.org/src/commit/?id=a37825313f62 (Fix mdoc typos for emails, tag spdx)
MFC after:      3 days
1961785e35484a89e49672c5ac7f9da6a7f56b3c Alexander Ziaee 2026-01-06 22:45:42
mrsas.4: Fix devid hex style
c2b407244f3a939d8b09f9a22d872ebdce5f6b19 Michael Osipov 2026-01-07 08:04:14
ps(1): Sort headers
Found these changes by chance in an old patch file.  Should have been
committed along with the ps(1) modifications done in March 2025.

No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
730b3e20069b7115d16f02525103c6c05fa04759 Olivier Certner 2026-01-08 15:20:38
libiconv: Fix typo in comment
dec3ea45b65442b4f3cafcd8a672f1e13b69a066 Ed Maste 2026-01-13 14:31:29
fusefs: style
Reorder macro definitions.
52ddca7c2e336ef43f6aadea601f72233b01bbe2 Alan Somers 2026-01-24 16:02:44
kern/kern_exit.c: some style
Reviewed by:  asomers, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
f5acbacb28f9fec7b9f159d36cc5056c9267a8ca Konstantin Belousov 2026-01-08 04:35:51
atf_python: Fix a typo in a type annotation
No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
ef389b7f581b2500c0e18c0989a54465712cd175 Mark Johnston 2026-01-27 14:57:31
stand: fix typo in common/nvstore.c
Some out of order chars.
da33cae6c785015329be9cdcf35f51e59807129c Toomas Soome 2026-01-28 08:38:26
usb: indentation (whitespace change only)
No functional change.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
0762cf10fc5e426700e00f9060518241212e941f Bjoern A. Zeeb 2026-01-29 11:17:52
netstat: Fix whitespace in libxo output for multicast routes
Also fix some bogus libxo format strings in mroute6.c, and close a
couple of lists instead of opening them twice.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ade9ccfe211a ("Convert netstat to use libxo.")
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
34c3e1d718a86436f863b2ae8b91bcf406b37f0e Mark Johnston 2026-01-30 20:30:58
clang-format: adjust to sort C++ headers per style(9)
Many standard C++ headers do not have the .h file extension: some, such as
`iostream`, lack it; others have a .hpp file extension. Moreover, some
projects (like ATF/Kyua) also contain .ipp files, which are C++ "interface"
files.

Relax the regular expression to ensure that non-traditional C "system"
headers, C++ headers, etc, with angle brackets are sorted before
"local" headers.

MFC after:      1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54401
ab9b04736945537743eb0624ead7a4fa4b960783 Enji Cooper 2026-01-31 04:14:07
ath_hal(4): Fix a typo in a source code comment
- s/arithmatic/arithmetic/

MFC after:      5 days
a17659fe260ce16c1e373b543ca9f13cc14340ea Gordon Bergling 2026-01-31 15:20:32
cpufreq(4): Fix a typo in a source code comment
- s/transcation/transaction/

MFC after:      5 days
0a3e7ba466376b46672b56c991c09cde528b9729 Gordon Bergling 2026-01-31 15:22:00
tftpd tests: clean trailing whitespace
No functional change intended.

MFC after:      1 week
fd6217075e6a5926bdc627145b38194b6c5ba8da Enji Cooper 2026-02-03 05:17:54
stand: Minor style tweaks
re-wrap the function calls in a couple of ifs in get_zfs_root so they
are more readable. They really didn't need to be wrapped like this in
the first place.

Sponsored by:           Netflix
fe8105de1485063a02ff25e686761247f78aaed9 Warner Losh 2026-02-04 17:19:43
endian.h: Visibility comment: Fix grammar, a typo and punctuation
No functional change.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
8bdcfc2a3febcd1aade1d9a3a8a87581c7b2928d Olivier Certner 2026-02-05 15:55:48
hwpstate_amd(4): attach(): Fix style
No functional change intended.

Reviewed by:    aokblast, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55003
0f747142c16b1f1921f8f983cba362a204158e9a Olivier Certner 2026-01-29 14:08:47
libsa/geli: Fix a typo in an error message
- s/crypo/crypto/

MFC after:      5 days
fa567fe7c537950fe48e35fa3b0827af4a45ec57 Gordon Bergling 2026-02-07 05:20:16
netinet6: Fix my style issues
Reported by:          pouria
Reviewed by:            pouria, ziaee, glebius
Approved by:            glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=31ec8b6407fdd5a87d70265762457c67ce618283
Differential Revision:  https://reviews.freebsd.org/D55136
4548149a81026ad9b1706b2b7e7ad47a4c1358b6 Guido Falsi 2026-02-07 12:46:05
arm/broadcom: Fix a typo in a source code comment
- s/preceeded/preceded/

MFC after:      3 days
8aa4fa7bf9b36a873aa2fd3cc22e8e15b97ea81e Gordon Bergling 2026-02-08 11:58:39
kern: Fix a typo in a source code comment
- s/segement/segment/

MFC after:      3 days
f87ab066722f3ffb19885ed501a7a136355340a2 Gordon Bergling 2026-02-08 11:59:37
qlnxe(4): Fix a typo in a source code comment
- s/segement/segment/

MFC after:      3 days
ff08ad36c2acb3553b9f585a9bd01fd1306bfd7e Gordon Bergling 2026-02-08 12:00:39
mlx(4): Fix a typo in a source code comment
- s/segements/segments/

MFC after:      3 days
3e46676638ac089c71e8424961449895c0babcfb Gordon Bergling 2026-02-08 12:01:27
nfsserver: Fix a typo in a source code comment
- s/preceeded/preceded/

MFC after:      3 days
afe666a8db82c42fe0b8d55d3142c9d305d1bc28 Gordon Bergling 2026-02-08 12:02:40
Commit group #88: chore: asmc: additional style(9) cleanup
chore: asmc: additional style(9) cleanup

Pick out non-gratuitous style(9) changes suggested by `clang-format` on
the driver. This helps eliminate minor stylistic issues with spaces,
braces, line lengths, etc, so future functional changes in the driver
will be easier to pick out.

Many of the other `clang-format` suggested changes were not taken because
they were considerably more gratuitous.

No functional change intended.

MFC after:      1 week
d76bb14e0224e235209d8c07ec132d602b18648b Enji Cooper 2026-02-08 20:04:32

asmc: unbreak build: add missing curly brace

Fixes:  https://cgit.freebsd.org/src/commit/?id=d76bb14e022 ("chore: asmc: additional style(9) cleanup")
9ccdf3f36e014f0060ea192ffed91a7679003355 Enji Cooper 2026-02-08 23:51:51
chore: ignore style(9) changes made in dd1410321
MFC after:    1 month
2fe3f16b1c219d2565a60a8bb3142b437f8c683f Enji Cooper 2026-02-08 20:09:27
Fix typo in build(7) man page
Signed-off-by: Kalevi Kolttonen <kalevi@kolttonen.fi>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2009
e4b1dc43289853910c791b3de470ff5f6fb6fe76 Kalevi Kolttonen 2026-02-08 20:34:25
t_ptrace_wait.c: clean up trailing whitespace
This is being done to aid with future potential updates of this file.

MFC after:      1 week
fa3519d068d95f87e773d27f96e9f1e18f70075a Enji Cooper 2026-02-08 23:40:56
tools: fix WITHOUT_LOADER_GELI typo in universe.sh
Signed-off-by:        Quentin Thébault <quentin.thebault@defenso.fr>
Reviewed by:    emaste
Sponsored by:   Defenso
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2011
6a0ab05eb5eeb701ce71630154f903668d750786 Quentin Thébault 2026-02-09 12:27:06
sbin/geom: Convert err/warn() to xo_err/warn() and style(9) fixes
Finishing up the libxo conversion of geom by switching err(3) to their
libxo equivalents.

While here, fix some style(9) issues. There are still a few left, but at
least they're fewer now.

Reviewed by:    asomers
Approved by:    asomers (mentor)
MFC after:      2 weeks
Sponsored by:   ConnectWise
Differential Revision:  https://reviews.freebsd.org/D54938
821243b3877d90290ba519f2aeccf6f48430db32 Johan Söllvander 2026-02-10 12:19:50
hwpstate_amd(4): Style: Sort headers
And separate includes from the rest with an additional newline.

Sponsored by:   The FreeBSD Foundation
cec0ab05866e664e7d7636cdadc782a4ca824bd2 Olivier Certner 2026-01-29 22:22:35
hwpstate_amd(4): Style: Align 'machdep.hwpstate_amd_cppc_enable'
Align it like the rest.

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
4285340c604a4dea340bd6f0ec0d721b2155f0da Olivier Certner 2026-02-09 18:03:12
Correct Identifer typo in SPDX tags
07d29f9c177e731e4497bedf5fde09176c90b444 Ed Maste 2026-02-18 19:20:12
src.conf.5: Fix "incompatibility" typo
MFC after:    3 days
Reviewed by:    ziaee
Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2035
102fed041d7f9aec6b962e215f53347a7e5d1a20 Christos Longros 2026-02-19 19:37:47
asmc: code style modernization and minor cleanups
- Allow `ASMC_DEBUG` to be treated as a variadic macro.
- Add ellipses around `sizeof(..)` calls.
- Reindent some of the lines to better follow style(9) with line
  wrapping.

A number of other clang-format changes were not taken as they are not
compatible with style(9).

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55394
e20e26e4e271ecb74e40d9a95ed3112ceaf9604f Enji Cooper 2026-02-20 03:51:13
fix typo in efi/loader/arch/amd64/trap.c
Rename grap_faults to grab_faults

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55177
503374af390eb84ec72167ab0be4751b2fe0a446 Toomas Soome 2026-02-21 08:40:48
ttys: Align comment whitespace and wrapping
This doesn't lengthen or shorten any configuration,
only comments, so merging the configuration will be safe.

Reviewed by:    imp
Closes:         https://github.com/freebsd/freebsd-src/pull/2042
0a492eb9c648e3ee11d36d14f6a0e3ed73b3da92 Alexander Ziaee 2026-02-22 07:32:46
debug.sh: Fix a typo
MFC after:            3 days
Reviewed by:            emaste, guest-seuros, sjg, ziaee
Differential Revision:  https://reviews.freebsd.org/D55416
ab835b37075e6478ef82f8c807a2335f5d19edaf Artem Bunichev 2026-02-23 08:31:31
style.mdoc: Add example manuals to FILES
This is the OG meat and potatoes.

MFC after:              3 days
Reviewed by:            0mp, carlavilla
Differential Revision:  https://reviews.freebsd.org/D55301
2abdbe9d796419e8149705ffb4c81f0c0cdea05f Alexander Ziaee 2026-02-26 07:07:09
from(1): style fixes
No functional changes.
ffe7d45d295c553ed90ad3b5cc67111450063741 Mariusz Zaborski 2026-03-01 16:56:37
Commit group #89: style.mdoc
style.mdoc: Li macro is undeprecated for some time

Previously, the mdoc linter warned against using Li as it was deprecated
upstream. However, upstream undeprecated it since last year. As usual
when it comes to style, the best thing to do is to follow the existing
style of the page. We have many manuals which prefer double quotes.

MFC after:              3 days
Citation:               https://cvsweb.bsd.lv/mandoc/mdoc.7?rev=1.297
Differential Revision:  https://reviews.freebsd.org/D55297
fae551b76785d2357b09e2c022a92f410d871b9b Alexander Ziaee 2026-03-02 10:20:01

style.mdoc: Remove synopsis formatting advice

Remove incorrect advice. The first rule was no spaces padding pipes
when showing alternates. Almost universally we not do this, and third
party manuals do not either. The second was using Cm to mark up symbols.
This advice is in conflict with mdoc(7), and the extended documentation
on mdoc linked below, which is also linked at the bottom of mdoc(7).

Conflicting information in our docs is a natural result of documentation
proliferation. The most important thing we can do to reduce technical
debt in the documentation is reduce the amount of doc overlap. Excessive
technical debt and conflicting rules is a barrier to new contributors.
This type of work requires thorough expertise, is not glamorous at all,
and to add insult to injury, is socially unsafe. To get new contributors
to the docs project, we must deduplicate documentation.

We have the mdoc manual, examples/mdoc, style.mdoc, and the fdp chapter
on manual pages. With this many, they will inevitably come to contain
conflicting information, and people will learn not to read them or work
on them.

MFC after:              3 days
Ref:                    https://mandoc.bsd.lv/mdoc/style/commands.html
Differential Revision:  https://reviews.freebsd.org/D55298
47326cb470278e891975354286481b5ba876929a Alexander Ziaee 2026-03-02 10:24:11

style.mdoc: Left angle bracket is not less-than

MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D55300
06ac71cffba4a0f86334844453d0a6fb3c46aa12 Alexander Ziaee 2026-03-02 10:41:07
src.conf.5: Regen for typo fix in commit 8e9515839369
4c822e8b7de246bbf139e493ee33c73cdc4e4c28 Ed Maste 2026-03-03 14:24:38
LinuxKPI: 802.11: fix typo
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
fa0f891d54449837b47f2ef2266163bdd9117879 Bjoern A. Zeeb 2026-02-17 03:05:16
bus_if: Fix typo
Reviewed by:  olce
Approved by:    olce
Fixes:  https://cgit.freebsd.org/src/commit/?id=4c4392e791b7 ("Add doxygen doc comments for most of newbus and the BUS interface.")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D48721
bc3914737bce07a912a8024ba19983d7c388736c Aymeric Wibo 2026-03-04 15:39:27
INIT_ALL: Fix typo in option description
From GitHub pull request #2035; the change needs to be applied to the
source file for the option description, not the generated src.conf.5.
c9f3de0ba95b8da31d35fa92e0a54cf6f3d3f1dd Ed Maste 2026-03-04 18:31:29
src.conf.5: Fix "incompatibility" typo
MFC after:    3 days
Reviewed by:    ziaee
Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2035
71e8b32415c2c70a95e89644782006f84de17f2d Christos Longros 2026-02-19 19:37:47
hid: Fix 'strenght' typo in hpen.c
Reviewed by:  wulf, obiwac
Approved by:    wulf, obiwac
Fixes:  https://cgit.freebsd.org/src/commit/?id=d97d5c0ce89d ("hid: Import hidmap-based drivers written by Greg V")
Differential Revision:  https://reviews.freebsd.org/D55626
2f440158c6865c93c9f8ef611b8673bba1f81dfa Majed Alkhaleefah 2026-03-04 23:40:38
LinuxKPI: 802.11: fix typo
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
fa41408d6043df3779d94bd1ac871a5ba8f4dafb Bjoern A. Zeeb 2026-03-05 10:30:46
style.9: Encourage style changes when doing significant modifications
The rule of allowing style changes when about half or more of a file (or
group of files), coupled with the advice of avoiding stylistic changes,
could be interpreted as forbidding most style changes, even in heavily
modified functions.

In order to rule out that interpretation and ease transition towards our
prescribed style:
1. Clarify that avoiding stylistic changes concerns only "standalone"
   ones.
2. Actually encourage changing the style, and extend the cases where it
   is explicitly allowed to do so to any single logical unit as little
   as a function, keeping the existing "about half" of modified code as
   a rule of thumb.

When point 2 above applies, encourage to commit pure style changes
separately, and to add style-only commits to '.git-blame-ignore-revs'.

Add a specific note ruling out "horizontal" style changes spanning
unrelated directories in the whole tree, which make the merge (MFC)
process more difficult.

While here, be slightly more stringent on new kernel code.

While here, regroup the paragraphs talking about style, and put them at
the end (before the recent C++ section).

While here, rephrase the requirement on third-party maintained code to
be slightly less stringent.

Reviewed by:    jhb, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52885
af2c7d9f6452f2281a832b03375910f99230f924 Olivier Certner 2025-10-03 12:05:46
Fix hooks.sh comment typo
Signed-off-by: Kalevi Kolttonen <kalevi@kolttonen.fi>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2013
3be98a0c86f956604be58a14c6a9bfe2f25af2d8 Kalevi Kolttonen 2026-02-10 23:15:51
Fix debug.sh comment typo
Signed-off-by: Kalevi Kolttonen <kalevi@kolttonen.fi>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2012
d7922c3d2391c6db3dac77fa491d53e080162c79 Kalevi Kolttonen 2026-02-10 23:02:49
Fix typos in manual pages
bpf.4: accomodate -> accommodate
hier.7: compatability -> compatibility
namei.9: succesfull -> successful

Signed-off-by: Christos Longros <chris.longros@gmail.com>
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D55746
6ccfa67ac422a307c3e9624fb080d9616b0c6b05 Christos Longros 2026-03-09 18:33:32
share/dict/web2: Sort
72f0bc868bf00586cba1e50057d8f1998b4abe80 Ed Maste 2026-03-09 19:35:53
rtld-elf: Remove stray _exit prototype for aarch64
It's not clear why this is here. It's existed since the very first
version of rtld-elf for aarch64 but has never been used, and anything
actually using exit or _exit should be using rtld_libc.h's #define that
aliases them to __sys_exit.

Fixes:  https://cgit.freebsd.org/src/commit/?id=047c6e3ae6ab ("Add the arm64 code to the runtime linker. It's not able to be built as we still need libc_pic for a few things, but this is expected to be ready soon.")
c70f382a8b3907069589954433fe091687f15373 Jessica Clarke 2026-03-13 19:25:04
backlight.8: Fix typo in man
Increment and decrement where swapped.

Signed-off-by: Salman Sarray <salman@sarray.de>
Reviewed by: ziaee, Christos Longros <chris.longros@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2072
424d3ca81f4e748afd90332fd6c37c944eb3b3cf Salman Sarray 2026-03-11 19:26:29
rge: use C style comments instead of C++
FreeBSD style(9) mandates C style comments. The initial import from
OpenBSD left several C++ style // comments in if_rge.c and if_rgevar.h.
Replace them with proper /* */ comments.

Also fix a malformed comment that mixed // with a closing */.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55743
9976cff55e8897f74d970567e61512103216cf58 Christos Longros 2026-03-15 20:09:56
crypto_request.9: Fix typo on crypto_initreq arguments
The function signature of `crypto_initreq()` was
incorrectly documented.

Signed-off-by:  Zixu Wu <zx@bv3.dev>
Reviewed by:    ziaee, pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2077
fed90174ff5eb8dd46c521c67ea0b387f150683b zxbv3 2026-03-15 16:35:30
nanobsd: embedded: Remove stray comment
Remove an outdated comment about NanoBSD not being able to remove the
firstboot sentinel file.

It was fixed in cb51e2bc3db7 ("rc: Allow the removal of
firstboot_sentinel on read-only file systems").

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54977
21970f278028464f053fa15d45321cfa727c488a Jose Luis Duran 2026-03-19 17:13:29
cd9660: Partial style sweep of Rock Ridge code
This mostly just fixes indentation and continuations and adds spaces
after commas and around binary operators and parentheses around return
values, but cd9660_rrip_extref() was so egregiously unreadable I
rewrote it.  Note that this was done manually, so I may have missed a
few spots, and I made no attempt to fix over-long lines.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55865
e6a77f81d1eb345f6a8c827ecf555b88996c8763 Dag-Erling Smørgrav 2026-03-24 11:29:37
MAC/do: Comments: Rephrase one, fix a typo in another
No functional change.

MFC after:      3 days
Event:          AsiaBSDCon 2026
Sponsored by:   The FreeBSD Foundation
954aaf3958e2ea0e9b1811090ddbb9d8b13a3e5a Olivier Certner 2026-03-21 13:39:04
m4: Misc style fixes
MFC after:    1 week

Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D55794
41474e78c493184f023723d1f86539e07bb01b92 Dag-Erling Smørgrav 2026-03-25 00:41:23
if_types: Fix a typo in a source code comment
- s/Circiut/Circuit/

Obtained from:  OpenBSD
MFC after:      3 days
8bc31c88d65ad99cd510fbe511958799d3531477 Gordon Bergling 2026-03-27 06:57:49
ofed: Fix a typo in a source code comment
- s/refereced/referenced/

MFC after:      3 days
aed3bc80fe033ab28e8f01cad49e73deb761516b Gordon Bergling 2026-03-27 06:59:19
vmgenc: fix typo in MODULE_DEPEND declaration
The random_harvestq dependency was registered under the misspelled
name "vemgenc" instead of "vmgenc", causing the dependency to not
be associated with the correct module.

Signed-off-by: Christos Longros <chris.longros@gmail.com>
Reviewed by: cem, imp
Differential Revision:  https://reviews.freebsd.org/D56012
ccc235fe0229685512ea7b3d8ed1ecb61dd388f5 Christos Longros 2026-03-28 04:03:24

Contrib code

crypto/openssl: update vendor update instructions
This change fills out the requirements for doing vendor updates,
documents the new vendor update process, and guides whoever needs to do
the next version update a bit better than the documentation did prior to
this change so everyone can pitch in with version updates a bit better.

Convert the document to Markdown while here to make it easier to
render/print out the directions in a structured format.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D53190
08cdcff58acb2aec881e42c7f097d6492d864898 Enji Cooper 2025-10-11 21:12:55
libarchive: merge from vendor branch
libarchive 3.8.5

Important bugfixes:
 #2809 bsdtar: fix regression from 3.8.4 zero-length pattern issue bugfix

Obtained from:  libarchive
Vendor commit:  dd897a78c662a2c7a003e7ec158cea7909557bee
MFC after:      1 week
4b047c3af3fec1607ba1cfe04e1d442a17fc1cf6 Martin Matuska 2026-01-05 20:14:54
dtrace: Add definitiosn for the cam dtrace provider
Sponsored by:         Netflix
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D54471
efb77950fdd6fb03dc172a44b3875948609b7804 Warner Losh 2026-01-08 06:20:28
zfs: emit .note.GNU-stack section for all ELF targets
On FreeBSD, linking the zfs kernel module with binutils ld 2.44 shows
the following warning:

    ld: warning: aesni-gcm-avx2-vaes.o: missing .note.GNU-stack section implies executable stack
    ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Some of the `.S` files under `module/icp/asm-x86_64/modes` check whether
to emit the `.note.GNU-stack` section using:

    #if defined(__linux__) && defined(__ELF__)

We could add `&& defined(__FreeBSD__)` to the test, but since all other
`.S` files in the OpenZFS tree use:

    #ifdef __ELF__

it would seem more logical to use that instead. Any recent ELF platform
should support these note sections by now.

Reviewed by:    emaste, kib, imp
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54578
eb1b6ec7a79aff05f5f10e1d6b1c63a0d8dc5f2f Dimitry Andric 2026-01-08 08:35:13
grep: add testcase to test color when matches is greater than MAX_MATCHES
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/1442
0a5535d1c5209e73c6b2f3fd6118f9ffcb7e296e Viacheslav Chimishuk 2024-10-06 22:18:17
kyua: Add "debug -x|--execute cmd" option
With execenv=jail specified, the "cmd" runs inside the test's jail.

Reviewed by:    ngie, markj
Differential Revision:  https://reviews.freebsd.org/D52642
8a21c17ccfecf0ee54becd46d3e08ccab76ca3d6 Igor Ostapenko 2026-01-11 13:43:33
Import latest mtree from NetBSD
Merge commit '7e59b238fcf32f3d365e78ddc702ca494e1ff68d'

This commit partially reverts the previous vendor import, given that the
"type" keyword has been historically mandatory and should not be removed
by "-R all".  This was clarified in the man page.

Reported by:    glebius
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219467
MFC after:      1 week
4250d2ad991b7bb9915e4c6b6d93b17369747ff0 Jose Luis Duran 2026-01-11 16:42:18
rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:   The FreeBSD Foundation
80ba8933a991d245b3983f9e2ed1171b11ccaf8a Bjoern A. Zeeb 2026-01-20 10:56:33
ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:   The FreeBSD Foundation
6c61f58562b932eb46b2e05b2f5a82d34250435a Bjoern A. Zeeb 2026-01-20 10:55:32
libc++ inttypes.h: define __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS
Before transitively including the base version of inttypes.h, define
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS, because the base
inttypes.h directly includes sys/stdint.h, instead of going through the
'regular' stdint.h.

The libc++ version of the latter does define those macros, to ensure
things like UINT64_C() and SIZE_MAX are defined even in C++98 or C++03.

MFC after:      3 days
3cdb6c9d92ecf479a0df338267f3f844ef6feeb2 Dimitry Andric 2026-01-23 17:31:53
Add pdrfork to OpenBSM
It's necessary for auditd to be able to log its events.  Note that the
recently added pdwait() syscall is only auditable because an audit event
of that name was preemptively added back in 2012.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292739
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=5c2ee618d5e "sys: add pdrfork(2)"
Sponsored by:   ConnectWise
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D54897
6253212608b4f513b1e298f11a630d9d0596560d Alan Somers 2026-01-26 19:10:50
Merge commit 81b20e110b3f from llvm git (by Roland McGrath):
    [libc++] Work around new GCC 15 type_traits builtins that can't be
    used as Clang's can (#137871)

    GCC 15 has added builtins for various C++ type traits that Clang
    already had.  Since `__has_builtin(...)` now finds these, the #if
    branches previously only used for Clang are now used for GCC 15.
    However, GCC 15 requires that these builtins only be used in type
    aliases, not in template aliases.

    For now, just don't use the `__has_builtin(...)` branches under newer
    GCC versions, so both 14 and 15 work during the transition.  This
    can be cleaned up later to use all the GCC 15 builtins available.

    Fixed: #137704
    Fixed: #117319

Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D54865
bfc6e56f6327621171cef4fe29290c63edfc4d9c John Baldwin 2026-01-27 18:34:58
netbsd-tests t_regex_att: Use __nonstring for a non-string constant
Fixes the following warning from GCC 15:

contrib/netbsd-tests/lib/libc/regex/t_regex_att.c:54:30: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (4 chars into 3 available) [-Werror=unterminated-string-initialization]
   54 | static const char delim[3] = "\\\\\0";
      |                              ^~~~~~~~

Reviewed by:    ngie, imp, dim
Differential Revision:  https://reviews.freebsd.org/D54866
2dea50a661b903513efc42e270c4e6f5c2b89bc3 John Baldwin 2026-01-27 18:38:31
openssl: Fix multiple vulnerabilities
This is a rollup commit from upstream to fix:
  Improper validation of PBMAC1 parameters in PKCS#12 MAC verification (CVE-2025-11187)
  Stack buffer overflow in CMS AuthEnvelopedData parsing (CVE-2025-15467)
  NULL dereference in SSL_CIPHER_find() function on unknown cipher ID (CVE-2025-15468)
  "openssl dgst" one-shot codepath silently truncates inputs >16MB (CVE-2025-15469)
  TLS 1.3 CompressedCertificate excessive memory allocation (CVE-2025-66199)
  Heap out-of-bounds write in BIO_f_linebuffer on short writes (CVE-2025-68160)
  Unauthenticated/unencrypted trailing bytes with low-level OCB function calls (CVE-2025-69418)
  Out of bounds write in PKCS12_get_friendlyname() UTF-8 conversion (CVE-2025-69419)
  Missing ASN1_TYPE validation in TS_RESP_verify_response() function (CVE-2025-69420)
  NULL Pointer Dereference in PKCS12_item_decrypt_d2i_ex function (CVE-2025-69421)
  Missing ASN1_TYPE validation in PKCS#12 parsing (CVE-2026-22795)
  ASN1_TYPE Type Confusion in the PKCS7_digest_from_attributes() function (CVE-2026-22796)

See https://openssl-library.org/news/secadv/ for additional details.

Approved by:    so
Obtained from:  OpenSSL
Security:       FreeBSD-SA-26:01.openssl
Security:       CVE-2025-11187
Security:       CVE-2025-15467
Security:       CVE-2025-15468
Security:       CVE-2025-15469
Security:       CVE-2025-66199
Security:       CVE-2025-68160
Security:       CVE-2025-69418
Security:       CVE-2025-69419
Security:       CVE-2025-69420
Security:       CVE-2025-69421
Security:       CVE-2026-22795
Security:       CVE-2026-22796
9c151e1fbf1a71a4912afa9693a39d55a00db4eb Gordon Tetlow 2026-01-26 18:14:21
netbsd-tests: Fix regcomp_too_big flakiness
The test sometimes crashes with ASLR enabled.  This seems to happen when
regcomp() grows the process stack and happens to run into the virtual
memory limit set at the beginning of the test.  ASLR triggers the
problem since it introduces a bit of fragmentation and thus introduces
cases where stack allocation can be the trigger of virtual memory
exhaustion, rather than dynamic memory allocation in regcomp().

Make the test stable by priming the stack before doing anything else.
This effectively reserves 16MB of virtual memory for the stack, which in
practice is enough to make the test stable on amd64.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259971
Reviewed by:    ngie, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54880
938915a22c84af88afa587694e8d63ce9dd202f4 Mark Johnston 2026-01-27 21:08:35
GoogleTest: import 1.17.0
The changes between the two versions can be found in this diff of the
two release tags:
https://github.com/google/googletest/compare/v1.15.2...v1.17.0

One notable change is that GoogleTest 1.17.0 now requires C++-17 to
build.

MFC after:      1 week
Merge commit '3a4c29b5bed4ea20266ad9371fbfdc6bca088f92'
46333229c6a0187ebf231805682ee0bceed704d1 Enji Cooper 2026-01-29 01:24:01
gtest.cc: declare fail_if_no_test_linked flag
Clang's -Wmissing-variable-declarations flags this as an issue since the
flag is only used in `gtest.cc`. Declare the flag beforehand to ensure
that the variable scope is properly limited to `gtest.cc`.

MFC after:      1 week
MFC with:       46333229c6a0187ebf231805682ee0bceed704d1
Ref:            https://github.com/google/googletest/pull/4898
3926ae98adfe4b2f1dd957cab353ba7ca11ce709 Enji Cooper 2026-01-29 01:22:42
openssl: import 3.5.5
This change adds OpenSSL 3.5.5 from upstream [1].

The 3.5.5 artifact was been verified via PGP key [2] and by SHA256 checksum [3].

This is a security release, but also contains several bugfixes. All of
the CVE-worthy issues have already been addressed on the target
branch(es), so the net-result is that this is a bugfix release.

More information about the release (from a high level) can be found in
the release notes [4].

MFC after:      1 week

1. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz
2. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.asc
3. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.sha256
4. https://github.com/openssl/openssl/blob/openssl-3.5.5/NEWS.md

Merge commit '808413da28df9fb93e1f304e6016b15e660f54c8'
f25b8c9fb4f58cf61adb47d7570abe7caa6d385d Enji Cooper 2026-01-31 22:00:39
Commit group #90: OpenSSL: update vendor sources to match 3.5.5 content
OpenSSL: update vendor sources to match 3.5.5 content

MFC with:       f25b8c9fb4f58cf61adb47d7570abe7caa6d385d
MFC after:      1 week
1731fc70f7344af08db49b06c63c963fa12ee354 Enji Cooper 2026-01-31 22:06:28

OpenSSL: commit sys/crypto changes for 3.5.5

These files were changed as part of the 3.5.4 -> 3.5.5 upgrade. Please
see the upstream release notes linked in
1731fc70f7344af08db49b06c63c963fa12ee354, et al, for more details.

MFC after:      6 days
MFC with:       1731fc70f7344af08db49b06c63c963fa12ee354
Fixes:  https://cgit.freebsd.org/src/commit/?id=1731fc70f7344af08d ("OpenSSL: update vendor sources to match 3.5.5 content")
e6c8997a8958c7aaec8e266d2eeefbfaa137e218 Enji Cooper 2026-02-01 17:05:55
contrib/spleen: Update to 2.2.O
This release adds several new characters critical to the manual pages
that were previously missing on high-dpi displays: em-dash, en-dash,
hyphen, angle brackets, white square, dagger, and double dagger. It
also features improved alignment for numerous characters in different
sizes.

Thanks:         Fredric Cambus
MFC after:      3 days
Discussed with: emaste
0d602f923ed8a889c3a848ab9f19aa52f917f6ee Alexander Ziaee 2026-02-01 15:25:11
MFV less v691
Relnotes:     yes
MFC after:      2 weeks
dafba19e42e78cd3d7c9264ece49ddd3d7d70da5 Xin LI 2026-02-02 20:50:35
Commit group #91: mt76
mt76: sort out MODULE_DEPEND for PCI and USB

It is not enough to depend on mt76_core which then depends on linuxkpi
and linuxkpi_wlan.  Given each mt76 driver is its own module, each
also needs to depend on these linuxkpi modules.
In addition the core module usb part also has to depend on linuxkpi_usb.

This in addition to the previously sorted PCI drivers, allows (or will
allow) the individual chipsets (drivers) to load on systems with USB,
if compiled in, as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b129f79a8985a92cd061afa4ee31311cfe31d285 Bjoern A. Zeeb 2026-02-02 01:24:07

mt76: make USB compile

This is the mt76-specific changes to make the USB driver targets for
7921 and 7925 compile.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
642c8387647daabc2505497cdafef4d3ce82bbf2 Bjoern A. Zeeb 2026-02-03 18:25:02

mt76: mt7925: add missing LINUXKPI_PARAM_PREFIX

There is a module_param_named() in the file so we need to set
LINUXKPI_PARAM_PREFIX to get it a uniq sysctl name.  mt7921
has the exact same option.  Without their individual prefixes
the names would clash on systems with both chipsets and not
work for both.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
bc820edd2d7906e04e93aef8a6137991ad86f4cc Bjoern A. Zeeb 2026-02-04 22:20:37

mt76: fix a check wrongly giving us random ether addresses all the time

Do not cover the is_valid_ether_addr() check under CONFIG_OF.
Unclear if this is an initial porting or a merging error before the
driver hit the FreeBSD src tree.
The end result was that we always got a random link-layer address,
while the individual drivers may have setup phy->macaddr and this
function would only overwride if given in device tree.
Only if both, driver and and the OF backup, fail then go and use
the random link-layer address.

While here adjust printing the random link-layer address using
a FreeBSD format specifier and not the unsupported Linux one.

Fixes:          https://cgit.freebsd.org/src/commit/?id=6c92544d7c97
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
3afe9e12fb331dc698ac62f3b918d82d768a2792 Bjoern A. Zeeb 2026-02-05 00:20:04
MFV: Import blocklist 2026-02-07 (10a907f)
Merge commit 'a39ba5e2935176fe982235556e46ba3f51178187'

Changes:

https://github.com/zoulasc/blocklist/compare/8a4b011...10a907f

MFC after:      3 days
56c94c76432b1aafcc9b099398e674f0ae87623c Jose Luis Duran 2026-02-07 22:59:49
blocklist: blacklist: Chase recent upstream changes
MFC after:    3 days
a25b12c6ce63be1fefb31d14daca332682fd31fc Jose Luis Duran 2026-02-07 23:06:32
rtw88: set .bsddriver.name for USB chipsets
We use the FreeBSD-specifc bsddriver.name to get the device name;
set it everywere consistently.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D55020
d3c4e8952cd1be2015aa9d83820961283aa4f00c Bjoern A. Zeeb 2026-01-29 11:16:11
Commit group #92: ath10k
ath10k: fix a schedule() call

Using kern_yield does not seem ideal either for polling here;  use a
schedule_timeout() call from LinuxKPI instead and use about 100
iterations per second.

Improve an error message to include the error code so we have a better
idea of what happens.

MFC after:      3 days
6387c1135921fbc86ab0f3c1508a3719ca9cac54 Bjoern A. Zeeb 2025-12-08 00:00:05

ath10k: add sysctl to turn on/off fwlog

FWLOG, if compiled in, was on by default without a way to stop it from
printing everything to the console.  Add a modparam to enable it with
it being disabled by default if available.

MFC after:      3 days
717240c95d297711d3bed0bb8b4cc8403ecbfd6a Bjoern A. Zeeb 2025-12-08 18:47:45

ath10k: cleanup some bits no longer FreeBSD-specific

We have since I did this port in 2023 added ACPI support to LinuxKPI, so
we can use it.  Also there is a linux/of.h header so we no longer need
to guard the #include.

MFC after:      3 days
db20376a4fc949d6a5b30b11f8bf9146c6b3395d Bjoern A. Zeeb 2025-12-14 22:28:46

ath10k: harmonize all MODULE_DEPEND to ath10k

With theoretically multiple bus attachements (unclear if we will ever
support anything but PCI) rename the module name to "ath10k" and use
it consistently.  Move the common depends to core.c and lindebugfs
and usb to their respective files.

MFC after:      3 days
c45b60cab05b47b1d87bf49e58f669d9aaf72765 Bjoern A. Zeeb 2026-02-07 22:29:44

ath10k: usb: make compile using [a future] linuxkpi_usb

Make ath10k usb code compile just to gather more USB bits.

Currently (and likely forever) it is useless as the ath10k USB
implementation never got finished.
At the moment it lacks an entry for the USB bus attachment in
core.c ath10k_hw_params_list[].

ath10k_usb0 on uhub1
ath10k_usb0: <Qualcomm Atheros USBWLAN, rev 2.01/92.10, addr 6> on usbus0
ath10k_usb0: Warning: ath10k USB support is incomplete, don't expect anything to work!
ath10k_usb0: Unsupported hardware version: 0x5020001
ath10k_usb0: could not get hw params (-22)
ath10k_usb0: could not probe fw (-22)

There is another possible hardware [1] which was also never merged
upstream.
[1] https://lists.infradead.org/pipermail/ath10k/2024-August/016037.html
"[PATCH] wifi: ath10k: add USB device ID for Atheros QCA9377-7"

MFC after:      3 days
ca83c369755bcc205090093e6e0d045fae24714e Bjoern A. Zeeb 2026-02-07 22:13:23
rtw89: update Realtek's rtw89 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285228
10f91d9ff7b827aac6035e224e6ddc2c79f3a0cd Bjoern A. Zeeb 2025-12-05 20:48:02
rtw88: harmonize all MODULE_DEPEND to rtw88
From the time I used to split up the driver into a core part and
bus attachment sub-drivers the various bus attachments had their own
module name but all is "rtw88" now.

Core functionality depends on linuxkpi, linuxkpi_wlan, and for debug.c
lindebugfs.
Each bus attachment then depends on its own parent layer if needed:
PCI gets pull in through linuxkpi, USB: depends on [the future] linuxkpi_usb,
and SDIO: depends on [the future] linuxkpi_sdio.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D55021
49c1b388d5a89761980d24aee14f3bd0db7c0dda Bjoern A. Zeeb 2026-01-26 16:18:49
rtw89: cleanup static_assert() calls
These days we can use static_assert() without trouble so remove the
FreeBSD-specific rtw89_static_assert implementation.  This reduces
the diff to upstream and will ease future driver updates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
57b839612b7abb891057f1efe380c509664f868b Bjoern A. Zeeb 2026-01-20 22:51:28
rtw89: harmonize all MODULE_DEPEND to rtw89
rtw89 came like rtw88 was done.  Given rtw88 once was split up rtw89
got modelled the same way.  Clean this up too.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
7fc5c8df4c90a2067c936e3026be6bd6840cd5ec Bjoern A. Zeeb 2026-02-07 18:05:40
ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
083f8f33304ab105d0b556bdc244c9fa73068b67 Bjoern A. Zeeb 2026-02-10 15:12:28
brcm80211: import Broadcom wireless brcmsmac and brcmfmac drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).

We are likely only going to use the brcmfmac driver but given they
come nicely packaged in a directory structure and bwn(9) still uses
GPL-only phy files we could use some of the information from brcmsmac
and fix that (should it ever still be relevant).

git-subtree-dir: sys/contrib/dev/broadcom/brcm80211
git-subtree-mainline: 69c64e3fb575e0db0e2f0c1fc56f466624940ded
git-subtree-split: 1eabd3ed89eb4bb5c69e90eeaeda1a6dd31e8bab
b4c3e9b5b09c829b4135aff738bd2893ed052377 Bjoern A. Zeeb 2026-02-10 21:22:03
brcmfmac: make USB parts compile (and not panic right away)
Fix casts and consts and add one extra error check for a NULL pointer.
This will require [a future] linuxkpi_usb.

There are very few dongles I know off:
- the original Raspberry PI USB dongle [1]
- Cisco Linksys AE1200

The reason for making USB compile despite the limited 11n 150/300 Mbit/s
adapters is that it is the simplest way to work on cfg80211 while on the
road, not requiring a full PCIe slot or another SoC for SDIO.

Sponsored by:           The FreeBSD Foundation
Hardware donated by:    Martin Husemann (martin NetBSD.org) [1]
MFC after:              3 days
22741535bcf4b003e41c0ecd22cca578359ba434 Bjoern A. Zeeb 2026-02-09 01:07:01
brcm80211: update Broadcom wireless brcmsmac and brcmfmac drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
9375e11f079d725d42c5b431de33044088ad14f7 Bjoern A. Zeeb 2026-02-10 23:56:40
diff3: Use a format string to quiet a compiler warning
And bump WARNS to 2
fd52a9becc62f721ad6a61c7301559afaedee010 Ed Maste 2025-11-18 13:21:03
ee: add unicode support
- Add native support for unicode everywhere.
- Remove Big5 specific code (and the menu entry)

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291279
MFC After:      1 month
Tested by:       Marek Zarychta
Differential Revision:  https://reviews.freebsd.org/D55303
62fba0054d9eb2303116f54be1f9bc0e7b75cc15 Baptiste Daroussin 2026-02-14 05:44:54
vchiq: Fix return type of vchiq_copy_from_user
Change the function definition to map the declaration and consistently
return an enum value.  This fixes the following error reported by GCC:

sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c:322:1: error: conflicting types for 'vchiq_copy_from_user' due to enum/integer mismatch; have 'int(void *, const void *, int)' [-Werror=enum-int-mismatch]
  322 | vchiq_copy_from_user(void *dst, const void *src, int size)
      | ^~~~~~~~~~~~~~~~~~~~
In file included from sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.h:38,
                 from sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c:61:
sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h:647:1: note: previous declaration of 'vchiq_copy_from_user' with type 'VCHIQ_STATUS_T(void *, const void *, int)'
  647 | vchiq_copy_from_user(void *dst, const void *src, int size);
      | ^~~~~~~~~~~~~~~~~~~~

Differential Revision:  https://reviews.freebsd.org/D55163
1101292a555d24c11d7630b638dc25e1ed22c061 John Baldwin 2026-02-17 20:47:00
Merge commit bfb276e55c76 from upstream OpenZFS (by Jessica Clarke)
  Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but
  FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break,
  which predates the addition of FreeBSD support to OpenZFS. Moreover,
  64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also
  defined (alongside __powerpc64__ to disambiguate), which has always had
  a 64-bit time_t. This code has therefore always been wrong for all
  PowerPC variants. Fix this by limiting the 32-bit case to just i386,
  which is the only architecture in FreeBSD to have a 32-bit time_t and
  not have broken ABI, due to its special legacy compatibility status.

  Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
  Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
  Closes #18217
  Closes #18218

Reported by:    fuz
MFC after:      1 day
45c1e44779e3d365f5e31f75546d48ce34e4ee05 Jessica Clarke 2026-02-18 18:45:26
MFV: less v692.
e2abec625bf07c054f7ac2df2402d6c454113df8 Xin LI 2026-02-21 05:33:50
Retire GNU diff3
We added the option to build BSD diff3 in commit 2201f7c49f11 ("Build
BSD diff3 if GNU diff3 is disabled.") and made it the default in
4d5c434ed16e ("diff3: use bsd diff3 by default") after resolving
deficiencies relative to GNU diff3.  Thus, we can now remove the GNU
diff3 build infrastructure and source.

Reviewed by:    bapt, ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46878
9a44e42a2b8f5f78695016344e760d72ad0b1220 Ed Maste 2024-10-02 16:30:57
contrib/tzdata: import tzdata 2026a
6becc3dff922476d667c15f029e520da496d4295 Philip Paeps 2026-03-02 20:34:06
libedit: vendor import version 2026-03-04
MFC After:    1 week
28ff4d35f8b904952bf86b3264650d91cc0cb5d7 Baptiste Daroussin 2026-03-05 07:17:09
iwlwifi: fixup link_id for certain cases
In iwl_mvm_mld_vif_cfg_changed_station() if we do not do MLO (which we
do not do yet at all), dtim_period is not yet set but asssoc is
(our common case) the link_id can become -1 as active_links is always
0 for the non-MLO case.

This leads to logging of a WARN;
Invalid link ID for session protection: 4294967295

Fixup the link_id if it is -1 to be 0.  This is the deflink link_id so
that should always be fine in this case.

For Linux 7.0-rc2 that code is already gone so this is a local temporary
stopgap measure for the mvm-mld devices (e.g., some AX210).

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
760e0a18d3033152899fbd0e3f587dfe3c28d6bf Bjoern A. Zeeb 2026-03-05 09:47:10
libedit: fix use after free
6d2a147ae558ef423e3df451a9049200b291a8d0 Baptiste Daroussin 2026-03-05 16:12:51
zfs rename: properly cleanup on errors occuring before zfs_do_rename()
Reported and tested by:       arrowd
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
ed87040311b88e2c95a791aa049f2c37c857f048 Konstantin Belousov 2026-03-05 02:57:34
zfs: implement AT_RENAME_NOREPLACE
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55539
7a1217ff3bbdd1ef40d1b94170c53611fadeb026 Konstantin Belousov 2026-03-01 13:16:55
Commit group #93: iwlwifi
iwlwifi: mld: move module_init() to SI_ORDER_SECOND

In FreeBSD the iwlwifi driver is a single kernel module.
As for iwlwifi/mvm we need to make sure the common "iwlwifi drv" code
is initialized before trying to register the mld sub-driver
in order for lists, etc. in the registration code to be initialized.
We do this by using an extended (FreeBSD specific) version of
module_init which overrides the order parameter of the SYSINIT.
Otherwise we can randomly (depending on SYSINIT run order) run into
a NULL pointer deref panic.

Sponsored by:   The FreeBSD Foundation
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291120
MFC after:      3 days
551c4cb74a807ceae55288bf273f5cfeb37c7c91 Bjoern A. Zeeb 2026-03-05 12:41:46

iwlwifi: adjust driver description

Adjust the module driver descriptions for mvm and mld to make it clear
that this is not a driver for Linux but a Linux-based driver for FreeBSD.
Cleanup surroundings.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
782fe2f8d90488a61ecdbe1d4b245900a88bee56 Bjoern A. Zeeb 2026-03-05 19:40:15

iwlwifi: mld: add LINUXKPI_PARAM_PREFIX

Add a LINUXKPI_PARAM_PREFIX to mld to properly export the
power_scheme module_param (sysctl).  This is especially needed given
mvm has the same parameter and we need to avoid a clash.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
7db8503bda2724ae145475c3260d581bb98613ad Bjoern A. Zeeb 2026-03-05 19:42:02
iwlwifi: update Intel's mvm/mld drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
95dd8736f846dee1208fe4c306caf1b0baf3caba Bjoern A. Zeeb 2026-03-06 10:45:07
tzcode: Record merge of 2025b
Fixes:                https://cgit.freebsd.org/src/commit/?id=967a49a21a27 ("Update tzcode to 2025b")
9c9f27e8af285d778a312be2f8002c4404c1e77d Dag-Erling Smørgrav 2026-03-08 13:17:57
Set errno to ENOMEM on rallocx() OOM failures
realloc() and rallocx() shares path, and realloc() should set errno to
ENOMEM upon OOM failures.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291677
Obtained from:  jemalloc (commit 38056fea64c34ca4fef0a16212776eaa4de80b78)
Fixes:          https://cgit.freebsd.org/src/commit/?id=c43cad871720 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2059
5583b64f230fe0ea4e3d4bf4566205b521190fbb Juhyung Park 2026-03-03 09:59:33
rallocx path: only set errno on the realloc case.
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291677
Obtained from:  jemalloc (commit 83b075789b4239035931c1ee212576d00153bbf0)
Fixes:          https://cgit.freebsd.org/src/commit/?id=c43cad871720 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2059
2c5cd07828ad76c332e3bedc29fc641809e85396 Qi Wang 2026-03-03 11:55:23
tzcode: Update to 2026a
Many thanks to Paul Eggert for adopting most of our adaptations as
optional features upstream in the previous release (2025c).

MFC after:      1 week
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D55741
ff2c98b30b57b9763e2a6575f729bab676e6c025 Dag-Erling Smørgrav 2026-03-11 03:47:31
irdma(4): update irdma to version 1.3.56-k
Update Intel irdma driver to version 1.3.56-k

Notable changes:
- adding E830 support
- adding E835 support

Signed-off-by: Sobczak, Bartosz <bartosz.sobczak@intel.com>

Reviewed by:    Andrew Zhu <anzhu@netapp.com>
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D55479
5b7aa6c7bc9db19e8bd34a5b7892fb5df2a3068b Bartosz Sobczak 2026-03-13 11:56:25
readelf: Use the gABI name for a dynamic tag value.
e9f3af5b28446ffcf55d8a8f7d59eb89ac3a3b4b Joseph Koshy 2026-03-13 14:34:56
MFV: zlib 1.3.2.
Relnotes:     yes
MFC after:      2 weeks
7aa1dba6b00ccfb7d66627badc8a7aaa06b02946 Xin LI 2026-03-13 23:49:53
tcpdump: Update to 4.99.6
e6083790f217ba7f89cd2957922bd45e35466359 Joseph Mingrone 2026-03-16 02:22:18
ath11k: update Atheros/QCA's ath11k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
187d8a3ce55a4e2d41fbe61465d5ff4ac0fc6bd5 Bjoern A. Zeeb 2026-03-19 23:30:11
Commit group #94: ath12k: update Atheros/QCA's ath12k driver
ath12k: update Atheros/QCA's ath12k driver

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
a96550206e4bde15bf615ff2127b80404a7ec41f Bjoern A. Zeeb 2026-03-19 23:33:40

ath11k: restore module Makefile

During the subtree merge and checking out the updated version of ath12k
parts of the previous ath11k merge were accidentally undone.
Retore the ath11k Makefile as well after 3c4eef5d838b restored the
driver bits.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a96550206e4b ("ath12k: update Atheros/QCA's ath12k ..")
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
f9795615415074b23faf8e5d937c2ef31045d3d0 Bjoern A. Zeeb 2026-03-20 00:17:41
ath11k: reduce diff to upstream Atheros/QCA's ath11k driver
It seems that over the time of merging and only partly working
on making it compile again a few mis-merges happened.
Reduce diff to the v6.19 upstream version so that we only have
additions to the driver (usually guarded by #ifdef __FreeBSD__).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
3c4eef5d838b906e8dc30e29ca98b2c4025e2bb2 Bjoern A. Zeeb 2026-03-19 23:54:21
libcbor: Update to 0.13.0
Sponsored by: The FreeBSD Foundation
b5b9517bfe394e55088f5a05882eabae7e9b7b29 Ed Maste 2026-03-23 15:41:51
file: Parse some UFS2 flags
This allows libmagic to recognize the FS_DOSOFTDEP, FS_SUJ, FS_GJOURNAL,
FS_ACLS, and FS_NFS4ACLS flags on a UFS2 file system.

Accepted upstream as 482259e5e952.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56010
fa03f93e8829a7689101303fbe9fb06654ca14ed Dag-Erling Smørgrav 2026-03-24 11:02:32
x86/cpuid: add CPUID flag for Extended Destination ID support
Introduce the CPUID flag to be used in order to signal the support for
using an extended destination ID in IO-APIC RTEs and MSI address
fields. Such format expands the maximum target APIC ID from 255 to
32768 without requiring the usage of interrupt remapping.

The design document describing the feature can be found at:

http://david.woodhou.se/15-bit-msi.pdf

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
8c986d1645312487adf21a9104d667ac1e19c25f Roger Pau Monné 2022-02-18 08:17:47

Reverted commits

Revert "librdmacm/libibverbs: Statically bound libbnxtre.so.1 to rping"
The commit message has to be rewritten as it is not clear and lacks
some key details about the change.

This reverts commit 35dd53a9e13265f7a479649776453efc5b737a0f.

Reported by: jrtc27
702b3a9a0359680b48b9782cb891c584a4ea5073 Sumit Saxena 2026-01-09 12:01:30
sys/_types.h: avoid use of __has_feature()
Only fairly recent GCC versions support and sys/_types.h must work with
quite old compilers and without sys/cdef.h being included.  The prior
workaround works fine, but we can have the same effect with compiler
macro definitions.  In this specific case, compilers that define the
__intcap_t builtin type will define __SIZEOF_INTCAP__.

This reverts commit 029a09f18032353a9ae874590b879322efc6e53a
This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0

Reviewed by:    imp, des, kib, emaste
Effort:         CHERI upstreaming
Fixes:          https://cgit.freebsd.org/src/commit/?id=85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t")
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D54009
0a64d16cef172bd3c809a8dc9035cd7d981b2951 Brooks Davis 2026-01-09 14:41:21
Commit & revert pair: ophgo: import new .dts
ophgo: import new .dts

Signed-off-by: Martin Filla <freebsd@sysctl.cz>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1844
b55d106df9785d141f9e3e1c916e921df9d877ac Martin Filla 2025-09-09 14:34:38

Revert "ophgo: import new .dts"

This reverts commit b55d106df9785d141f9e3e1c916e921df9d877ac.

Per request of original author, manu, and mmel, revert this
change. While this is a genuinely cool device, there's some issues that
need to be sorted out before moving forward:

o Imported dt-bindings that weren't used and could interfere in the
  future.
o no platform code for sophgo, though it likely needs it
o Potential interference from the dts/dtsi files imported for future
  linux device-tree imports. These are the dts files from the vendor
  sdk, and history has down often upstream introduces enough change
  that keeping them here in the mean time lays the groundwork for
  merge conflicts in the future.

That makes this import premature.  Revert until it's more mature.
3ae56f659aad8621a9d26b5ad0caeeaf1092c4ad Warner Losh 2026-01-10 15:08:30
Commit & revert pair: src.opts.mk: Enable LLDB by default globally
src.opts.mk: Enable LLDB by default globally

Previously it was enabled for all architectures except but RISC-V.
Upstream made significant progress on RISC-V support over the last
year[1], and although there's still some FreeBSD-specific work to do we
can start building it now.

[1] https://jonasdevlieghere.com/post/lldb-2025/

Sponsored by:   The FreeBSD Foundation
c59a47dc6c016dff74466cecb160459980a5d782 Ed Maste 2026-01-22 19:10:12

Revert "src.opts.mk: Enable LLDB by default globally"

This breaks the riscv64 build; clearly the version we have in-tree is
not new enough to work. That or our build system needs tweaking. Either
way, we're not ready for this, and enabling it without testing was
misguided.

This reverts commit c59a47dc6c016dff74466cecb160459980a5d782.
ba56760a4789af06b8b7173700c1f14996ef9b5e Jessica Clarke 2026-01-30 01:11:13
Revert "sym(4): Employ memory barriers also on x86"
The problem will be avoided in a different way.

This reverts commit e769bc77184312b6137a9b180c97b87c0760b849.
bfbcd310bd4997c4ddb21bb81d61f2f29c68937c Marius Strobl 2026-01-28 21:20:42
Revert "acpi: Make taskqueue only run on BSP"
This change causes some ACPI problems, such as power button events being
processed even if just used for resume.

This reverts commit c0df8f6f0e6a5f77ec9140e8075d09c55fe4c3c7.
f3e9c94bc5e6b819c9c95020a2f60d523d55cb66 Aymeric Wibo 2026-02-07 20:09:54
Revert "Additional icache paranoia: non-PLT relocations can modify the text segment."
reloc_nonplt_object, and thus reloc_non_plt, only ever handles data
relocations, so this paranoia is completely unfounded and only has the
effect of significantly slowing down program startup for binaries with
large amounts of code, like Clang.

If this breaks any systems, that would likely be due to insufficient
flushing in the pmap implementation for executable mappings, as this
existing rtld behaviour would mask any such bugs.

This reverts commit 4b51c69976fd84e93ec7695858375c8150c4fe61.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D54221
5beaa1ee7595ce4a09ac4827ec3e3e2aa13a9f67 Jessica Clarke 2026-02-08 16:35:01
Revert "bsdinstall: Create separate datasets for directories in /usr/ports"
This reverts commit 3e8619e535b61c99f0dc50cc6c7e237eb82a8be7.

While it's generally a good idea to have separate datasets for things
like this, it breaks git clone with:
fatal: destination path 'ports' already exists and is not an empty directory.

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2006
be3962a383dbbbd6fef458879173f09dc2f2373d Ricardo Branco 2026-02-08 12:41:04
Commit & revert pair: pcb.h: mark struct pcb to be preserved
pcb.h: mark struct pcb to be preserved

There are programs that depend on this structure (e.g. kernel debuggers)
that breaks when the ABI changes.

Signed-off-by:  Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55149
8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3 Minsoo Choo 2026-02-06 20:03:53

Revert "pcb.h: mark struct pcb to be preserved"

kgdb only uses the marked fields from dumppcb for initial frame
reconstruction.

This reverts commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3.
24038d696e5030f622e87d6651e9dab1cd7fcb2a Konstantin Belousov 2026-02-09 18:25:17
Commit & revert pair: fortune: fix netstat tip
fortune: fix netstat tip

netstati <mumble> 8 reports in bytes per second (averaged over 8
seconds) rather than bits per second because it reports the total
in bits over the 8 seconds...

Sponsored by:           Netflix
8e593a1f143203cace2e14bd6629a8ebdf9b47dc Warner Losh 2026-02-10 14:59:58

Revert "fortune: fix netstat tip"

This reverts commit 8e593a1f143203cace2e14bd6629a8ebdf9b47dc. I was
totally wrong, so just revert and get on with it.

Sponsored by:           Netflix
00e0b7bdb93972590362c5942b489ffed2a2ea20 Warner Losh 2026-02-19 05:53:47
Revert "mixer(8): Implement hot-swapping"
We now have devd rules in snd.conf that achieve this in a much cleaner
way.

This reverts commit 9aac27599acaffa21ff69c5be8a2d71d29cc3d6b.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55532
d00b32c2d70ce79fddb94dd990d2b162c8fc3a85 Christos Margiolis 2026-03-03 11:32:42
Commit & revert pair: virtio: Restore mb() calls
virtio: Restore mb() calls

Until an issue seen on amd64 can be investigated restore two mb() calls
to virtio.

Reviewed by:    andrew
Fixes:  https://cgit.freebsd.org/src/commit/?id=c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations")
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55766
d99e725c26a7745aa349eab01ae56ca630b6d0f5 Andrew Turner 2026-03-10 19:08:38

Revert "virtio: Restore mb() calls"

This reverts commit d99e725c26a7745aa349eab01ae56ca630b6d0f5.
522012c8bd079879b82aaa403e4da3c1ab9fc8a9 Andrew Turner 2026-03-10 19:09:41
Revert "Makefile.inc1: Don't force LLVM_BINUTILS off for cross-tools"
This reverts commit 858f53dd43ecb84cf2597229e9dbda2f242d9dd6.

It is not clear to me why building from Linux or MacOS fails to build
the toolchain, so reintroduce the long-standing slightly-broken
toolchain until that can be determined.

Reported by:    vexeduxr, jrtc27
4a8055914d6a60714f27379cbff8b2e9198157f6 Ed Maste 2026-03-13 20:45:30
Commit & revert pair: bsd.own.mk: Deorbit compat include of bsd.compiler.mk
bsd.own.mk: Deorbit compat include of bsd.compiler.mk

Commit b946bedd09d3bd1 ("Previous versions of bsd.own.mk [...]")
mentions that bsd.own.mk included bsd.compiler.mk as a temporary
workaround and was destined to be removed in FreeBSD 12. Do that now.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203540
Reviewed by:    bnovkov, imp
Approved by:    bnovkov (mentor)
Differential Revision:  https://reviews.freebsd.org/D55867
0bebad8d072bb7abef1cea0d8c8d04d500913adf Mateusz Piotrowski 2026-03-15 18:35:50

Revert "bsd.own.mk: Deorbit compat include of bsd.compiler.mk"

This reverts commit 0bebad8d072bb7abef1cea0d8c8d04d500913adf.

It might be that all that's needed to fix this is to add
".include <bsd.compiler.mk>" to some Makefiles. I'll look into it soon
but for now let's unbreak HEAD.

Approved by:            bnovkov (mentor)
Differential Revision:  https://reviews.freebsd.org/D55869
73f37a69f65ef4a6243a1b80bd763271560fa677 Mateusz Piotrowski 2026-03-15 19:31:52
Commit group #95: revert-pair-libcrypto
libcrypto: compile all PIC objects with -DOPENSSL_PIC

This change modifies the libcrypto PIC objects to always compile with
`-DOPENSSL_PIC` to restore parity with the upstream build process. This
ensures that `-DOPENSSL_PIC` is used whenever building the auxiliary
shared objects. In this case, just the legacy provider (we no longer
distribute the fips provider).

MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D44896
14b9955e57cc28b61e785165b9effcbe620edb46 Enji Cooper 2026-03-19 23:56:41

Revert "libcrypto: compile all PIC objects with -DOPENSSL_PIC"

This commit broke the build with some build options.

Some validation needs to be done to confirm that moving the preprocessor
argument to `secure/lib/libcrypto/Makefile.inc` works without breaking
the build, but revert for now until a `tinderbox` run can be done with
the change.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293934
Reported by:    Jenkins, Trond Endrestøl

This reverts commit 14b9955e57cc28b61e785165b9effcbe620edb46.
67b918e03475e780854a43fe4eb7c8e95f4deb29 Enji Cooper 2026-03-20 20:08:09

libcrypto: compile all PIC objects with -DOPENSSL_PIC -fPIC

This change modifies the libcrypto PIC objects to always compile with
`-DOPENSSL_PIC -fPIC` to restore parity with the upstream build process.
This ensures that the legacy provider is built with parity to the
upstream legacy provider.

MFC after:              12 days
Tested with:            `make check` (legacy provider), `make universe`
Fixes:                  https://cgit.freebsd.org/src/commit/?id=14b9955e
Differential Revision:  https://reviews.freebsd.org/D44896
3797fe720a37ff9fb5b20546494ef1c4a6c01541 Enji Cooper 2026-03-22 00:39:16
Revert "vmimage.subr: pkg autoremove after pkg install"
This reverts commit 6a13aeac3c1f98db7cf156f24a4d6bc8d3c321f6.

The "bogus dependencies being installed" issue was traced down to pkg
confusion surrounding libclang_rt.asan-i386.so linking to a 32-bit
libgcc_s.so.1, and a more minimal workaround of "install clibs-lib32"
has been applied, so this hack is no longer required.

MFC after:      3 days
Sponsored by:   Amazon
4b29bf721ef09c399f3e4a4ab5ca9f549c5b1550 Colin Percival 2026-03-21 16:00:15
Commit & revert pair: capsicum-test: remove stale file
capsicum-test: remove stale file
20b99e3a147963c6ef715112bd38e349c7a5a459 Mariusz Zaborski 2026-03-02 07:41:21

Revert "capsicum-test: remove stale file"

This was unintended, sorry.

This reverts commit 20b99e3a147963c6ef715112bd38e349c7a5a459.
fce6921464b5b21836a304d0460c69db4a6f3942 Mariusz Zaborski 2026-03-23 14:44:34
etc/mtree: Restore removed package tags
Following commit 436618a427b4 which added package tags to mtree,
some of the tags were later removed due to an issue with empty
packages being created.  That problem has been fixed by commit
7965c93e4d41, so we can now restore the tags that were removed.

This reverts commit 00352ef6d2a013650f0ab2a4c9b016c22552ed25.
This reverts commit 1fbdb149aa486961c5d9d6403065e90123b3f5fe.
This reverts commit ef2d586d7efb908bf39e7d5eb5d4305193d0ca6e.
This reverts commit 2a8a6179eb6cef8ba1a417a4c8a1f7063c704533.

MFC after:      2 weeks (stable/15 only)
Reviewed by:    des, bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D55645
Sponsored by:           https://www.patreon.com/bsdivy
8ba3ada41dda46b41100fa913473058856816e0c Lexi Winter 2026-03-27 14:35:16
Commit & revert pair: dpaa2: Perform bus_dma pre-write sync before enqueue operation
dpaa2: Perform bus_dma pre-write sync before enqueue operation

Without a proper synchronization payload of the egress TCP segments
can be corrupted as tuexen@ described in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006#c31.

This patch is indirectly related to 292006 because a properly enabled
and announced support for the TX checksum offloading hides potentially
corrupted frame payload.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Reported by:    tuexen@
Reviewed by:    ...
Tested by:      dsl@
Differential Revision:  <https://reviews.freebsd.org/D###>
MFC after:      3 days
968164eb650fd986f293512a3faac5c1c9e4d51f Dmitry Salychev 2026-03-28 18:57:45

Revert "dpaa2: Perform bus_dma pre-write sync before enqueue operation"

This reverts commit 968164eb650fd986f293512a3faac5c1c9e4d51f.
c78e653b49f7039bb8c84a6ad79be21b90aaf464 Dmitry Salychev 2026-03-29 18:33:33

Unclassified commits

Not classified automatically, and waiting for manual attention.

-- no commits in this category this week --

Technical notes

Dates:

Automatic grouping:

Automatic categories:

Source code:


Generated with commits-periodical 0.20 at 2026-04-06 17:22:00+00:00.

This work is supported by Tarsnap Backup Inc.

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