Commit Graph

308242 Commits

Author SHA1 Message Date
Gleb Smirnoff 87ef3067ac tcp lro: use hashalloc(9)
Reviewed by:		tuexen, rrs
Differential Revision:	https://reviews.freebsd.org/D56177
2026-04-12 10:26:12 -07:00
Gleb Smirnoff 9992eb4358 gif: use hashalloc(9)
Functional change is that on destruction INVARIANTS checks will run.  Also
the mask is no longer hardcoded, so makes it easier to make hash size a
tunable.

Reviewed by:		ae
Differential Revision:	https://reviews.freebsd.org/D56176
2026-04-12 10:26:08 -07:00
Gleb Smirnoff adba114dfb netinet: use hashalloc(9) for IP address hash
While here, slightly restyle ip_vnet_init() and use sparse initializer for
pfil_head_args.  There is no functional change wrt to pfil(9) hook
registration.

Differential Revision:	https://reviews.freebsd.org/D56175
2026-04-12 10:26:03 -07:00
Gleb Smirnoff 8e1513dc67 inpcb: use hashalloc(9)
While here remove ipi_lbgrouphashmask, as it is always has the same value
as ipi_porthashmask.

Differential Revision:	https://reviews.freebsd.org/D56174
2026-04-12 10:25:57 -07:00
Gleb Smirnoff abf68d1cf0 hash(9): introduce hashalloc()/hashfree() KPI
This is a more extendable version than traditional hashinit(9).  It allows
different kinds of slot headers with optional locks.

Implement traditional hashinit()/hashdestroy() on top of it.

Reviewed by:		pouria, gallatin
Differential Revision:	https://reviews.freebsd.org/D55904
2026-04-12 10:25:51 -07:00
Andre Albsmeier e9a69948a8 daemon(8): Add "--output-file -o" to list of options enabling supervision mode
This is the small internal doc fix from https://reviews.freebsd.org/D46313

Reviewed by:	michaelo
Approved by:	(blanket; comment fix)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55325
2026-04-12 18:28:24 +02:00
Yuichiro NAITO 938c076b9b ixgbe: Fix MRQC register value.
Focus on the MRQE field of the MRQC register, which is 4 bits wide,
and we use these 3 types of values.

  - IXGBE_MRQC_RSSEN 0x1  (non VF mode)
  - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs)
  - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs)

If we always take a bitwise OR with IXGBE_MRQC_RSSEN,
IXGBE_MRQC_VMDQRSS32EN will never be chosen.
Select these 3 types of values for the proper case.

Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2132
2026-04-11 21:50:28 -07:00
Rick Macklem 6698596cd2 nfsv4.4: Document setup of a NFSv4 root fs
Commit 8b9775912c added support for an NFSv4 mounted
root file system.  This patch documents how to set this
up.  It also includes some minor updates and fixes
some formatting.

This is a content change.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56317
Fixes:	8b9775912c ("nfs_diskless: Add support for an NFSv4 root fs")
2026-04-11 12:36:56 -07:00
Dag-Erling Smørgrav 9d95d80669 tunefs: Fix pointer arithmetic
While here, remove a bogus const which has been there for years.

MFC after:	1 week
Reported by:	ivy@
Fixes:		1b83e8a3f8 ("Constify string pointers.")
Fixes:		8244dd3262 ("tunefs: Better fix for arm64 alignment issues")
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D56343
2026-04-11 21:23:08 +02:00
Michael Osipov 850eb149e7 mfiutil(4)/mrsasutil(4): "show drives" truncates information
Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:		294354
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D56328
2026-04-11 20:28:03 +02:00
Michael Osipov 4f684e929d loader.efi.8/efibootmgr.8: Don't use contradicting term 'EFI BIOS'
Both (U)EFI and BIOS are completely different things, be precise and don't use
them together.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D56329
2026-04-11 20:24:43 +02:00
Robert Clausecker 47ca491ca4 msun/math.3: reference new functions f{max,min}imum{,_num,_mag}()
See also:	D55834, D56236
MFC after:	1 month
2026-04-11 20:09:13 +02:00
Jesús Blázquez 4e30c12973 lib/msun: Added fmaximum_mag and fmaximum_num families
Added support for the f{maximum,minimum}_{mag,num} families, the new
C23 standard functions for maximum magnitude and number-preferring
maximum.  This includes modifying fmax.3, on top of D56230, to
recommend the use of fmaximum_num and fminimum_num.

Reviewed by:	fuz, kargl
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D56236
2026-04-11 20:09:13 +02:00
Bjoern A. Zeeb de2ea5423c zstd: disable weak-symbol tracing hooks in the kernel
zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe.  That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.

In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime.  On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs.  On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot.  Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.

The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),
which skips inclusion of zstd_trace.h entirely and forces ZSTD_TRACE=0.
Add it to ZSTD_C alongside the existing ZSTD_* defines, and while here
group all three -DZSTD_* flags onto a single line in alphabetical order
with ${.IMPSRC} on its own line.

Reported by:	many
Tested by:	lwhsu
X-MFC-with:	c0d9a07101
2026-04-11 09:28:00 -07:00
Shunchao Hu 5f5cc3c67a compat/linprocfs: Update /proc/partitions output
Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name.  linprocfs still printed obsolete
statistics columns and reported the size in bytes.

Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
Reviewed by:    des
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2126
Closes:         https://github.com/freebsd/freebsd-src/pull/2126
2026-04-11 22:10:05 +08:00
Adrian Chadd 4e3fdced7f qcom_gcc: migrate the MSM8916 support to qcom_gcc
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
  the MSM8916 stub in sys/arm64/qualcomm .

Differential Revision:	https://reviews.freebsd.org/D49706
2026-04-10 15:12:11 -07:00
Pouria Mousavizadeh Tehrani 87bea33a67 nd6: Remove DRAFT_IETF_6MAN_IPV6ONLY_FLAG and EXPERIMENTAL options
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
2026-04-10 23:42:09 +03:30
F. Duncanh 2c6feab253 hccontrol: Support generic Bluetooth LE AdvData
hccontrol LE_Set_Advertising_Data does not currently allow construction
of manufacturer-specific type 0xFF AdvData.  Fixed by a new data-entry
option -b "b1,b2,b3,...,bn" where b's are 8-bit byte strings (octets).

Signed-off-by: F. Duncanh <fduncanh@gmail.com>
Reviewed by: takawata, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2082
2026-04-10 21:36:34 +03:30
Simon J. Gerraty 35bbdfad28 Pass severity to vectx_open() rather than vectx_close()
file_loadraw() can have a need to load unverified files
like "dtrace_dof".  Allow severity_guess() to look at the filename
but if it returns less than VE_MUST check that the type is not
one we insist on verifying.

In vectx_open if severity < VE_MUST we can allow it to be unverified.
If passed VE_GUESS we call severity_guess().
Regardless, we record severity in ctx so it is available to vectx_close().

Sponsored by: Hewlett Packard Enterprise Development LP

Reviewed by:	khng
Differential Revision:	https://reviews.freebsd.org/D56297
2026-04-10 10:46:54 -07:00
Christos Longros fc68534a9a rge: add Wake-on-LAN support for magic packet
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default.  On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.

Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.

Update rge.4 to document WoL support.

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56259
2026-04-10 10:31:38 -07:00
Simon J. Gerraty de9fe28ab8 Allow passing xtras to safe_set
This allows safe_set to be leveraged in other contexts
where additional chars like '*' or '!' or even '\[\]' need to
be preserved in the result.
2026-04-10 09:11:21 -07:00
Alexander Ziaee ff32dbb1d1 arcmsr.4: Improve HARDWARE introductory sentence
MFC after:	3 days
2026-04-10 11:26:45 -04:00
Konstantin Belousov 31069fdbda kevent: do not check knote lists being empty before removing a knote
If a knote belongs to the list, there is no reason to check for the list
emptiness.  On the other hand, if the knote does not belong to the list,
then checking for emptiness is not enough since there might be a
different knote there.

Reviewed bu:	kevans, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56341
2026-04-10 17:34:48 +03:00
ShengYi Hung 2358492b03 x86: Add zen identifier helper function
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56330
2026-04-10 21:51:31 +08:00
Mariusz Zaborski 9f1be4bfeb cap_dns: plug a memory leak 2026-04-10 12:20:27 +02:00
Konstantin Belousov 4da93b9a8a subr_early.c: cleanup includes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-04-10 13:16:28 +03:00
Warner Losh 82ff1c334b nvme: Allow larger user request sizes
We have a small buffer for pages on the stack, but if the user wants to
do an I/O larger than this we currently fail w/o a way for the user to
know the max size. It's not hard to allocate an array for the uncommon
case of very large I/Os, and the performance advantage of the array is
small in that case anyway. In addition, this allows firmware upgrades
using the full transfer size of the device as a happy accident too.

Sponsored by:		Netflix
Reviewed by:		chs, chuck
Differential Revision:	https://reviews.freebsd.org/D55638
2026-04-09 17:37:21 -06:00
Warner Losh 428034ad0d sys/kobj.h: Make self-sufficient
kobj.h just needs sys/types.h (because it uses u_int, it can't use
sys/_types.h). kobj.h isn't a standard thing, so we don't need to be
careful about namespace pollution.

Sponsored by:		Netflix
2026-04-09 17:37:21 -06:00
Bhosale, Yogesh 6b58d10fc6 ix(4): Add support for firmware logging for E610 adapters
This is part 3 of the support for the new Intel Ethernet E610
family of devices

The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.

When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.

This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	ziaee, kbowling
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 weeks
Sponsored by:   Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D53973
2026-04-09 20:43:43 +02:00
Baptiste Daroussin 72d701eb1d nlsysevent: add manpage
Reviewed by:	des
2026-04-09 19:39:28 +02:00
Weixie Cui c6224994ac freebsd32: Fix freebsd11_nstat copyout condition
freebsd11_freebsd32_nstat() invoked copyout(2) when
freebsd11_cvtnstat32() failed and skipped copyout on success. This is
backwards.

Fix this to match freebsd11_freebsd32_nlstat() and freebsd11_nstat(),
and only copy the nstat32 result to userspace when conversion succeeds.

Signed-off-by:	Weixie Cui <cuiweixie@gmail.com>
Reviewed by:	mhorne
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2109
2026-04-09 13:46:23 -03:00
Ali Mashtizadeh f86ba3eec5 hwpmc: prevent IBS fetch from getting stuck
Both fetch and op IBS sampling have the same problem where we need to
rewrite the control MSR to ensure sampling continues at the correct
rate.  I also like this because it resets the counter reducing the
chances that we collect a sample inside the NMI handler.

Reported by:	Aalok Agarwal
Reviewed by:	mhorne
Sponsored by:	Netflix
Fixes:	e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2130
2026-04-09 13:35:26 -03:00
Ali Mashtizadeh 7a1aaca06c hwpmc: Fix bug when stopping ibs-op
In ibs_stop_pmc I accidently cleared the fetch max count value rather
than the op max count value, when stopping the op counter.  This
mitigates a bug in early pre-zen processors, but breaks using both
counters simultaneously.  I also found that the max op count mask needs
to be extended for recent zen processors.

Reported by:	Andre Fernando da Silva
Reviewed by:	mhorne
Sponsored by:	Netflix
Fixes:	e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2120
2026-04-09 13:35:26 -03:00
Navdeep Parhar 2f3dcbb5ef hwpmc: Fix compile warning
.../sys/dev/hwpmc/hwpmc_mod.c:4640:1: warning: unused function 'pmc_is_multipart' [-Wunused-function]
 4640 | pmc_is_multipart(struct pmc_sample *ps)
      | ^~~~~~~~~~~~~~~~
1 warning generated.

Reviewed by:	mhorne
Fixes:		e51ef8ae49 - main - hwpmc: Initial support for AMD IBS
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56296
2026-04-09 09:22:50 -07:00
Alice Cariboni f916091241 tuning.7: Fix suds typo in manual pages
MFC after:		3 days
Fixes:			fc32c80215 Add two new manual pages
Differential Revision:	https://reviews.freebsd.org/D55814
2026-04-09 17:57:32 +02:00
Li-Wen Hsu 8672683ec8 test/sys/arch: Fix arch without test/sys/arch/${MACHINE_ARCH}
Fixes:		0ddaa4c86d ("arm64: Add arm64 SVE tests")
Sponsored by:	The FreeBSD Foundation
2026-04-09 23:49:56 +08:00
Lexi Winter 0dd9c4abf0 tools/build/Makefile: Always add md4.h to SYSINCS
Since libmd was added to the bootstrap, building main on stable/14
fails because of an incompatibility in its old md4.h.  Fix this by
always including md4.h in the bootstrap headers, instead of only
doing so when building on a non-FreeBSD host.

Fixes:		50de0bf505 ("flua: Always build as a bootstrap tool")
Reported by:	olce
Reviewed by:	olce, kevans
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56327
2026-04-09 15:30:20 +01:00
Sarah Walker f54209510b virtio_blk: Fix initialisation of dump request structure
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.

Reviewed by:	asomers
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D56156
2026-04-09 15:13:31 +01:00
Toomas Soome aacf448007 loader.efi: panic() should show stack trace
Because panic() does provide mechanism to have architecture specific
panic call, we can instruct it to print out stack trace too
(in hope we actually can print). While there, also implement simple
check to detect loop in trace.

illumos issue: https://www.illumos.org/issues/17887
2026-04-09 16:29:12 +03:00
Toomas Soome c1c97f18b5 gptzfsboot: boot prompt should emit new line on input
In case the user did input, we should put newline
on screen to avoid possible error messages to get
mixed with user input.
2026-04-09 14:24:42 +03:00
Baptiste Daroussin 5dc4da1a40 RELNOTES: catchup on changes I have made 2026-04-09 08:58:21 +02:00
Xin LI 111a42d7d7 MFV: zstd: Remove entries listed in FREEBSD-Xlist 2026-04-08 21:48:39 -07:00
Xin LI a985740c21 Remove entries listed in FREEBSD-Xlist. 2026-04-08 21:48:08 -07:00
Siva Mahadevan 7c9418613a sys/contrib/zstd: further narrow FREEBSD-Xlist
We don't need any docs or examples in tree, as well
as any upstream-specific build infrastructure.

Differential Revision: https://reviews.freebsd.org/D55836
2026-04-08 21:43:42 -07:00
Li-Wen Hsu 45079cdf8b installer: Add download.freebsd.org to mirror list
download.freebsd.org is backed by project mirrors and a CDN, which
should benefit most users.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	delphij (releng)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D54849
2026-04-09 12:06:19 +08:00
Kyle Evans 84ce651836 <sys/extattr.h>: use designated initializers for EXTATTR_NAMESPACE_NAMES
This is not a functional change, but it makes it more clear upon
inspection of the definition that the mapping property described is
preserved.  Maybe more importantly, if one ends up getting an index
wrong or punching a hole in the name array unexpectedly, then it'll
hopefully manifest more clearly as a (null) or nullptr deref rather than
potentially just emitting the wrong namespace name.

It's noted that this almost certainly invalidates its use in C++, but
there aren't really any known C++ consumers of it- let's just cross
that bridge if we get there.

Reviewed by:	kib, mckusick, rmacklem
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55323
2026-04-08 21:41:12 -05:00
Kyle Evans 22fba3a9d6 find: add -xattr and -xttrname
We use -xattr in our openrsync tests for convenience, and it seems like
a good addition to FreeBSD.  -xattr and -xattrname will both consult all
available namespaces by default, but -xattrname allows filtering by
namespace using a "user:" or "system:" prefix.

Inspired by:	https://github.com/apple-oss-distributions/shell_cmds
Reviewed by:	kib, rmacklem
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55286
2026-04-08 21:41:12 -05:00
Kyle Evans 9a8d333368 libc: fix memfd_create's HUGETLB handling
The 'simplification' commit referenced below actually broke one aspect
of MFD_HUGETLB: the caller isn't supposed to be required to specify a
size.  MFD_HUGETLB by itself without a shift mask just requests a large
page, so we revert that part of memfd_create() back.

While we're here, fix up the related parts of the manpages a little bit,
since MFD_HUGETLB is actually supported.  The manpage claims that we
would return ENOSYS if forced mappings weren't supported, but this was
actually not true.  However, that seems like a very important
distinction to make between ENOSYS and EOPNOTSUPP, so fix the
implementation to match the docs.

Fixes:	8b8cf4ece6 ("memfd_create: simplify HUGETLB support [...]")
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D56114
2026-04-08 21:37:11 -05:00
Kyle Evans c6dd40f2d3 kqueue: slightly clarify the flow in knlist_cleardel()
This is purely a cosmetic change to make it a little easier on the eyes,
rather than jumping back to the else branch up top.  Re-flow it to use
another loop on the outside and just inline the re-lock before we repeat
after awaking from fluxwait.

The !killkn path should maybe issue a wakeup if there's a thread in
KQ_SLEEP so that userland can observe the EOF, but this isn't a
practical problem today: pretty much every case of knlist_clear is tied
to a file descriptor and called in the close(2) path.  As a consequence,
potentially affected knotes are almost always destroyed before we even
get to knlist_clear().

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D56226
2026-04-08 21:37:11 -05:00
Kyle Evans 0c9cec8b66 tests: kqueue: add a basic test for CPONFORK
Just copy over a timer and a write-filter, be sure that we can observe
both in the child.  Maybe the timer should check for a minimum time
passed, but I don't know that we'd be likely to get that wrong.

This also adds a negative test with a kqueue that is *not* set for
CPONFORK being added to the first one, made readable, and confirming
that we don't see a knote for it in the child.

Some other improvements to the test noted in the review are planned in
the short term, but they're not particularly worth blocking adding this
as a basic sanity check.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D56223
2026-04-08 21:37:11 -05:00