6361 Commits
Author SHA1 Message Date
Warner Losh 041802b362 Add loongarch64 as an optional boot-test.sh arch
D59889 brings up a FreeBSD/loongarch64 EFI loader, none of it in
this tree yet. Add a disabled config entry (excluded from -A, usable
via -a once the port lands) using the confirmed QEMU virt/la464
recipe; hw/loongarch/virt.c defaults to virtio-blk/net, so the
existing generic EFI+GPT builder needs no arch-specific QEMU code.

loongarch64 has never had a FreeBSD release, so
install_minimal_userland's ISO extraction can never find one. Split
it into ISO and installworld-cross-build paths, selected by a new
no_release capability, so archs without a release can still get a
minimal userland.

Differential Revision:	https://reviews.freebsd.org/D59923
2026-10-19 01:03:19 -06:00
Peter Holm b5e6d60e57 stress2: Add a new FS type: UFS2 to the test.
Workaround for kern.maxfiles limit exceeded.
Workaround for SU disk full issue.
Added some debug info, if umount(8) returns EBUSY.
2026-10-13 10:11:15 +02:00
Maxim Sobolev 2aca5deff7 stress2: add a test for forced unmount racing mkdir at UFS_LINK_MAX
On a soft updates file system, keep a directory at UFS_LINK_MAX with
workers removing and recreating subdirectories in it, so that mkdir(2)
keeps going through ufs_sync_nlink(), and force-unmount, check and
remount the file system in a loop.  The workers work relative to the
directory: a lookup through the mount point would wait for the unmount
on the covered vnode lock and never race with it.  Before the fix, the
first forced unmount deadlocked with mkdir(2) sleeping in vfs_busy().

With dtrace=1, count the vfs_busy() calls made during an unmount by
caller, and the mkdir(2) calls that synced and restarted with ERELOOKUP
during an unmount, which shows that the race was hit.

Sponsored by:	Sippy Software, Inc.
Reviewed by:	pho
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D60204
MFC after:	1 month
2026-10-12 21:00:36 -07:00
Maxim Sobolev a127039dd0 stress2: add a reproducer for the flush_newblk_dep() "Bad newblk" panic
flush_pagedep_deps() drops the soft updates lock to obtain the vnode of
a new directory.  If its MKDIR_BODY dependency completes in that window,
the lookup of the directory's first block in flush_newblk_dep() can find
a stale allocindir left behind by a previous owner of the same block,
relocated by ffs_reallocblks() and freed, and panic.

The test grows interleaved files past UFS_NDADDR to keep clusters being
relocated, while other workers create subdirectories in a parent with
IN_ENDOFF set, so that ffs_vput_pair() syncs it, and fsync() them to
complete the mkdir dependencies.  The file system layout and the way
the writers put their blocks on disk are arranged so that a new
directory takes over a freed block whose dependency is still retained;
the details are in the script.  With dtrace=1, the test also counts how
often this precondition is met, which works on a fixed kernel too.

PR:		297976
Reviewed by:	kib, pho
Tested by:	pho
Sponsored by:	Sippy Software, Inc.
Differential revision:	https://reviews.freebsd.org/D59356
2026-10-04 12:26:41 -07:00
Maxim Sobolev a68d11d310 stress2: Fix script bugs in gnop6.sh, gnop7.sh and fdatasync*.sh
gnop6.sh recorded the checkfs result with "checkfs ... || s=1 && s=0",
which the shell parses as "(checkfs || s=1) && s=0", so the test passed
even when the file system check failed.

gnop7.sh only sets s when unmount or fsck_ffs fails and ends with
"exit $s".  On a clean run s is unset, and the script exits with the
status of the preceding "[ $notloaded ] && gnop unload", which is 1
whenever geom_nop was already loaded, for instance by an earlier test.

fdatasync.sh and fdatasync2.sh ran "df -i $RUNDIR" before creating the
directory.  With a RUNDIR that does not exist yet, df failed, the test
printed "[: -lt: unexpected operator" and the free inode check was
skipped.

Reviewed by:	pho
Differential Revision:	https://reviews.freebsd.org/D60136
Sponsored by:	Sippy Software, Inc.
MFC after:	2 weeks
2026-10-01 09:26:06 -07:00
John Baldwin 40ce54ccd9 apm(8): Remove support for APM BIOS
Drop support for queries and commands that are not supported by ACPI's
/dev/apm interface.  This includes dropping support for
enabling/disabling APM BIOS used by /etc/rc.d/apm.

Reviewed by:	ziaee, imp
Differential Revision:	https://reviews.freebsd.org/D59941
2026-09-30 12:21:45 -04:00
John Baldwin 247503fedb apmd: Retire the APM daemon
The original purpose of this daemon was to route power management
requests to userspace, e.g. when the suspend button was pressed, the
APM driver posted an event read by apmd(8) that would invoke zzz(8) to
suspend.  However, on ACPI systems this is handled by devd(8) events
instead and running apmd(8) in addition just adds extra complexity.
This probably should have been axed when the APM BIOS support was
retired in commit 8c576a279e.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D59937
2026-09-30 12:20:02 -04:00
Xiaoqiang Zhao 2f49e40a68 llvm: add LoongArch target support, not enabled by default
Note there is ongoing work to add LoongArch support to the base system,
but having target support in llvm is an essential component.

This must be explicitly enabled using WITH_LLVM_TARGET_LOONGARCH.

Reviewed by:	dim
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D59899
2026-09-28 18:13:02 +02:00
Warner Losh d8acc2a9a4 boot-test.sh: Add gptboot.efi tests
Make sure that we can chainboot with gptboot.efi. Many projects use this
as their migration tool from gptboot to ping-pong partitions to boot
from. This tests that functionality which I recently broke.

Assisted-by: Claude Code (Fable 5, Opus 5)
Sponsored by:		Netflix
2026-09-26 00:44:21 -06:00
Warner Losh a844bc229e boot-test.sh: Add netboot-http-efi test
Using iPXE, chainboot loader.efi with rootdev=http://${next-server}/
to test the loader's http:// code.

Sponsored by:		Netflix
2026-09-26 00:43:54 -06:00
Warner Losh ab9130c737 boot-test.sh: Add a http server per interface
Add the built-in python http server, bound to each of the interaces we
create to expand network testing to include http:// in various
scenarios.

Sponsored by:		Netflix
2026-09-26 00:43:53 -06:00
Warner Losh 58741fa51d boot-test.sh: Add virtio-rng-pci to the EFI RAM-disk netboot qemu invocation
Since the PixieFail security fixes (CVE-2023-45237), EDK II's DxeNetLib --
underneath essentially all of NetworkPkg (Mnp/Arp/Ip4/Dhcp4/Tcp/Http) --
carries a DEPEX on EFI_RNG_PROTOCOL. With no RNG protocol producer
available, that DEPEX is never satisfied and the entire NetworkPkg driver
stack silently fails to load: no error, no assert, it just isn't there.

netboot-efi and netboot-ramdisk never noticed because they only ever touch
the raw EFI_SIMPLE_NETWORK_PROTOCOL via our own net.c, which has no such
dependency. A test that needs EDK II's own NetworkPkg (e.g. one exercising
EFI_HTTP_PROTOCOL) is the first to be affected.

RngDxe can satisfy the DEPEX from the RDRAND instruction alone on a
sufficiently recent edk2 build, but not every installed OVMF is that
recent. -device virtio-rng-pci provides an RNG unconditionally via
VirtioRngDxe, regardless of edk2 vintage or host CPU features.

Unfortunately, the edk2 shipped with qemu lacks the network this needs.

Sponsored by:		Netflix
2026-09-26 00:43:53 -06:00
Warner Losh d2cce99069 build/options: Remove old, obolsete GCC options
These aren't referenced in the tree anymore, so remove them from
here. This doesn't chanage src.conf.5, so I didn't commit that file.

Sponsored by:		Netflix
2026-09-24 08:32:32 -06:00
Dimitry Andric b5d1e0c5a4 llvm: remove Mips target support
The Mips architecture has been removed from all supported branches now.

MFC after:	1 week
2026-09-24 14:50:47 +02:00
Enji Cooper df6131e2b7 Remove CDDL and ctfconvert tests when their controlling knobs are disabled
In the event someone specified MK_CDDL == no prior to this change, all
tests under `/usr/tests/cddl` would stick around after the change,
resulting in errors. Similarly, MK_DTRACE == no removed ctfconvert,
which the ctfconvert tests relied on (but remained around after the knob
was disabled).

Remove the tests under the respective blocks now so they don't linger
around on systems where these knobs are disabled, resulting in false
positives when running the complete test suite.

The ctfconvert tests weren't specifically put under
`${MK_DTRACE_TESTS}` == no because ctfconvert was bundled separately
from the upstream provided Dtrace test suite.

MFC after:	2 weeks
MFC with:	30c20ca26 ("Remove Dtrace/ZFS tests if their knobs are disabled")
2026-09-21 19:53:03 -07:00
Enji Cooper 30c20ca26e Remove Dtrace/ZFS tests if their knobs are disabled
Prior to this change, Dtrace and ZFS tests and their respective
directories would remain installed even if `${MK_DTRACE_TESTS}` == no or
`${MK_ZFS_TESTS}` == no.

This change enhances the logic to remove the tests when the respective
knobs are disabled so the tests will be removed when `make delete-old`
is run.

MFC after:	2 weeks
2026-09-21 19:31:34 -07:00
Jason A. Harmening 5fe1964fa0 stress2: add two new unionfs test scenarios
These exercise lookup traversal from tmpfs into unionfs, which is
useful because, unlike UFS, tmpfs does not allow recursion on its vnode
locks by default.

unionfs22.sh exercises these lookups with a normal unionfs mount, while
unionfs23.sh uses '-o below' for the unionfs mount and reproduces the
panic described in PR 298201.

Reviewed by:	kib, markj, pho
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D59494
2026-09-12 22:19:19 -05:00
Ahmad Khalifa 7324487562 universe.sh: don't overwrite no_zfs's build log
Give the WITHOUT_LOADER_BIOS_TEXTONLY build its own log file.
2026-09-09 16:59:52 +03:00
Ahmad Khalifa 1de79e73a8 universe.sh: add MK_BEARSSL build
BEARSSL is disabled by default, add this here to make sure it doesn't
break.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D59516
2026-09-09 06:41:14 +03:00
Ahmad Khalifa bac0daa9cb universe.sh: build with 1.5 * ncpu jobs
Build with 1.5 * ncpu jobs instead of hardcoding 40.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D59515
2026-09-09 06:41:05 +03:00
Robert Clausecker d1c07141dc manpages: Fix author e-mail address formatting
- consistently use Mt request within Aq.  This makes author
   e-mail addresses clickable in many frontends.
 - @freebsd.org -> @FreeBSD.org
 - ([email protected]) -> Aq Mt [email protected]

Event:		Berlin Hackathon 202609
MFC after:	3 days
Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D59410
2026-09-04 21:46:20 +02:00
Devin Teske 4aeab132f6 git-arc: SC2223 DoS-via-glob hardening
Quote LOCALBASE and ARC_CMD default assignments so a poisoned
value cannot glob into :'s argv.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59130
2026-09-01 18:38:44 -07:00
Devin Teske 6217c9c6f3 git-arc: Fix locals
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59162
2026-09-01 18:37:55 -07:00
Oskar Holmlund 533918ced2 nanobsd: Remove pandaboard.cfg
Pandaboard (sys/arm/ti/omap4) is removed due to lack of HW.
Remove the pandaboard config file for nanobsd aswell.

Approved by: imp, jlduran, manu(mentor)
Diffrential revision: https://reviews.freebsd.org/D54319
2026-09-01 00:27:05 +02:00
Christos Longros ef03c60246 kern_mib: remove kern.fallback_elf_brand compat sysctl
This compatibility alias for kern.elf{32,64}.fallback_brand has been
marked for removal since FreeBSD 6.0.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D56085
2026-08-31 13:23:53 -04:00
Peter Holm 2b93d98aab stress2: Use the new version of fsx in ports instead of the older one in tools/regression
Suggested by:	 asomers
2026-08-27 10:28:45 +02:00
Devin Teske f86c3e6de4 git-arc: Handle -h on subcommands and align usage with the man page
git-sh-setup treats -h as help against an empty USAGE, so
"git arc create -h" prints "usage: git arc". Handle -h before
sourcing it so every subcommand prints the real synopsis.

The create, stage, and update synopses showed optional commit-refs
while git-arc(1) and the code require them. Advertise -p parent on
create; the option was already implemented and documented.

Sort create sub-command option-arguments alphabetically in three
places: (1) synopsis from tool, (2) man-page synopsis, and (3)
man-page description.

Check for jq(1) / arc after checking for usage so -h always works.

While here, fix missing "local o" in gitarc__stage().

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59129
2026-08-25 13:46:32 -07:00
Devin Teske 90ed365277 git-arc: Fix inconsistent whitespace
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59161
2026-08-25 13:31:54 -07:00
Devin Teske 067ae9850f git-arc: -t tag support for create to set Phabricator project tags
Add -t tag[,...] so a review can be tagged at creation instead of
needing the web UI. Spaces in tag names are written as underscores;
a leading # is optional.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D59019
2026-08-24 14:02:41 -07:00
Jason A. Harmening d7033e3b20 unionfs7.sh: eliminate stderr redirection
The bash-ism here results in an "ambiguous output redirect"
error when run under tcsh.  Similar unionfs stress2 tests don't
do this, and unionfs7 doesn't seem to generate spurious output
when run locally, so just delete it.

Reviewed by:		pho
Differential Revision:	https://reviews.freebsd.org/D58856
2026-08-21 20:23:15 -05:00
Peter Holm d58ca84152 Fix zombie leak in test using pdfork() 2026-08-20 10:59:58 +02:00
Peter Holm 8eb77a5aab stress2: Enable two hwpmc tests that now run as expected 2026-08-20 10:55:16 +02:00
Abhijeet Sharma 805c5004fa tools/build: stage stdckdint.h's dependencies for non-FreeBSD hosts
37bd69d43c gave stdckdint.h two new includes, <sys/_visible.h> and
<sys/ckdint.h>.  Neither reaches a non-FreeBSD host: _visible.h is
staged only under ${.MAKE.OS} == "FreeBSD" and ckdint.h is not staged at
all, so the libc bootstrap fails on reallocarray.o when cross-building
from macOS.  Both headers are self-contained; stage them alongside
stdckdint.h.

Fixes:		37bd69d43c ("sys: Add sys/ckdint.h")
Reviewed by:	rpaulo, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58943
2026-08-19 12:19:38 +00:00
Mark Johnston ba120b8d38 mfc-candidates: Annotate variables as local
And clean up luacheck warnings.

Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D48950
2026-08-17 09:43:25 -04:00
ShengYi Hung 749318f2ae libusb: capsicumize libusb
FreeBSD's libusb has three components: libusb01, libusb10, and libusb20.

libusb20 handles communication with character devices. We now requires a
backend context for libusb20. The backend context contains contains the
capsicumized usbctrl fd and usb directory (/dev/usb) fd so that the
library user can enter the capiblity mode safely while using libusb.

libusb10 is updated to support capabilities via a context option. Since
libusb allows general read/write access, we preserve all possible
capabilities when passing backend context to libusb20. It is the
responsibility of the libusb user to call cap_enter() at an appropriate
time.

All base system tools using libusb and libusb20 have been updated to
support Capsicum.

Reviewed by:    adrian, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51865
2026-08-14 23:09:08 +08:00
Devin Teske a8347f4428 git-arc: Add a diff subcommand
Show the differences between local commits and their associated
Phabricator reviews, i.e., what "git arc update" would upload.  For
each commit, the review's current raw diff is applied to the commit's
parent in a temporary index and the resulting tree is compared against
the commit itself.  An empty diff means the commit and the review are
in sync.

This makes it easy to check whether local amendments have diverged
from the posted review before updating it, or to confirm that a
review is current before landing.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58789
2026-08-13 13:31:36 -07:00
Dag-Erling Smørgrav 336b6d1192 build: Use -f when copying sources
If one of the source files we copy is non-writeable, cp will create a
non-writeable copy.  If the original is later modified, cp will fail to
overwrite the copy since it is not writeable.  Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-08-13 14:31:54 +02:00
Mark Johnston e15d22609c mfc-candidates: Fix remote repo detection
In my repos the remote "freebsd" is [email protected]:src.git.
In particular, the last component is delimited by a colon, not a slash.

Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D48951
2026-08-12 14:29:48 -04:00
ShengYi Hung 527a82474c libusb: versioning symbols
Reviewed by:    bapt, kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55686
2026-08-12 22:49:35 +08:00
Mark Johnston b7b73d0fc1 git-mfc: Make --pending work with releng branches
There is no timeout period for merging from stable to releng branches,
so we should ignore "MFC after" tags.

While here, lift some uses of re.compile() out of loops.

Reported by:	des
2026-08-11 17:02:38 +00:00
Kevin Bowling a6999a1c94 net: Revert the ioctl SR-IOV VF status interface
A native route Netlink interface will replace this stack.

Requested by:	glebius

This reverts commit 1ccf543b21.

This reverts commit 2c04cfa148.

This reverts commit 2d6114f6d2.

This reverts commit d15f2551b2.

This reverts commit ceb282bbd6.

This reverts commit c30021fe0d.

This reverts commit fb1820d23a.

This reverts commit 8696cc600f.
2026-08-10 15:49:55 -07:00
Mark Johnston ba47678b30 git-arc: Use full names in reviewed-by lines
Phabricator user names are not useful identifiers outside of
phabricator, don't use them if we can avoid it.
2026-08-10 17:31:21 +00:00
Kevin Bowling fb1820d23a rescue: Satisfy libifconfig's libnv dependency in crunched links
libifconfig now calls nv(9) routines for the SR-IOV VF status query, so
crunched builds that link the static library must also provide libnv.

The per-program CRUNCH_LIBS_ifconfig hook cannot do this: crunchgen
partially links per-program libraries into the program object and
crunchide then localizes every symbol except the stub entry, so members
absorbed there cannot satisfy references from another archive on the
final link's library list.

List libnv globally next to libifconfig.a in rescue(8) and bsdbox. This
also makes the existing per-program libnv links redundant; remove them
to avoid embedding private localized copies in the crunched binary.

Fixes:	2d6114f6d2 ("libifconfig: Add an SR-IOV VF status query")
2026-08-09 00:53:12 -07:00
Justin Hibbits 7bc06551cc tools/cryptocheck: Fix allow_soft sysctl name 2026-08-06 23:00:02 -04:00
Mark Johnston 2c98dc4e5c git-mfc: Give a useful error message if a remote can't be found 2026-07-30 17:13:17 +00:00
Mark Johnston a7677a680f git-mfc: Add --abort and --continue flags
Instead of making the user run the underlying git-cherry-pick command
after a conflict.

Requested by:	des
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D58514
2026-07-30 17:09:51 +00:00
John Baldwin ee7258cfbb tools/tools/git: Add git-mfc to Makefile similar to git-arc
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D58531
2026-07-29 14:38:22 -04:00
Mark Johnston b9ea73ceb3 git-arc: Make git arc patch -r smarter
- Make it work even when git arc isn't run from the root of the repo.
- If the patch fails to apply, let git partially apply the patch and
  generate rej files for inspection.

While here, remove the return value from apply_rev(), it's never
actually used.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D58532
2026-07-29 18:22:29 +00:00
Jose Luis Duran 728b3b7c43 nanobsd: Restore boot0cfg functionality
The need for this step is fading, now is mostly used to allow the
selection of just the two code partitions in the boot0 boot manager,
instead of the default of allowing all four MBR slices (the other two
being cfg and data, which cannot boot).

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D57311
2026-07-29 16:15:15 +00:00
Mark Johnston b86e364934 git-mfc: Improve handling of remotes
If we can't figure out which remote to use, print a useful error instead
of assuming that "freebsd" is the right remote to use.
2026-07-24 21:10:26 +00:00