Commit Graph

308169 Commits

Author SHA1 Message Date
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
Kyle Evans 0bf4d22c37 kqueue: don't leak file refs on failure to knote_attach()
We'll subsequently just knote_free() since the knote is barely
constructed, but that bypasses any logic that might release references
on owned files/fops.  Defer clearing those until the knote actually owns
them and update the comment to draw the line more clearly.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D56318
2026-04-08 21:37:11 -05:00
Enji Cooper 9f7080ba6b crypto/openssl: add new manpage from release 3.5.6
MFC after:      1 day (the security issues warrant a quick backport).
MFC with:       10a428653e
2026-04-08 19:00:10 -07:00
Enji Cooper 5254e16213 crypto/openssl: update artifacts to match 3.5.6 release artifacts
A new manpage and any associated links will be added in the next commit.

MFC after:      1 day (the security issues warrant a quick backport).
MFC with:	10a428653e
2026-04-08 18:55:43 -07:00
Enji Cooper 10a428653e MFV: crypto/openssl: update to 3.5.6
This change brings in version 3.5.6 of OpenSSL, which features
several security fixes (the highest of which is a MEDIUM severity
issue), as well as some miscellaneous feature updates.

Please see the release notes [1] for more details.

PS Apologies for the confusing merge commits -- I was testing out a
new automated update process and failed to catch the commit message
issues until after I pushed the change.

1. https://github.com/openssl/openssl/blob/openssl-3.5.6/NEWS.md

MFC after:	1 day (the security issues warrant a quick backport).
Merge commit 'ab5fc4ac933ff67bc800e774dffce15e2a541e90'
2026-04-08 18:44:24 -07:00
Mark Johnston 36d971464a geom: Make g_waitidle() wait for orphaned providers
This is motivated by the following race in the ZFS zvol code.

When a zvol is created, we create a GEOM-backed zvol, which results in a
/dev/zvol/<zvol path> device file, created by GEOM::dev.  If volmode=dev
is specified, zvol_set_volmode_impl() will wither the GEOM, then create
a device file with the same name.  This sometimes fails because
g_wither_geom() is asynchronous, so we end up trying to create a device
file while the old one still exists.  I want to fix this by adding a
g_waitidle() call to zvol_os_remove_minor().

g_waitidle() is not sufficient: GEOM::dev does not destroy the device
until g_dev_orphan() is called.  (In fact the device destruction is
asynchronous too, but the delist_dev() call is sufficient to address
this race.)  So, I propose modifying g_waitidle() to block until
orphaned providers are processed.

PR:		258766
Reviewed by:	mav, imp, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55049
2026-04-09 01:10:13 +00:00
Xin LI c0d9a07101 MFV: zstd 1.5.7.
MFC after:	2 weeks
Relnotes:	yes
2026-04-08 14:22:45 -07:00
Alexander Ziaee dd201e407e lockf.1: Organize and provide error numbers
Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

MFC after:		3 days
Reported by:		Antranig Vartanian <antranigv@freebsd.am>
Differential Revision:	https://reviews.freebsd.org/D48470
2026-04-08 16:09:15 -04:00
Dmitry Salychev 8e99453380 dpaa2: Extract frame-specific routines to dpaa2_frame.[h,c]
As soon as we need information from the hardware frame annotation to
make sure that checksums of the ingress frames were verified by the
DPAA2 HW, I've decided to make a preparation and extracted all of the
frame related routines into the separate dpaa2_frame.[h,c] along with
some clean up and improvements, e.g. no more dpaa2_fa, but dpaa2_swa
and dpaa2_hwa structures to describe software and hardware frame
annotations respectively, dpaa2_fa_get_swa/dpaa2_fa_get_hwa to obtain
those annotations from the frame descriptor. The next step is to
implement dpaa2_fa_get_hwa.

PR:		292006
Approved by:	tuexen
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56315
2026-04-08 21:48:11 +02:00
Dag-Erling Smørgrav 8cbd394929 stat: Nits in stat tests
* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D56304
2026-04-08 17:35:35 +02:00
Brooks Davis a7e07d0d57 libgcc_s: export __extendhftf2
We've compiled it since the LLVM 13 import in 2021, but for some reason
never exported it.  A user of CheriBSD recently caused Morello LLVM to
emit a reference to it so finish the job and export it.

Reviewed by:	dim, emaste
Fixes:		6e75b2fbf9 ("Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a")
MFC after:	1 week
Sponsored by:	DARPA, AFRL
See also:	https://github.com/CTSRD-CHERI/cheribsd/issues/2614
Differential Revision:	https://reviews.freebsd.org/D56310
2026-04-08 16:31:55 +01:00
Shunchao Hu 16aa49f6d1 compat/linprocfs: Fix auxv sbuf leak
linprocfs_doauxv() allocates an automatic sbuf before validating
whether the requested read can be satisfied.

When the computed auxv read length exceeds IOSIZE_MAX, or when the
buffer length is too big, the function returns early without
releasing the sbuf.

Route these early exits through a shared cleanup path so the sbuf is
always deleted after sbuf_new_auto() succeeds.

Signed-off-by:  Shunchao Hu <ankohuu@gmail.com>
Reviewed by:    des, spmzt, zlei, aokblast
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2118
2026-04-08 23:30:23 +08:00
Konstantin Belousov c913dce86e lib/msun: centralize addition of the arch-specific symbol map files
This also adds the aarch64 symbols, exporting them.

Reported and tested by:	fluffy
Reviewed by:	emaste
Fixes:	3a01e1e1a5
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56283
2026-04-08 17:32:00 +03:00
Konstantin Belousov 96a685c229 lib/msun/aarch64: provide export file for arch-specific fenv methods
Reported and tested by:	fluffy
Reviewed by:	emaste
Fixes:	3a01e1e1a5
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56283
2026-04-08 17:32:00 +03:00
Andrew Turner 0ddaa4c86d arm64: Add arm64 SVE tests
Add the tests/sys/arch directory for architecture-specific tests and
use it to add arm64 SVE tests. These test the kernel is managing the
SVE state in a way we expect.

These tests require SVE hardware support to run so will skip when they
can't detect it.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43311
2026-04-08 15:20:52 +01:00
Mark Johnston 04132e0100 vm_fault: Reset m_needs_zeroing properly
- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

PR:		294039
Reviewed by:	kib
Tested by:	Peter Much <pmc@citylink.dinoex.sub.org>
MFC after:	3 days
Fixes:		cff67bc43d ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:	https://reviews.freebsd.org/D56234
2026-04-08 14:04:29 +00:00
Mark Johnston 77df024030 ip6_mroute: VNETify counters
Commit a223d6c489 made most of the ip6_mroute state per-VNET, but
failed to do this for a couple of counter structures.  Make them
per-VNET too.

Reported by:	zlei
Reviewed by:	pouria, zlei
Fixes:		a223d6c489 ("ip6_mroute: Start putting global variables into a structure")
Differential Revision:	https://reviews.freebsd.org/D56253
2026-04-08 14:04:29 +00:00
Mark Johnston 8a68c2509c imgact_elf: Unconditionally initialize a variable in a note handler
In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter.  But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.

PR:		292811
MFC after:	1 week
2026-04-08 14:04:29 +00:00
Robert Clausecker 8b5d77bbcb libc/tests/string: add a more comprehensive unit test for strrchr()
The unit tests are patterned after those for memrchr().
This catches the issue found in 293915.

PR:		293915
Reviewed by:	strajabot
Reported by:	safonov.paul@gmail.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56037
2026-04-08 15:21:50 +02:00
Alexander Ziaee 2bcdab5745 mfiutil.8: Fix typo - missing macro for dev node
MFC after: 3 days
2026-04-08 08:53:18 -04:00
Kyle Evans bf0881060e lualoader: allow the local module to filter out the BE list
This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:

-- file: /boot/lua/local.lua
local core = require("core")

local function be_hide(be)
    if core.isSingleUserBoot() then
        -- All BEs are accepted for single-user
        return true
    end

    local name = be:match("/([^/]+)$")
    if not name then
        -- Accept malformed BEs, for whatever reason
        return true
    end

    return name:match("^%.") == nil
end

if core.bootenvFilter then
    -- Just in case we need to be compatible with older versions of
    -- core.lua without the filtering functionality.
    core.bootenvFilter(be_hide)
end
-- EOF

Requested by:	Marek Zarychta
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55359
2026-04-08 07:49:58 -05:00
Aymeric Wibo 19ab46cc66 acpi: Parse _S3D in s2idle instead of _S255D
Previously, when entering s2idle, we were parsing the _S255D object to
get the shallowest D-state supported by device, as
acpi_stype_to_sstate() returns -1 for s2idle.

Instead, we should read _S3D.

Relevant document:
https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/07_Power_and_Performance_Mgmt/device-power-management-objects.html#s3d-s3-device-state

Reviewed by:	olce
Tested by:	emaste, olce
Approved by:	olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55118
2026-04-08 20:11:23 +08:00
Dag-Erling Smørgrav 1c793e7cbe stat: Nits in readlink tests
* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D56293
2026-04-08 13:26:23 +02:00
ShengYi Hung 095cbb1bb7 hwpstate_amd: Expose nodes as much as possible in legacy pstate
Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55606
2026-04-08 15:48:34 +08:00