Commit Graph

305340 Commits

Author SHA1 Message Date
Rob Norris c631f5e6c2 Linux: bump -std to gnu11
Linux switched from -std=gnu89 to -std=gnu11 in 5.18
(torvalds/linux@e8c07082a8). We've always overridden that with gnu99
because we use some newer features.

More recent kernels are using C11 features in headers that we include.
GCC generally doesn't seem to care, but more recent versions of Clang
seem to be enforcing our gnu99 override more strictly, which breaks the
build in some configurations.

Just bumping our "override" to match the kernel seems to be the easiest
workaround. It's an effective no-op since 5.18, while still allowing us
to build on older kernels.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #17954
2025-12-01 10:19:11 -08:00
Alexx Saver 39303febac chksum: run 256K benchmark on demand, preserve chksum_stat_data
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexx Saver <lzsaver.eth@ethermail.io>
Co-authored-by: Adam Moss <c@yotes.com>
Closes #17945
Closes #17946
2025-12-01 10:14:52 -08:00
Justin Hibbits 882821b78f kexec: Change shutdown handler priority
The kexec shutdown handler should run after everything else, but before
the other platform shutdown handlers.  With (SHUTDOWN_PRI_DEFAULT - 150)
priority it would run before anything else, including all the device
shutdown handlers.  Change to (SHUTDOWN_PRI_LAST - 150) where it
belongs.

Sponsored by:	Hewlett Packard Enterprise
2025-12-01 11:53:00 -05:00
Mark Johnston 17fd7780fb dtrace tests: Update names after the syscall::exit probe was renamed
MFC after:	1 week
Fixes:	e7e964cb2e ("syscalls: normalize _exit(2) declerations")
2025-12-01 14:20:06 +00:00
Minsoo Choo 507cfc4279 dtrace.1: remove sparc
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo d11ff7f933 opensolaris: remove references to sparc
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo dfd35cd244 libdtrace: remove sparc code
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo d667cc77ba dtrace: remove sparc tests
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:18 +00:00
Mark Johnston 72b114169b linker: Avoid invoking eventhandlers on incompletely loaded files
We do not invoke the kld_load eventhandler until after the file is fully
linked, so don't invoke the kld_unload_try or kld_unload event handlers
unless the file is fully linked either.

In my case, the dtrace SDT kld_unload_try handler was running before
relocations were processed against the file, and that caused problems
when sdt_kld_unload_probes() accesses elements of a linker set.

Move the kld_unload handler invocation earlier, to after sysuninits have
been run.  This is a bit more consistent with the kld_load handler.

PR:		291238
Reviewed by:	imp, emaste, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D53938
2025-12-01 14:19:18 +00:00
Jessica Clarke 5f529f9e29 libc: Fix TESTSDIR for new stdbit tests
Otherwise the directory created by etc/mtree/BSD.tests.dist, which is
where these belong, and referred to by the generated Kyuafile for
/usr/tests/lib/libc (via stdbit's existence in TESTS_SUBDIRS), ends up
empty with no Kyuafile, which is an error for kyua.

Reported by:	kp
Fixes:		2fb8cbc6ef ("libc/tests: add stdbit test framework and unit tests")
2025-12-01 14:06:21 +00:00
Martin Matuska c1e033c33e libarchive: merge from vendor branch
libarchive 3.8.4

Important bugfixes:
     #2787 bsdtar: Fix zero-length pattern issue
     #2797 lib: Fix regression introduced in libarchive 3.8.2
                when walking enterable but unreadable directories

Obtained from:	libarchive
Vendor commit:	d114ceee6de08a7a60ff1209492ba38bf9436f79
MFC after:	1 week
2025-12-01 14:05:35 +01:00
Martin Matuska bf3359d921 Update vendor/libarchive to 3.8.4
Important bugfixes:
 #2787 bsdtar: Fix zero-length pattern issue
 #2797 lib: Fix regression introduced in libarchive 3.8.2
            when walking enterable but unreadable directories

Obtained from:	libarchive
Vendor commit:  d114ceee6de08a7a60ff1209492ba38bf9436f79
2025-12-01 14:01:24 +01:00
Jaeyoon Choi 31407551c3 ufshci: Add a check for WLUN during driver initialization
This patch checks whether wlun is registered as a periph device.
It also implements a function to issue an SSU.

Reviewed by:		imp (mentor)
Sponsored by:		Samsung Electronics
Differential Revision:	https://reviews.freebsd.org/D53923
2025-12-01 04:41:03 +00:00
Jaeyoon Choi 8c35de4982 cam/scsi: Add power condition support to START STOP UNIT
This patch adds a power_condition parameter to the
scsi_start_stop() function and sets the power condition via SSU.

Reviewed by:		imp (mentor)
Sponsored by:           Samsung Electronic
Differential Revision:	https://reviews.freebsd.org/D53922
2025-12-01 04:40:52 +00:00
Jaeyoon Choi 5e0d065b5b ufshci: Enable WLUN scan
QEMU ufs device does not implement WLUN, so QUIRK is added.

Reviewed by:		imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:	https://reviews.freebsd.org/D53921
2025-12-01 04:40:42 +00:00
Jaeyoon Choi ba96377619 cam/scsi: Support well known logical unit
This patch adds an additional state to probe well-known logical units
before probing normal logical units.

Reviewed by:		imp (mentor)
Sponsored by:		Samsung Electronics
Differential Revision:	https://reviews.freebsd.org/D53920
2025-12-01 04:40:31 +00:00
Jaeyoon Choi 3e3d7e5905 ufshci: add helper to convert SCSI LUN to UPIU LUN formats
Reviewed by:		imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:	https://reviews.freebsd.org/D53919
2025-12-01 04:40:15 +00:00
Robert Clausecker 5bfdb66ad9 man/man3: add cross references to stdbit(3)
Add cross references to relevant stdbit man pages

Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D53661
2025-11-30 20:21:52 +01:00
Robert Clausecker 2fb8cbc6ef libc/tests: add stdbit test framework and unit tests
This adds unit tests for all 70 functions in <stdbit.h>.

I'm sorry for the test framework, but it makes it so I don't
have to write 70 unit tests by hand.

Reviewed by:	adrian, des
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53660
2025-11-30 20:21:52 +01:00
Robert Clausecker d790b16bbf libc/stdbit: add man pages for stdbit functions
This adds man pages for each group of functions in <stdbit.h>.
The man pages have cross references to one-another.
Cross references from external man pages to these will be added
in a later commit.

Reviewed by:	pauamma@gundo.com, kib
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53659
2025-11-30 20:21:52 +01:00
Robert Clausecker d39e310c7d man/man3: add stdbit.3
This is the overview man page for the <stdbit.h> functions.

Reviewed by:	pauamma@gundo.com, adrian
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53658
2025-11-30 20:21:52 +01:00
Robert Clausecker 6296500a85 libc: implement C23 <stdbit.h> functions
This new header complies with ISO/IEC 9899:2024 (C23).

Contrary to glibc, we do not provide inline definitions in
<stdbit.h> as we expect our system compiler to soon recognise
these as builtins anyway.

Relnotes:	yes
MFC after:	1 month
Reviewed by:	adrian
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D53657
2025-11-30 20:21:52 +01:00
Robert Clausecker 4a1c7529c9 libc/tests: add test for *_MAX, *_MIN, and *_WIDTH
This file checks the correctness of the various _MAX, _MIN, and
_WIDTH macros defined for the libc types.  It assumes that none
of the types have padding bits.

Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53831
2025-11-30 20:21:51 +01:00
Robert Clausecker 7998a82d2f sys/stdint.h: add C23 _WIDTH macros
The platform-dependent macros are added to the various
_stdint.h headers, those that are always the same are
added directly to _stdint.h.

We may want to move the definitions for WCHAR_* and
WINT_* out of the platform header files as those are
always the same.

Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53830
2025-11-30 20:21:51 +01:00
Robert Clausecker 7326bc7f9c sys/limits.h: add C23 _WIDTH macros
For compliance with IOS/IEC 9899:2024 ("C23").

These macros define the width in bits of the basic integer types.
Another new macro, BITINT_MAXWIDTH, is not yet included as I do not
understand what it should be set to.  Perhaps it is compiler-specific.

Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53825
2025-11-30 20:21:47 +01:00
Ed Maste 8666fda1af aq(4): Fix VLAN tag test
Previously emitted a compiler warning "warning: bitwise comparison
always evaluates to false."

Looking at the OpenBSD driver (which is based on this code) it looks
like the VLAN flag should be set if either of these bits is.  In the
OpenBSD driver these are AQ_RXDESC_TYPE_VLAN and AQ_RXDESC_TYPE_VLAN2
rather than a magic number 0x60.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53836
2025-11-30 10:56:13 -05:00
Ed Maste 0156be41a1 aq(4): Remove unimplemented functions
aq_if_priv_ioctl and aq_if_debug have prototypes but are not yet
implemented.  Just remove the commented-out DEVMETHODs and the unused
prototypes, to clear a build-time warning; the DEVMETHODs and prototypes
can be readded if / when they are implemented.
2025-11-30 10:55:27 -05:00
John Baldwin 2b587c0c8a aq(4): Remove unused DRIVER_MODULE devclass 2025-11-30 10:38:33 -05:00
Olivier Cochard 4756f5ff8f aq(4): Port to IfAPI
Direct access to struct ifnet members is not possible in FreeBSD 15;
accessors must be used.  These exist in all supported FreeBSD versions,
so we do not need to make this conditional.
2025-11-30 10:38:33 -05:00
Rozhuk Ivan 14eb7ec7b7 aq(4): Remove #include of user header <unistd.h>
pause() has 2 different definition in unistd.h and sys/systm.h
2025-11-30 10:38:33 -05:00
Ed Maste 493d26c58e sys: Import snapshot of Aquantia ACQ107 vendor driver
Obtained from https://github.com/Aquantia/aqtion-freebsd commit
c61d27b1d94af72c642deefa0595884481ea7377.

This is not using a vendor branch.  The formerly-upstream repo is
abandoned and I do not believe it will receive updates.  This initial
import serves as a snapshot of the vendor code, but from here we will
iterate on it in the tree as our own code.

Bug fixes, code cleanup, and build infrastructure will follow.

NetBSD and OpenBSD have derivatives of this driver (with additional
hardware support).  We can look to changes in those drivers, and the
Linux driver, to add support here.

Reviewed by:	adrian
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53813
2025-11-30 10:38:33 -05:00
Dag-Erling Smørgrav 029a09f180 sys/_types.h: Actually unbreak gcc build
Fixes:		19728f31ae ("sys/_types.h: Unbreak gcc build")
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D53986
2025-11-30 11:31:09 +01:00
Warner Losh 02b72b1540 arm: Remove unused variable in dbg_arch_supported
Removed unused dbg_didr which had been used prior to f42421307b to
detect qemu unsupported debugger. I'm unsure how this slipped through my
testing.

Fixes: f42421307b
Sponsored by: Netflix
2025-11-29 02:47:49 -07:00
Minsoo Choo 57c0a337db libsys: remove armv6 hack
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 23:07:12 -07:00
Minsoo Choo f3607f5a7f clang: remove armv6 comment
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 23:07:12 -07:00
Minsoo Choo 53da09369c libc: remove ARMv5/6 from man page
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:38 -07:00
Minsoo Choo 3387a1bdba sys: update comment for removal of armv6
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:37 -07:00
Minsoo Choo f42421307b sys: remove armv6/6.1 support from debug monitor
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:36 -07:00
Minsoo Choo 42d704bfc4 sys: remove comment for armv5/6
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:36 -07:00
Minsoo Choo 96265d5ea9 release: match comment for if statement
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:35 -07:00
Minsoo Choo 37c650b4ee tools: remove WITH_LIBSOFT option
This is only used for armv6, which as been removed since FreeBSD 15.

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
2025-11-28 21:56:34 -07:00
Jose Luis Duran 3d91a74638 mtree: Keep mtree files indented with spaces
The mtree tool indents directory entries with 4 spaces.

Reviewed by:	imp
Fixes:		9cab9fde5e ("virtual_oss: Port to base")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D53979
2025-11-29 00:12:39 +00:00
Robert Clausecker 233ddc56a7 unreachable.3: add missing brace in example
Reported by:	alc
Approved by:	markj (mentor)
MFC after:	1 month
Fixes:		b381d09802
See also:	D53967
2025-11-28 22:59:30 +01:00
Warner Losh 687ab0dc54 umass(4): Update to include pointers to quirks
umass(4), while much improved, still sometimes need quirks. Add a
pointer to usb_quirk(4) and usbconfig(8).

Sponsored by:		Netflix
2025-11-28 13:53:13 -07:00
Dag-Erling Smørgrav 19728f31ae sys/_types.h: Unbreak gcc build
We can't assume that <sys/cdefs.h> is in scope.

Fixes:		85ab981a8e ("sys/_types.h: define fallback __(u)intcap_t")
Reviewed by:	olce, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D53980
2025-11-28 20:47:22 +01:00
Dimitry Andric 9978553d01 Remove TableGen objects from libllvm, fixing bad option registrations
In 986e05bc2a I revamped the build for all the llvm subprojects. Among
others I added objects under contrib/llvm-project/llvm/lib/TableGen, but
I missed that upstream explicitly removes these when building the shared
llvm library:

https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/llvm/tools/llvm-shlib/CMakeLists.txt#L23

In 2e47f35be5 I converted libllvm to a shared library. From that point
onwards, some of the global command line option objects registered in
llvm/lib/TableGen/Main.cpp conflict with similar objects in tools like
llvm-cov, llvm-as, etc.

This results in an error when running these tools: "CommandLine Error:
Option 'o' registered more than once!", followed by a fatal exit.

Fix this by removing the TableGen objects from libllvm. Note that we no
longer install any of the tblgen binaries, these are only used during
buildworld, and then in a statically linked form.

PR:		291233
MFC after:	3 days
2025-11-28 19:14:15 +01:00
Robert Clausecker b381d09802 stddef.h: add unreachable() for C23 compliance
unreachable() is a hint to the compiler that it is unreachable.
Add a new man page unreachable(3) to document this macro.

Reviewed by:	imp
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53967
2025-11-28 16:56:49 +01:00
Robert Clausecker 04d000a378 jemalloc: avoid clash with C23 unreachable() macro
Summary: This avoids a clash with the new macro in <stddef.h>
introduced in D53967

Reviewed by:	imp
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53968
2025-11-28 16:55:05 +01:00
Robert Clausecker f0e541118c uchar.h: add char8_t
A type similar to char16 and char32_t, for compliance with C23.
The related type atomic_char8_t is added to stdatomic.h.
As char8_t is always unsigned char, I've skipped adding __char8_t.
This can be added, too, if desired.

Reviewed by:	imp
Approved by:	markj (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53952
2025-11-28 16:19:53 +01:00
Robert Clausecker 5da388c633 time.h: add timegm() to the C23 namespace
This function is part of ISO/IEC 9899:2024 (C23) and was forgotten in D47856.

Reviewed by:	imp
Approved by:	markj (mentor)
See also:	D47856
Fixes:		59677aecb6
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D53951
2025-11-28 16:19:40 +01:00