Commit Graph
312848 Commits
Author SHA1 Message Date
Warner Losh a259b98fa2 tests: skip gracefully when the tested binary's own package isn't installed
pkgbase splits programs and their tests into separate packages (e.g.
unifdef/yacc/indent/file2c -> toolchain, jail -> jail, etc), while their
tests always land in the generic tests package.  Installing just the
tests package therefore leaves these suites unable to find the binary
they exercise, and they fail confusingly instead of skipping.

Rather than force all packages to be installed for the tests package,
make the tests cope with the missing packages.  Add require.progs (or,
for TAP/PLAIN-style suites with no atf_set hook: TEST_METADATA
required_programs) for the binary under test in: bectl, certctl,
ctfconvert, dhclient, file2c, indent, ipfw, jail, lastcomm, mixer,
newsyslog, nvmecontrol, pfctl, praudit, sa, syslogd, tunefs, unifdef,
yacc, ztest.

I skipped adding data for all the binaries in the base runtime
package for simplicity.

Assisted-by:		Claude Code (Sonnet 5)
Sponsored by:		Netflix
Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D58262
2026-09-10 23:42:25 -06:00
Warner Losh 73df5f2ec9 man: Do glob expansion with echo instead of ls
echo is a shell builtin, and always present. While ls usually works,
some upgrade scenarios need to have ls be a build to to work
correctly. Rather than add it as a build tool, use echo instead which is
always safe because sh is a build tool.

Sponsored by:		Netflix
2026-09-10 23:13:46 -06:00
Alexey Sukhoguzov 35793364d7 nvmecontrol: Add APST feature support
Add -a, -d and -m options to the power subcommand to manage APST,
along with additional status output when invoked without args.

Signed-off-by: Alexey Sukhoguzov <[email protected]>
Reviewed-by: imp
2026-09-10 23:13:40 -06:00
Warner Losh c4c790949f dtrace: Instrument more of the CAM device lifecycle
cam::periph:error, cam::{,a,n,sd}da:error
	Trace the error evolution for I/O errors the periph encounters

cam::periph:recovery, cam::{,a,n,sd}da:recovery
	Trace the result of the error sorting

cam::periph:invalidate
	Trace device invalidations

cam::periph:hold-boot
cam::periph:release-boot
cam::xpt:hold-boot
cam::xpt:release-boot
	Trace boot holds and releases at different levels

cam::xpt:bus-register
	Trace new busses added

These additions allow fairly complete instrumentation of the discovery
process at boot through dtrace's anonymous tracing. It would be mildly
better to have the boot holds have the periph, but dtrace sbts have to
be static at compile time.

Sponsored by:		Netflix
Reviewed by:		dteske
Differential Revision:	https://reviews.freebsd.org/D58523
2026-09-10 23:13:30 -06:00
Warner Losh afb60897a1 mpsutil: Add Show Discovery command
Prints the current discovry tables for the driver.

Sponsored by:		Netflix
Assisted by:		Claude (sonet-5)
Differential Revision:	https://reviews.freebsd.org/D58528
2026-09-10 23:13:14 -06:00
Warner Losh d04083d52b cam: Add devctl message for invalidation of a periph.
Report serial number, if available, otherwise report the path of the
device invalidated.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D58527
2026-09-10 23:13:08 -06:00
Warner Losh a67354f213 cam: Refactor cam_periph_devctl_notify init/fini bits
To be able to create other kinds of devctl notifications that don't flow
through cam_periph_devctl_notify, refactor out the header / trailers we
do and the sbuf life cycle management. No functional change.

Sponsored by:           Netflix
Differential Revision:	https://reviews.freebsd.org/D58526
2026-09-10 23:13:02 -06:00
Warner Losh e2bcab51fb da: Fix logic error
Apply de-morgan's law correctly to force only 4/2 to go to the
invalidate stage for that ASC/ASCQ.

Fixes: d78d04b17c
Sponsored by:		Netflix
MFC After: 1 week
Reviewed by:	ali_mashtizadeh.com, mav
Differential Revision:	https://reviews.freebsd.org/D58525
2026-09-10 23:12:55 -06:00
Warner Losh 0bc6c9279e da: Stop the probing when periph invalidated in dadone_proberc
When READ CAPACITY fails, we call cam_periph_invalidate() for some
hopeless ASC/ASCQ combinations and then fall through to test the cache
state. This results in excess commands to the abandoned device that may
take a while to timeout and/or report confusing errors. Instead, call
daprobedone() when the periph is invalid to terminate the probe.

Fixes: d78d04b17c
Sponsored by:		Netflix
MFC After: 1 week
Differential Revision:	https://reviews.freebsd.org/D58524
2026-09-10 23:12:29 -06:00
Warner Losh 8821d42d8b loader.efi: Allow downloading of ramdisk or md to be aborted
Hitting <ESC> will now allow one to abort a (possibly mistaken)
download.

Sponsored by:		Netflix
2026-09-10 22:15:29 -06:00
Warner Losh 0ca12047be loader.efi: Eat the character used to break to OK
When we can't find root, we give the user a chance to drop to the boot
loader OK prompt. We should eat the character that's pressed to not
interfere with the interactive session.

Sponsored by:		Netflix
2026-09-10 22:15:29 -06:00
Warner Losh 08265d5ede loader: Fix starting typo
Fixes:			a22fa5ec74 ("laoder.efi: Fix error in download protcol")
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59434
2026-09-10 22:15:29 -06:00
Warner Losh 6de311d309 loader.efi: download DHCP initmd specified image
When we haven't downloaded an image via mem{disk,cd} and ipxe, try any
image specified by the FreeBSD-specific initmd dhcp option. This allows
direct booting of loader.efi with a detached root ramdisk filesystem.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59433
2026-09-10 22:15:29 -06:00
Warner Losh d48e9bff8c loader.efi: fetch initmd specified by DHCP
Configure net0, read the DHCP-provided initmd URL, and download it
through the file API so directly booted loader.efi can construct its
root memory disk.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59432
2026-09-10 22:15:29 -06:00
Warner Losh 25b58eb37a loader.efi: download md images through file API
Feed the existing decompressor from loader file descriptors as well as
iPXE callbacks, allowing arbitrary HTTP filesystem URLs to become
kernel-exportable memory disks.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59431
2026-09-10 22:15:29 -06:00
Warner Losh 5bbd617cc5 loader.efi: release SNP after network configuration
Close the exclusively opened SNP protocol after loader networking
finishes so the firmware network stack can reconnect the controller and
service a subsequent HTTP request.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59430
2026-09-10 22:15:28 -06:00
Warner Losh e6b997c73c loader: add standalone network configuration
Allow callers to obtain DHCP configuration without opening a network
file, enabling loader.efi to discover an initmd URL before handing the
interface back to firmware HTTP.

Differential Revision:	https://reviews.freebsd.org/D59429
Sponsored by:		Netflix
2026-09-10 22:15:28 -06:00
Warner Losh a098fd021e loader: request DHCP initmd option
Request FreeBSD RFC 3925 PEM 2238 DHCP 125 option. Use suboption 1 to
specify a ramdisk image to load and use to load the kernel and as the
root file system.

Differential Revision:	https://reviews.freebsd.org/D59428
Sponsored by:		Netflix
2026-09-10 22:15:28 -06:00
Warner Losh 6788e42d53 stand/efihttp: Support arbitrary http[N]://host[:port]/path devspecs
Until now, the "http" device only worked when firmware itself booted
loader.efi via EFI HTTP Boot: efihttp_dev_init() required a URI node on
the loader's own boot device path, and every fetch went to that same
server. Add a second form, using the parse_uri() helper from libsa/dev.c,
that works anywhere: http[N]://host[:port]/path (N is a network interface
unit, defaulting to 0). This lets a devspec like this be used as rootdev,
in loader.conf, or interactively, independent of how loader.efi itself
was booted.

Network configuration is shared, loader-wide state (the myip/netmask/
gateip/nameip globals from net.h): if something has already configured
them (e.g. tftp/nfs via net_open()), the http device just reuses those
values, applying them to EFI_IP4_CONFIG2_PROTOCOL as a static address. If
nothing has, it drives IP4Config2's own DHCP directly instead of calling
netdev's net_open(): net_open() opens the NIC's SNP
EFI_OPEN_PROTOCOL_EXCLUSIVE, which would disconnect the Mnp/Ip4/.../
HttpDxe driver chain this code depends on. That chain is also commonly
disconnected already by whatever chained us here (e.g. iPXE excludes and
exclusively opens SNP for its own raw I/O), so reconnect it explicitly
with ConnectController() before giving up.

The legacy EFI HTTP Boot path is untouched.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59423
2026-09-10 22:15:28 -06:00
Warner Losh 7208b3b845 libsa: Add a generic URI-syntax devspec parser
Add parse_uri(), a helper for devices whose devspec can take a
"[N]://host[:port][/path]" form in addition to the traditional "N:path"
form. It returns EINVAL when devspec doesn't match that pattern, so a
caller's own dv_parsedev can fall back to the traditional form.

Un-static default_parsedev() so it can serve as that fallback.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59422
2026-09-10 22:15:28 -06:00
Warner Losh f1163b9436 loader.efi: For ipxe booting, fall back to md when ramdisk fails
Some UEFI firmwares do not contain the RamDisk protocol. When this
happens, load the file into a md disk instead. This is less desireable
than the RamDisk (since that allows better chain-booting options), but
sufficient to boot an image as a md device for FreeBSD. While most
severs have the RamDisk protocol enabled in their builds, I have two
IoT class boards from different manufacturers that do not. Since it
works just fine with this fallback, that's preferable.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59421
2026-09-10 22:15:28 -06:00
Warner Losh 96b1e04a74 loader: Add md support
Allow md devices like efi allows them.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59420
2026-09-10 22:15:27 -06:00
Warner Losh 69d1595ded loader.efi: Move probing the md up to before doing bootmgr
When someone has loaded a ram disk, that's a stronger hint about what to
boot than the UEFI boot manager. Prefer it and rework a little the #ifdefs
to reduce their number.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59419
2026-09-10 22:15:27 -06:00
Warner Losh 752bde7da6 loader: Allow dynmaic creation of MD disks
Augment the md device to allow creation of md devices. This is useful
when UEFI doesn't support RamDisk and in other cases where we have a
handy initrd-like image we want to use.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59418
2026-09-10 22:15:27 -06:00
Warner Losh 7055aa7a07 loader: Move ramdisk export to md.c
Move the common routine to md.c and use it where we do memdisks today.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D59417
2026-09-10 22:15:27 -06:00
Warner Losh 4f7475ab5b loader: Small tweak to how md is configured
Only the EFI loader supports the md devices (as the moment). Create
LOADER_MD_SUPPORT and only try to compile md when that's true. For the
moment, also allow it when only MD_IMAGE_SIZE is defined, but that
will be dropped since LOADER_MD_SUPPORT is a superset.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D59416
2026-09-10 22:15:27 -06:00
Warner Losh 8fae9294d6 loader: Allow this to compile w/o MD_IMAGE_SIZE defined
Slight tweak to allow md.c to be compiled when MD_IMAGE_SIZE isn't
defined.

Sponsored by:		Netflix
Reviewed by:		olivier, tsoome
Differential Revision:	https://reviews.freebsd.org/D59415
2026-09-10 22:15:27 -06:00
Aymeric Wibo 542df51903 acpi_spmc: Make sure constraints array doesn't end up sparse
If we skip one of the constraint package elements and decrement
sc->constraint_count, sc->constraints would end up sparse and some of
our constraints would be put after sc->constraint_count.

Reviewed by:	olce
Sponsored by:	The FreeBSD Foundation
Event:		EuroBSDCon Devsummit 2026
Differential Revision:	https://reviews.freebsd.org/D59562
2026-09-10 22:56:37 +02:00
Abdelkader Boudih 9ae680fcfd libjail, jls(8), jail(8): use the JAIL_PARAM_* constants
Replaced hardcoded jail parameter name strings in the base userland
consumers with the JAIL_PARAM_* constants.

No functional change.

Reviewed by:	jamie, adrian
Differential Revision:	https://reviews.freebsd.org/D59577
2026-09-10 20:55:04 +01:00
Jean-Sébastien Pédron d4820dc1e6 linuxkpi: Add int_sqrt()
The implementation comes from `isqrt64()` in `sys/cam/cam_iosched.c`. It
is modified to take an `unsigned long` and return an `unsigned int`.

The i915 DRM driver started to use it in Linux 6.15.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58251
2026-09-10 21:39:32 +02:00
Abdelkader Boudih 1256447cbc jail: define well-known parameter names in sys/jail.h
Userland jail managers hardcode jail parameter name strings; nothing
in the headers has ever named them, even when sys/jail.h already
has JAIL_META_PRIVATE/JAIL_META_SHARED for the metadata pair.

Added JAIL_PARAM_* string constants for the static parameters registered
by the base kernel.

No functional change.

MFC After: 1 week

Reviewed by:	jamie, adrian
Differential Revision:	https://reviews.freebsd.org/D59572
2026-09-10 20:03:57 +01:00
Kang Kang 6b92093fdf ig4: Add Lunar Lake-M I2C controllers 4 and 5
Commit 851dffef53 added the Lunar Lake-M I2C controllers 0 through 3
(0xa878-0xa87b), which sit on PCI device 0x15.  The platform exposes two
further controllers at 0xa850 and 0xa851 on PCI device 0x19, reported by
Intel as I2C #4 and #5.  This mirrors the layout already handled for
Arrow Lake-U, where both the 0x777x and 0x775x ranges are listed.

On an HP OmniBook X Flip 16-as0xxx (Core Ultra 9 288V) the firmware
enables only four of the six controllers, and both HID devices sit on
the two that were missing: an ELAN2514 touchscreen on controller 4 and
a SYNA3503 touchpad on controller 5.  Neither attaches without this
change, so the machine has no working pointing device.

Like the other four, these use the Tiger Lake revision of the I2C IP;
Linux treats 0xa850/0xa851 identically to 0xa878-0xa87b in
intel-lpss-pci.c.

Tested on:	HP OmniBook X Flip 16-as0xxx (Intel Core Ultra 9 288V)
Reviewed by:	vexeduxr
MFC after:	2 weeks
Signed-off-by:	Kang Kang <[email protected]>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2406
2026-09-10 21:11:27 +03:00
Maxim Konovalov 009940e3d4 ipfw.8: clarify a difference between reset and reset6 actions
PR:		298348
MFC after:	2 weeks
2026-09-10 16:57:58 +00:00
Olivier Certner d55eb2bed6 MAINTAINERS/CODEOWNERS: Scheduling/Priorities: Add a bit more files
These files are not about scheduling per se but about priority
management, mostly from user space.
2026-09-10 17:32:30 +02:00
Abdelkader Boudih 755b9d5393 ng_hci: build the devd notification in a stack buffer
sbuf_new_auto() sleeps, and ng_hci_default_rcvmsg() can run under the
raw HCI socket pcb mutex held across NG_SEND_MSG_PATH().

Reported by:	WITNESS
Fixes:		ad91d47db3

Reviewed by:	glebius, adrian
Differential Revision:	https://reviews.freebsd.org/D59550
2026-09-10 16:25:16 +01:00
Siva Mahadevan 8e75ea59b0 libctf: remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59537
2026-09-10 10:40:28 -04:00
Siva Mahadevan 076c9db51f camcontrol: remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	ken, imp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59540
2026-09-10 10:40:03 -04:00
Siva Mahadevan e1a1206245 sbin/ifconfig: remove unused static function parameter
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	glebius
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59541
2026-09-10 10:39:37 -04:00
Siva Mahadevan c65c63cf51 tests/kqueue: remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59542
2026-09-10 10:39:11 -04:00
Siva Mahadevan fead44b3ed fsck_msdosfs: remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	delphij
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59543
2026-09-10 10:38:44 -04:00
Siva Mahadevan d1ef616302 iflib: remove unused variables
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	gallatin
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59544
2026-09-10 10:38:19 -04:00
Siva Mahadevan d5047ddedd cxgb(4): remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	np
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59545
2026-09-10 10:37:06 -04:00
Siva Mahadevan 94f7019668 ipfilter: remove unused variable
This fixes the build with gcc 16 after the changes
to -Wunused*[0].

[0] https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused

Reviewed by:	cy
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2026-09-10 10:34:56 -04:00
Olivier Certner f02f93e791 MAINTAINERS/CODEOWNERS: Add myself to scheduler files
I have been the de-facto maintainer for a few years now.

Also mention the #scheduler group for reviews on Phabricator.

Sponsored by:   The FreeBSD Foundation
2026-09-10 15:33:40 +02:00
Dmitry Salychev 7f79802bf9 dpaa2: Make cleanup budget values sysctl(9) tunable
Reviewed by:		dsl
Approved by:		dsl
Obtained from:		flo_purplekraken.com
MFC after:		3 weeks
Differential Revision:	https://reviews.freebsd.org/D59497
Event:			EuroBSDcon Devsummit 2026
2026-09-10 14:13:37 +02:00
Faraz Vahedi c63b69f82a libjail: Preserve const qualifier on strchr(3) and strrchr(3) results
Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D59553
2026-09-10 14:38:00 +03:30
Pouria Mousavizadeh Tehrani c6dfeb546d tests/fib_lookup: Fix compilation by adding SYSDIR
This module is intended to compile in its own directory.
Therefore, the SYSDIR is not defined by default. See 0433870efe.

Fixes:	8e98577411 ("kern: Remove needless kern.opts.mk")
2026-09-10 14:30:14 +03:30
Dmitry Salychev 94a6919efd dpaa2: Allocate DMA tag per Rx buffer
Previously each channel allocated its own set of buffers using the
channel's DMA tag which causes a DMA lock contention under load.
Even a single saturated 1 Gbps link caused ~50,000 adaptive
mutex spin events (as per lockstat) per second. With the proposed
approach there's no more contention on the channel's DMA mutex and the
adaptive mutex spin events dropped to ~6,000/s.

Stress test where iperf3 pushed as much traffic as possible to the 4
ports revealed that throughput drops from expected 940 Mbps down to
600-800 on each link with the "bounce pages lock" generating ~110,000
adaptive mutex spin events per second, but this is to be addressed
later on.

Tested by:		flo_purplekraken.com, gnikl_justmail.de, bofh@
MFC after:		3 weeks
Differential Revision:	reviews.freebsd.org/D59463
Event:			EuroBSDcon Devsummit 2026
2026-09-10 12:29:22 +02:00
Mark Johnston fc33bbb024 nd6: Fix the array size in union nd_opts
ND_OPT_ROUTE_INFO is 24, so an access of that index is technically out
of bounds, though note that the per-option struct has an entry for this
option.  Fix the array size to appease -fsanitize=array-bounds.

Reviewed by:	pouria, glebius
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D59392
2026-09-10 09:27:35 +00:00
Benjamin Jacobs 464b29857f dtrace/arm64: de-pessimize dtrace_copy
When DTrace catches a data abort exception it resumes execution on the
next instruction. If a probe executes copyinto from unmapped memory,
then dtrace_copy keeps faulting on successive bytes until the loop
counter is exhausted. Detect the situation by witnessing the absence
of zero-extension from an aborted unprivileged load.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D59341
2026-09-10 09:14:29 +00:00