FreeBSD/src d326ee6 — sys/x86/x86 mp_x86.c

x86/mp_x86.c: unbreak COUNT_IPIS

Fixes:  3a0e2ca3eecd ("x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS")

(cherry picked from commit 40582412d3fc6c68bb5c90fa7878998ba7f799e3)
DeltaFile
+2-2sys/x86/x86/mp_x86.c
+2-21 files

FreeBSD/src 9034531 — contrib/sqlite3 sqlite3.h shell.c, contrib/sqlite3/autosetup sqlite-config.tcl jimsh0.c

sqlite3: Vendor import of sqlite3 3.54.1

Release notes at https://sqlite.org/releaselog/3_54_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3540100.tar.gz
Security:       84cd82e1-d49f-11f1-bae2-3497f65b111b
                CVE-2026-119371
                CVE-2026-119372
                CVE-2026-119373
                CVE-2026-119374
                CVE-2026-119375
                CVE-2026-119376
                CVE-2026-119377
                CVE-2026-119378
                CVE-2026-119379
                CVE-2026-119591

Merge commit '8fcea37c441fdc95cbfc8c34eeb0dcddbc02dca1'

(cherry picked from commit 71bb028fc165e51e6d04e509749da48f48f3aab4)
DeltaFile
+5,620-4,102contrib/sqlite3/sqlite3.c
+3,375-809contrib/sqlite3/shell.c
+1,963-977contrib/sqlite3/autosetup/jimsh0.c
+162-87contrib/sqlite3/autosetup/sqlite-config.tcl
+126-28contrib/sqlite3/sqlite3.h
+72-15contrib/sqlite3/tea/generic/tclsqlite3.c
+11,318-6,0186 files not shown
+11,347-6,03912 files

FreeBSD/src 52fd2aa — sys/powerpc/powerpc mp_machdep.c

powerpc: powerpc_ipi_handler(): Stop first, preempt last

Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

An IPI_STOP/IPI_STOP_HARD request should be processed immediately to
avoid risks that further processing changes the system state on panic,
or worse itself causes another panic on corrupted kernel state.

While here, move IPI_AST handling just before IPI_PREEMPT.  We currently
do not need to do anything for it, but if we were to, it is likely that
would have to happen after other IPIs but IPI_PREEMPT.

Reviewed by:    jhibbits
Fixes:          9d5a22b928c2 ("MFp4: SMP support")
Fixes:          12640815f815 ("MFp4: SMP support")
Fixes:          7ed09a6778d3 ("powerpc: Rework IPI message processing")
MFC after:      1 week

    [4 lines not shown]
DeltaFile
+17-11sys/powerpc/powerpc/mp_machdep.c
+17-111 files

FreeBSD/src d54cae6 — sys/x86/x86 mp_x86.c

x86: ipi_bitmap_handler(): Preempt last, reduce critical section

Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

Reduce the critical section to be in force only around hardclockintr(),
which needs it to execute entirely without preemption (because of code
it calls that can enter a critical section; interrupts are already
disabled in this handler, as usual).

The critical_exit() following hardclockintr() may cause preemption if
due.  If that happens, there is no need to preempt again on IPI_PREEMPT,
so make sure sched_preempt() is not called in this case.

This fixes inadvertent removal of the optimization that sched_preempt()
should be called outside of a critical section to perform an immediate
context switch in the case of IPI_HARDCLOCK and IPI_PREEMPT being
handled at the same time.

    [12 lines not shown]
DeltaFile
+27-18sys/x86/x86/mp_x86.c
+27-181 files

FreeBSD/src a6bcee2 — sys/x86/x86 mp_x86.c

x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS

A preemption could occur before the updates to the initial CPU's IPI
counters, leading to a potential non-atomic updates of these counters
from another CPU.

Reviewed by:    kib
Fixes:          ff326a187907 ("x86: Restore the critical section (...)")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60862

(cherry picked from commit 3a0e2ca3eecd3176fa7dd139e59913a67c858ac9)
DeltaFile
+12-13sys/x86/x86/mp_x86.c
+12-131 files

FreeBSD/src f27e4af — sys/kern sched_ule.c

sched_ule: Use TDQ_CPU() macro instead of fiddling with DPCPU

No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 79ca9f787ca92018a1374242bb77252af6fce0d0)
DeltaFile
+1-1sys/kern/sched_ule.c
+1-11 files

FreeBSD/src c9e5bf3 — sys/kern sched_ule.c sched_4bsd.c

sched: INVARIANTS: Check sched_preempt() is called on 'curthread'

sched_preempt() does not support operating on a remote thread.  If you
are looking to influence CPU allocation on another thread, see, e.g.,
cpuset_setthread(), which in the end calls sched_affinity().

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit f19009020a33d07d7cad9393b4bf0a36f267cd07)
DeltaFile
+1-0sys/kern/sched_ule.c
+1-0sys/kern/sched_4bsd.c
+2-02 files

FreeBSD/src 97313fe — sys/kern sched_ule.c

sched_ule: sched_affinity(): Delineate steps

No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit a1fe7f00bc452653426493c511d288e5a4e7862d)
DeltaFile
+4-2sys/kern/sched_ule.c
+4-21 files

FreeBSD/src 051de28 — . ObsoleteFiles.inc

ObsoleteFiles.inc: <sys/kpilite.h> was removed

Reported by:    glebius
Fixes:          e478037df4f1 ("systm.h: Remove unused <sys/kpilite.h>")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit b42793d4bcdf73475b77a26c9dbacd45f8876621)
DeltaFile
+3-0ObsoleteFiles.inc
+3-01 files

FreeBSD/src 847ef7c — sys/kern sched_ule.c

sched_ule: tdq_runq_add(): Scope variables, delineate the different steps

For better readability.

No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit d5e9c642307c13b8058609f421b63e2c72bab45f)
DeltaFile
+5-3sys/kern/sched_ule.c
+5-31 files

FreeBSD/src 7118fa2 — sys/kern sched_ule.c

sched_ule: tdq_notify(): Fix a typo in a comment

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ea1da6a51a5aa0c949fc125aece6b88a68e67a3a)
DeltaFile
+1-1sys/kern/sched_ule.c
+1-11 files

FreeBSD/src b8cadc7 — sys/sys systm.h kpilite.h

systm.h: Remove unused <sys/kpilite.h>

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

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

That problem, if it materializes again, could be quickly circumvented
without this trickery by the use of non-inline functions, or using
inline functions referencing a variable filled at kernel startup with
the desired offset.  The trickery of using offsets computed at
compile-time appears necessary only in the case of extremely performance

    [9 lines not shown]
DeltaFile
+0-52sys/sys/kpilite.h
+1-1sys/sys/systm.h
+1-532 files

FreeBSD/src 1bdd260 — sys/sys sched.h

sched.h: Include <sys/pcpu.h> unconditionally

Even if SCHED_STATS is not defined, this header is necessary to provide
a definition of 'curthread' used in sched_pin() and sched_unpin().

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit b6d10a962448bf03400dd381b2083d1f547f869c)
DeltaFile
+0-2sys/sys/sched.h
+0-21 files

FreeBSD/src 2065d90 — sys/sys sched.h

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

Fixes:          42490d5cd29d ("sched: New scheduler interface definition scheme")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 0bccbb9e98930f55bff5a943c881e460d4f31aec)
DeltaFile
+1-2sys/sys/sched.h
+1-21 files

FreeBSD/src 1cfafa7 — sys/kern sched_4bsd.c sched_ule.c, sys/riscv/riscv mp_machdep.c

sched: New scheduler interface definition scheme

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

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


    [50 lines not shown]
DeltaFile
+347-168sys/sys/sched.h
+21-75sys/kern/sched_shim.c
+6-56sys/kern/sched_ule.c
+2-52sys/kern/sched_4bsd.c
+1-1sys/x86/x86/mp_x86.c
+1-1sys/riscv/riscv/mp_machdep.c
+378-3535 files not shown
+383-35811 files

FreeBSD/src 7817357 — sys/kern kern_prot.c

cred: freebsd14_setgroups(): Remove a now-unnecessary local variable

MFC with:       e6fbef451dd4 ("cred: Fix a race in the FreeBSD-14-compatible setgroups(2)")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit e40d60838c9a0ebe5e5fb0e3cb00e7b08dd8c959)
DeltaFile
+2-5sys/kern/kern_prot.c
+2-51 files

FreeBSD/src 6f2f1f3 — sys/kern kern_prot.c, sys/sys syscallsubr.h

cred: Fix a race in the FreeBSD-14-compatible setgroups(2)

The freebsd14_setgroups() function would try to modify the effective GID
on the current process' credentials without holding the process lock,
allowing races with other threads concurrently modifying the process
credentials.  In the worst case, freebsd14_setgroups() could be
manipulating a 'struct ucred' already freed by another thread (in the
very small window after reading 'p_ucred' without lock but before
modifying the effective GID).  Concurrent uses of freebsd14_setgroups()
or setcred() could also lead to non-atomic credentials modifications.

Fix this by making kern_setgroups() take a new boolean indicating
whether the passed array includes the effective GID in its first slot.
When this boolean is true, it internally keeps the effective GID in
a separate variable, pretends that the groups[] array that was passed
actually starts at 'groups + 1', do the usual steps to set the
supplementary groups and new extra ones to set the effective GID along,
without releasing the process lock in between.


    [7 lines not shown]
DeltaFile
+43-15sys/kern/kern_prot.c
+2-1sys/sys/syscallsubr.h
+45-162 files

FreeBSD/src 97d0c19 — share/misc bsd-family-tree

bsd-family-tree: Add NetBSD 11.1
DeltaFile
+4-0share/misc/bsd-family-tree
+4-01 files

FreeBSD/src 208d30a — sys/dev/amdsmu amdsmu.c

amdsmu(4): Fix 32-bit compile

For what is worth, since i386 is going away soon and still does not
compile.

Fixes:          cd96657b6708 ("amdsmu: Print how long system spent in S0i3")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-1sys/dev/amdsmu/amdsmu.c
+3-11 files

FreeBSD/src cd33fd7 — sys/sys module.h

sys/modules.h: Fix too long line

No functional change (intended).

Fixes:          f4b3640475ce ("inline atomics and allow tied modules to inline locks")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/sys/module.h
+1-11 files

FreeBSD/src 9145e8a — sys/dev/bnxt/bnxt_en if_bnxt.c

bnxt_en: update the driver version to 239.1.153.0

bnxt_en driver version has not been updated for
a while, updating the version now so it better
reflects the current state of the driver.

Sponsored by:   Broadcom Inc
DeltaFile
+1-1sys/dev/bnxt/bnxt_en/if_bnxt.c
+1-11 files

FreeBSD/src f739d9f — sys/compat/linuxkpi/common/src linux_tasklet.c

linuxkpi: Do not wait for a disabled tasklet in tasklet_unlock_wait()

tasklet_unlock_wait() waited for the tasklet state to become idle.  Linux
only waits for TASKLET_STATE_RUN, i.e. for a tasklet that is currently
executing.  A tasklet which is scheduled but disabled does not run until
it is enabled again, so in LinuxKPI it stays in the BUSY (queued) state and
the waiter never returns.

This is what happens when unloading i915: execlists_reset_prepare()
disables the engine tasklet with __tasklet_disable_sync_once() while the
tasklet is queued and kldunload loops forever in pause().

Do not wait if the tasklet is only queued and disabled.

Reviewed by:    bz
Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+19-2sys/compat/linuxkpi/common/src/linux_tasklet.c
+19-21 files

FreeBSD/src c15aab0 — sys/compat/linuxkpi/common/src linux_i2c.c

linuxkpi: Fix lkpi_i2c_del_adapter() leaving the devices behind

lkpi_i2c_del_adapter() looked for the lkpi_iic or lkpi_iicbb device to
delete with device_find_child() on increasing unit numbers, and stopped at
the first unit that does not exist.  Units are allocated globally per
devclass, so as soon as one adapter was removed (leaving a hole) or when the
units of a parent do not start at 0, the adapter was not found and its
device was never deleted.  The i2c devices of a driver such as i915 then
accumulate, with a new set of unit numbers, each time it is loaded.

Walk the children of the parent instead and match on the adapter.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+30-28sys/compat/linuxkpi/common/src/linux_i2c.c
+30-281 files

FreeBSD/src 71d26da — sys/compat/linuxkpi/common/src linux_pci.c

linuxkpi: Release devres on PCI driver detach

linux_pci_detach_device() called the driver remove method and then only
dropped its reference on the device, expecting the devres list to be
released from lkpi_pci_dev_release() once the last reference is gone.

That never happens when a devres action itself holds a reference on the
device.  The typical case is devm_drm_dev_alloc(): the drm_device takes a
reference on its parent and the matching drm_dev_put() is a devres
action.  The device is thus never released, drm_dev_release() is never
called and the DRM device and everything it owns is leaked, which makes
unloading drm-kmod drivers fail ("failed due to N other pending
references on the LinuxKPI device") and leaves the module unloadable or
crashing.

Linux releases the devres resources when a driver is unbound, so do the
same: call lkpi_devres_release_free_list() right after the remove method.
The list is empty when lkpi_pci_dev_release() runs later.


    [2 lines not shown]
DeltaFile
+8-0sys/compat/linuxkpi/common/src/linux_pci.c
+8-01 files

FreeBSD/src bf87604 — sys/compat/linuxkpi/common/include/linux sysfs.h

linuxkpi: Fix sysfs_remove_group() for groups without a name

sysfs_create_group() handles a group with a NULL name by creating its
attributes directly under the object node, but sysfs_remove_group() passed
the NULL name to sysctl_remove_name(), which then panics in strcmp().

Mirror the creation path: for an unnamed group, remove each attribute and
binary attribute individually.

This was not hit before because the devres actions of a PCI device
(e.g. the one registered by devm_device_add_group()) were not run when
the driver was detached.

Sponsored by:   Beckhoff Automation Gmbh & Co. KG
DeltaFile
+14-1sys/compat/linuxkpi/common/include/linux/sysfs.h
+14-11 files

FreeBSD/src b138d01 — lib/libc/locale mbrtocXX_iconv.h

libc/locale: Check EILSEQ return

_citrus_iconv_std_iconv_convert can return EILSEQ without setting
invlen. As a result, we should check EILSEQ in the return value or it
will incorrectly return -2

Reviewed by:    kevans
Fixes: e2030ca246a7 ("libc: fix c*rtomb/mbrtoc*")
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D61151
DeltaFile
+1-1lib/libc/locale/mbrtocXX_iconv.h
+1-11 files

FreeBSD/src e89d0e7 — sys/conf files

sched: Fix building kernel independently of world

Regular '-I' directives must be passed to ${CPP} so that when
pre-processed, 'sched_ns.h' can find the files it includes in the proper
places, instead of relying on what is in ${WORLDTMP}, i.e., nothing if
'_includes' was not executed, which happens, e.g., when using 'make
kernel-toolchain' and then 'make buildkernel' without having executed
a 'make buildworld', or possibly some outdated copy not matching an
updated source.

Reported by:    Claude Opus 5.5, imp
Fixes:          510331fa3763 ("sched: Automatically namespace schedulers' implementation functions")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61167
DeltaFile
+2-2sys/conf/files
+2-21 files

FreeBSD/src 6a99232 — . Makefile.inc1

Makefile.inc1: Fix bare $ characters

The '$' characters inside awk commands need to be $$ when appearing
inside a Makefile.  Without this, we generate empty src and src-sys
packages.

Reported by:    Stefan Grundmann
Fixes:          a8be89928930 ("build: Support got")
MFC after:      1 day
DeltaFile
+2-2Makefile.inc1
+2-21 files

FreeBSD/src 28d8abe — sys/dev/bnxt/bnxt_en bnxt.h if_bnxt.c

bnxt: correct more mappings for 400G optics and 100G LR

- Support 400G-DR4 optics
- Support 400G-CR8 and -SR8 with their types, rather than generic 400G-AUI8
- Use the generic 400G-AUI8 for 400G-SR4, rather than mislabeling it -DR4
(We probably should add a 400G-SR media type, but I don't have any to test ATM)
- Add missing legacy PAM4 100G LR entry and matching media-selection cases.

Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D61162
Sponsored by: Netflix
DeltaFile
+16-3sys/dev/bnxt/bnxt_en/if_bnxt.c
+1-0sys/dev/bnxt/bnxt_en/bnxt.h
+17-32 files

FreeBSD/src 510331f — sys/conf files, sys/kern sched_ns.h sched_4bsd.c

sched: Automatically namespace schedulers' implementation functions

This renames back scheduler implementation functions to their old names,
i.e., the same name as the interface functions, in the source code,
while providing the infrastructure to still produce from them C symbols
namespaced by the scheduler implementation, in order to avoid symbol
collisions with interface dispatching functions and other scheduler
implementations when multiple ones are compiled in.  In a nutshell, the
implementation consists in re-routing interface names to implementation
names via the C preprocessor.

The main reasons for this change are that different implementation names:
1. Break navigating code with ctags-like tools like in-tree ctags,
   Global and Universal Ctags.
2. Spoils inlining opportunities in internal scheduler code if not
   careful.  This alternatively could be regained by changing call
   points to use scheduler-specific names, but that does not prevent
   people from inadvertently adding more calls to interface functions.
   Also, having to namespace calls with the implementation name in the

    [75 lines not shown]
DeltaFile
+57-50sys/kern/sched_ule.c
+54-47sys/kern/sched_4bsd.c
+41-11sys/sys/sched.h
+52-0sys/kern/sched_ns.h
+38-0sys/tools/sched_impl_ns.awk
+21-3sys/conf/files
+263-1111 files not shown
+264-1117 files