FreeBSD/src d779cb9lib/libc/amd64/string memrchr.S

libc/amd64: rewrite memrchr() baseline impl. to read the string from the back

This ensures O(1) behaviour if the character is a constant offset
from the end of the string, regardless of how long the string is.

Reported by:    Mikael Simonsson <m at mikaelsimonsson.com>
Reviewed by:    benni
PR:             288321
MFC after:      1 month

(cherry picked from commit 4b15965daa99044daf184221b7c283bf7f2d7e66)
DeltaFile
+71-75lib/libc/amd64/string/memrchr.S
+71-751 files

FreeBSD/src 7caa8fblib/libc/amd64/string memrchr.S

libc/amd64: rewrite memrchr() scalar impl. to read the string from the back

A very simple implementation as I don't have the patience right now
to write a full SWAR kernel.  Should still do the trick if you wish
to opt out of SSE for some reason.

Reported by:    Mikael Simonsson <m at mikaelsimonsson.com>
Reviewed by:    strajabot
PR:             288321
MFC after:      1 month

(cherry picked from commit 30acc84270266e41f66cf572f67c3290d923da2f)
DeltaFile
+34-38lib/libc/amd64/string/memrchr.S
+34-381 files

FreeBSD/src fd9e09csys/kern sys_procdesc.c kern_event.c

kern: replace several EBADF with EINVAL

EBADF semantic is that the passed fd is invalid, not that it is of wrong
type.  Using EBADF in these places in kern_event.c and sys_procdesc.c
give bad examples to copy from.

Note that places in kern_event.c that checks KQ_CLOSING and return EBADF
are kept, since KQ_CLOSING is the transient state before the fd is
finally closed and become eligible for EBADF.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D52410
DeltaFile
+2-2sys/kern/sys_procdesc.c
+1-1sys/kern/kern_event.c
+3-32 files

FreeBSD/src fdb3b69secure/lib/libcrypto/man/man3 Makefile, secure/lib/libcrypto/man/man7 Makefile

Update the installed manpages to match OpenSSL 3.5.1

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D52008
DeltaFile
+2,901-2,082secure/lib/libcrypto/man/man3/Makefile
+2-36secure/lib/libcrypto/man/man7/Makefile
+2,903-2,1182 files

FreeBSD/src d661670sys/net80211 ieee80211_ht.c

[net80211] Quieten the logging from ieee80211_vht_get_vhtflags()

The commit in Fixes: introduced logging the output bits from
ieee80211_vht_get_vhtflags().  This ends up causing quite a lot
of logging when net80211 is doing things like processing
received beacons.

So just remove the logging; if it's needed again then a developer
can add it back to that location, or just use dtrace to capture
the return value.

Fixes:  4bf049bfeefd9
Differential Revision: https://reviews.freebsd.org/D52142
Reviewed by:    bz
DeltaFile
+1-1sys/net80211/ieee80211_ht.c
+1-11 files

FreeBSD/src 14b61b2usr.bin/man man.sh man.1

man: Add -l option

Add a -l option which causes man to interpret all arguments as paths to
open directly rather than man pages to search for in MANPATH.  See the
PR for a detailed rationale.

PR:             289245
MFC after:      1 week
Reviewed by:    ziaee, emaste
Differential Revision:  https://reviews.freebsd.org/D52385
DeltaFile
+24-9usr.bin/man/man.sh
+18-6usr.bin/man/man.1
+42-152 files

FreeBSD/src 5a01194contrib/unbound configure ltmain.sh, contrib/unbound/doc unbound.conf.5 unbound-control.8

unbound: Update to 1.23.1

Release notes at
        https://nlnetlabs.nl/news/2025/Jul/16/unbound-1.23.1-released/

Since we don't enable ECS, this is mostly a nop for us.

Merge commit 'c8864f6ba46ff3271d97b4ae1c3cc6ce01eaf18a'

MFC after:      3 days
DeltaFile
+2,626-1,865contrib/unbound/configure
+967-592contrib/unbound/ltmain.sh
+620-121contrib/unbound/doc/unbound.conf.5
+306-215lib/libunbound/config.h
+185-175contrib/unbound/config.h.in
+313-30contrib/unbound/doc/unbound-control.8
+5,017-2,99822 files not shown
+5,644-3,18928 files

FreeBSD/src c8864f6. config.sub configure, edns-subnet subnetmod.c

Vendor import of Unbound 1.23.1
DeltaFile
+138-14edns-subnet/subnetmod.c
+19-9config.sub
+13-12configure
+13-12configure~
+10-7config.guess
+3-2configure.ac
+196-5610 files not shown
+211-6716 files

FreeBSD/src 11ace56contrib/libxo/libxo xo.h xo_encoder.h

contrib/libxo: fix API header files inclusions in C++ source files

C++ source files need `extern "C"` to disable C++ name mangling.

MFC after:      1 week
Reviewed by:    aokblast (previous version), phil, imp (previous version)
Differential Revision:  https://reviews.freebsd.org/D47930
DeltaFile
+8-0contrib/libxo/libxo/xo.h
+8-0contrib/libxo/libxo/xo_encoder.h
+16-02 files

FreeBSD/src 6d62463usr.sbin/newsyslog newsyslog.conf.5

newsyslog.conf(5): Don't suppress space after <compress> directive

Because newsyslog(8) actually _requires_ a space after the <compress>
directive.

Reviewed by:    bcr
Differential Revision: https://reviews.freebsd.org/D52414
DeltaFile
+1-1usr.sbin/newsyslog/newsyslog.conf.5
+1-11 files

FreeBSD/src 4341f92share/mk bsd.cpu.mk

share/mk: Fix a heuristic in bsd.cpu.mk

When cross-building from MacOS we have MACHINE=arm64 MACHINE_ARCH=arm,
so bsd.cpu.mk infers that sizeof(long) == 4, but of course it isn't.
This breaks the bootstrap build of openssl, which tests
MACHINE_ABI:Mlong64 to decide whether to build ecp_nistp224.c.  It
doesn't, and crypto/openssl/freebsd/include/openssl/configuration.h
undefines OPENSSL_NO_EC_NISTP_64_GCC_128, so we end up with a link
error.

Reviewed by:    ngie, emaste
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D52340
DeltaFile
+5-2share/mk/bsd.cpu.mk
+5-21 files

FreeBSD/src ac2f284etc/mtree BSD.usr.dist

BSD.usr.dist: remove obsolete usr/share/examples/drivers entry

In base 8f0a6a9aadb1f, usr/share/examples/drivers was cleaned up,
because it contained unmaintained scripts. The directory itself is
cleaned up by ObsoleteFiles.inc, but there was still an entry in
BSD.usr.dist that re-created the directory. Remove it.

Fixes:          8f0a6a9aadb1
MFC after:      3 days
DeltaFile
+0-2etc/mtree/BSD.usr.dist
+0-21 files

FreeBSD/src b84156esys/fs/nfsserver nfs_nfsdport.c

nfsd: Fix the NFSv4 Readdir operation for an empty ZFS dir

Commit 9a3edc8 modified the behaviour of ZFS's
VOP_READDIR() such that it will reply EINVAL for
an offset past EOF on the directory.

This exposed a latent bug in the NFSv4 Readdir
code, which would attempt a Readdir with an
offset beyond EOF for a directory that consists
of only "." and "..". This happened because NFSv4
does not reply "." or ".." to the client and, after
skipping over them, attempted another VOP_READDIR().

This patch fixes the problem by checking the eofflag
for the case where all entries have been skipped over.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D52370

    [2 lines not shown]
DeltaFile
+3-0sys/fs/nfsserver/nfs_nfsdport.c
+3-01 files

FreeBSD/src 7b4562e. .git-blame-ignore-revs

git-blame-ignore-revs: sys/cpu.h style(9) fixes

MFC after:      3 days
DeltaFile
+2-0.git-blame-ignore-revs
+2-01 files

FreeBSD/src 0737e2asys/sys cpu.h

sys/cpu.h: Some style(9) fixes

MFC after:      3 days
DeltaFile
+14-8sys/sys/cpu.h
+14-81 files

FreeBSD/src dff11c4sys/dev/rtwn if_rtwn_tx.c if_rtwn.c, sys/dev/rtwn/rtl8192c r92c_tx.c

rtwn: enable seqno offload; migrate to use ieee80211_output_seqno_assign()

This should both enable the sequence number offloading and disable
the net80211 TX lock from being acquired/released/checked.

Locally tested:

* RTL8812AU, STA mode

Reviewed by: bz
Differential Revision:  https://reviews.freebsd.org/D52301
Differential Revision:  https://reviews.freebsd.org/D50693
DeltaFile
+4-8sys/dev/rtwn/rtl8812a/r12a_tx.c
+5-6sys/dev/rtwn/rtl8192c/r92c_tx.c
+8-0sys/dev/rtwn/if_rtwn_tx.c
+3-0sys/dev/rtwn/if_rtwn.c
+20-144 files

FreeBSD/src 7c448f5sys/dev/virtio/network if_vtnet.c

vtnet: fix compilation for NOIP configs

Reported by:    bz
Fixes:          1c23d8f9f398 ("vtnet: improve checksum offloading")
MFC after:      3 days
Sponsored by:   Netflix, Inc.
DeltaFile
+9-0sys/dev/virtio/network/if_vtnet.c
+9-01 files

FreeBSD/src 5e82eecstand/fonts INDEX.fonts

stand: Remove Spleen 32x64 fonts from INDEX

The Spleen 32x64 fonts cause some systems such as the AMD Framework 16
to boot extremely slowly.  Adding screen.font="16x32" to
/boot/loader.conf is a partial workaround, but text displayed before the
boot menu still takes ~30 seconds to render on that laptop.  With this
change, the same text renders immediately.

By leaving the font files in place but removing them from the INDEX,
users who want to use them can still load them manually.  Once pending
work is committed to allow normal booting with these fonts, they can be
added back to the INDEX.

PR:             289007
Reviewed by:    emaste, kevans, tsoome, ziaee
Fixes:          1ec2c8b2f364 (stand: Enable Spleen 32x64 font in the bootloader)
Sponsored by:   The FreeBSD Foundation
DeltaFile
+0-3stand/fonts/INDEX.fonts
+0-31 files

FreeBSD/src 4ab64e3sys/compat/linuxkpi/common/include/linux device.h, sys/compat/linuxkpi/common/src linux_devres.c

LinuxKPI: devres: divorce dem_kfree from lkpi_devm_kmalloc_release

dem_kfree() is called from all over the place and should actually
do something;  contrary to lkpi_devm_kmalloc_release() it can also
take a const void *.  We have to __DECONST() that though as the
entire devres framework does otherwise not take a const argument.

This was discovered during the rtw89 upadte to 6.16.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52082
DeltaFile
+25-1sys/compat/linuxkpi/common/src/linux_devres.c
+3-2sys/compat/linuxkpi/common/include/linux/device.h
+28-32 files

FreeBSD/src 2a44e10sys/compat/linuxkpi/common/include/linux math64.h

LinuxKPI: maths64: implement roundup_u64()

Needed by a wifi driver update.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52080
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/math64.h
+6-01 files

FreeBSD/src 7c47393sys/compat/linuxkpi/common/include/kunit static_stub.h, sys/compat/linuxkpi/dummy/include/kunit skbuff.h test-bug.h

LinuxKPI: kunit: add static_stub.h and more dummy headers

These came up during a wifi driver update.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52079
DeltaFile
+15-0sys/compat/linuxkpi/common/include/kunit/static_stub.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/skbuff.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/test-bug.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/test.h
+15-04 files

FreeBSD/src 70c508esys/compat/linuxkpi/common/include/linux overflow.h

LinuxKPI: sync overflow.h from Linux v6.16

It seems overflow.h wsa imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for wireless driver updates.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Obtained from:  git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
                038d61fd642278 (tag: v6.16)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52078
DeltaFile
+157-31sys/compat/linuxkpi/common/include/linux/overflow.h
+157-311 files

FreeBSD/src ff5bcb7sys/compat/linuxkpi/common/include/linux compiler.h

LinuxKPI: add __struct_size

Use __builtin_object_size() by default.
If __builtin_dynamic_object_size() is available use that instead.

I would hope that in a future version we can remove the conditional
checks but in order to be able to MFC this without checking all
compiler versions simply keep it this way for now.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52077
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/compiler.h
+6-01 files

FreeBSD/src 39e9290sys/compat/linuxkpi/common/include/linux cleanup.h slab.h

LinuxKPI: cleanup: implement __free() and DEFINE_FREE(); use for kfree()

A wifi driver update needs this.

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52075
DeltaFile
+13-1sys/compat/linuxkpi/common/include/linux/cleanup.h
+4-0sys/compat/linuxkpi/common/include/linux/slab.h
+17-12 files

FreeBSD/src 81cb7c4sys/compat/linuxkpi/common/include/linux timer.h, sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: rename from_timer() to timer_container_of()

With Linux 6.16 from_timer() got renamed to timer_container_of(); add
the LINUXKPI_VERSION check with a default to the current version.
Update all in-tree consumers (apart from wireless drivers managed
otherwise).

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52073
DeltaFile
+5-0sys/compat/linuxkpi/common/include/linux/timer.h
+2-2sys/dev/irdma/irdma_utils.c
+1-1sys/dev/irdma/irdma_cm.c
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-1sys/dev/qat/qat_common/adf_gen4_timer.c
+10-55 files

FreeBSD/src 3f48a0fsys/compat/linuxkpi/common/include/linux cleanup.h rcupdate.h

LinuxKPI: add DEFINE_LOCK_GUARD_0 for rcu

This adds guard support for non-real-types like rcu locking meaning
that we need to keep the lock state separately ourselves.  _T is still
special and needs to be updated.  Given it may not be used it needs
an __unused attribute (we are using the LinuxKPI __maybe_unused which
indeed is more expressive in this case).

Sponsored by:   The FreeBSD Foundation (initially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52076
DeltaFile
+35-0sys/compat/linuxkpi/common/include/linux/cleanup.h
+4-1sys/compat/linuxkpi/common/include/linux/rcupdate.h
+39-12 files

FreeBSD/src 5cb64a1sys/compat/linuxkpi/common/include/linux timer.h, sys/compat/linuxkpi/common/src linux_compat.c

LinuxKPI: timer KPI *_timer -> timer_*

del_timer() got renamed to timer_delete() approximately in Linux 6.2
(similar for *_sync and likely others).
Keep the old functions as compat; unclear when we can gc them.
We should also re-define them with a linuxkpi_ prefix to avoid possible
conflicts in the future if we do a full pass over this at some point.

Sponsored by:   The FreeBSD Foundation (intiially)
MFC after:      3 days
X-MFC;          preserve symbols, not inline
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52074
DeltaFile
+14-2sys/compat/linuxkpi/common/include/linux/timer.h
+2-9sys/compat/linuxkpi/common/src/linux_compat.c
+16-112 files

FreeBSD/src 736b16esys/compat/linuxkpi/common/include/linux math.h

LinuxKPI: correct the LINUXKPI_VERSION check for abs_diff()

The code introduced abs_diff() as migrated from drm to standard
linux headers.  The LINUXKPI_VERSION check did not allow this to
be visible by default in-tree.  Make sure the v6.6 check is optional.
drm-kmod always defines LINUXKPI_VERSION so this should be fine.

Sponsored by:   The FreeBSD Foundation (initially)
Fixes:          afc450fac9f04
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52071
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/math.h
+1-11 files

FreeBSD/src bbeeb58sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach

In linux_pci_attach_device() allocate a LinuxKPI pci_dev for each device in
the hierarchy up to the root port[1] as we cannot do that later on demand
as we may be in a context where we may not sleep.

Take special care of DRM as there is a non-PCI device in the chain which
needs to be skipped.

iwlwifi(4) can hit this case called from a callout.

While here leave a comment sa the cleanup order of
linux_pci_attach_device() needs correction seperately.

Sponsored by:   The FreeBSD Foundation (initially)
PR:             283027
Suggested by:   jhb [1]
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52069
DeltaFile
+40-7sys/compat/linuxkpi/common/src/linux_pci.c
+40-71 files

FreeBSD/src c1264b6sys/compat/linuxkpi/common/include/acpi acpi.h

LinuxKPI: acpi; fix type to acpi_get_handle()

The native AcpiGetHandle() and acpi_get_handle() take a
const char * argument for pathname and not an acpi_string (char *).
For that they spell it out fully as 'const char *', so should we.

Sponsored by:   The FreeBSD Foundation (intially)
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52072
DeltaFile
+1-1sys/compat/linuxkpi/common/include/acpi/acpi.h
+1-11 files