libproc: link against libctf if MK_CTF != no instead of MK_CDDL != no
Logic prior to this change would incorrectly try linking when MK_CDDL != no,
instead of MK_CTF != no, which could result in the library and the tests being
broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible
combination with today's build knobs).
This change updates the conditional to correctly track the value of MK_CTF, which
in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build
knob.
This [niche] build bug has been present in FreeBSD since 2014.
MFC after: 1 week
(cherry picked from commit f2e6a8b9e50c7552037cb635f17b955ead84a813)
rc.d/dumpon: minor hardening/tightening up
- Scope local variables properly to each function.
- Quote variables that should be treated as single words.
- Replace `${cmd}; if [ $? -eq 0 ]` with `if ${cmd}` for simplicity.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57899
(cherry picked from commit fc186c24b1e72fa3eba91c166f7a554a5cea5828)
rc.d/dumpon: minor hardening/tightening up
- Scope local variables properly to each function.
- Quote variables that should be treated as single words.
- Replace `${cmd}; if [ $? -eq 0 ]` with `if ${cmd}` for simplicity.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57899
(cherry picked from commit fc186c24b1e72fa3eba91c166f7a554a5cea5828)
linux_firmware: reformat error print-out
This makes it easier to grep for the error message to better understand
the call stack when loading firmware modules fails.
Fix a cosmetic-only style(9) bug while here in the same function related
to another logging message.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58380
(cherry picked from commit a594783bac906ecc4f6528d7d576215f85a21bda)
linux_firmware: reformat error print-out
This makes it easier to grep for the error message to better understand
the call stack when loading firmware modules fails.
Fix a cosmetic-only style(9) bug while here in the same function related
to another logging message.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58380
(cherry picked from commit a594783bac906ecc4f6528d7d576215f85a21bda)
[test] libatexit: leverage __{BEGIN,END}_DECLS
This change converts the longhand form of `extern "C" {` and its
corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.
The new form is much easier to grep for and is a best practice to use in
the FreeBSD tree.
This is meant to be a non-functional change.
MFC after: 1 week
(cherry picked from commit bc81728c00b200297ac556974b5373c804077a17)
[test] libatexit: leverage __{BEGIN,END}_DECLS
This change converts the longhand form of `extern "C" {` and its
corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.
The new form is much easier to grep for and is a best practice to use in
the FreeBSD tree.
This is meant to be a non-functional change.
MFC after: 1 week
(cherry picked from commit bc81728c00b200297ac556974b5373c804077a17)
cpuset(9): correct markup
- Remove `\(em` from .Nm section as it's not valid mandoc markup.
- Remove the section from the .Nm directive (it's handled under the .Dt
directive).
MFC after: 1 week
Reported by: make manlint
(cherry picked from commit 5007a5d682d3737fe9b49c4cd69e04d025d209ec)
cpuset(9): correct markup
- Remove `\(em` from .Nm section as it's not valid mandoc markup.
- Remove the section from the .Nm directive (it's handled under the .Dt
directive).
MFC after: 1 week
Reported by: make manlint
(cherry picked from commit 5007a5d682d3737fe9b49c4cd69e04d025d209ec)
contrib/netbsd-tests: lib/libc/c063: sync with NetBSD
This change syncs the lib/libc/c063 NetBSD tests with FreeBSD. This does
two things:
- Addresses bogus tautologically true assertions flagged by clang and gcc
with ATF 0.22+ [1].
- Brings in some new test coverage.
Obtained from: NetBSD (date tag: `20260818UTC`)
MFC after: 2 weeks
1. https://github.com/freebsd/atf/pull/72
(cherry picked from commit 8109a5c0fba0d015354a69b40e6682d5e8c0f638)
arm64 pmap: correct the condition for flushing the icache
Whenever we create a user-space mapping, we always set ATTR_S1_PXN in
the PTE, which blocks execution of user-space code while running in
kernel mode. However, when seeking to determine whether we need to
perform an icache flush before installing the new PTE, we test whether
sometimes the old PTE or other times the new PTE has ATTR_S1_XN set.
The trouble is that ATTR_S1_XN is defined as the bitwise OR of
ATTR_S1_PXN and ATTR_S1_UXN, and so the test for whether ATTR_S1_XN is
set is satisfied if either of its constituent bits is set, i.e., we
write (l3e & ATTR_S1_XN) != 0. Consequently, the test is always true.
In practice, I believe that the ill effects of this bug are limited:
In pmap_enter(), in rare circumstances, e.g., wiring a code page, an
unnecessary icache flush will be performed. In pmap_enter_l2() and
pmap_enter_l3c(), no icache flush will be performed. However,
typically an icache flush would have already been performed on each of
the constituent base pages.
[3 lines not shown]
ixl: Reset VSI statistics after initial sampling
The initial statistics update runs before the PF VSI has obtained its
firmware-assigned statistics counter index. Discard that provisional
VSI baseline so the first update after initialization records the
correct hardware counter.
Without this reset, subtracting a larger provisional value from a newly
selected counter can be mistaken for a 32-bit wrap and report nearly
UINT32_MAX receive drops immediately after boot.
Reported by: Daniel Braniss <danny at cs.huji.ac.il>
Tested by: Daniel Braniss <danny at cs.huji.ac.il>
Obtained from: Intel ixl 1.14.2
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59336
Update in preparation for 14.5-RELEASE
- Bump BRANCH to RELEASE
- Add the anticipated RELEASE announcement date
- Set a static __FreeBSD_version
Approved by: re (implicit)
Sponsored by: OpenSats Initiative
route/fib_algo: Free leaked radix_masks in radix_lockless
radix_lockless algorithm creates its own radix tree and
allocates its own radix_masks by directly calling rnh_addaddr().
However, during destruction, it only frees the radix_tree without
freeing its allocated radix_masks.
Fix the leak by calling rn_delete() during radix_destroy().
PR: 297339
Reviewed by: melifaro
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D59112
(cherry picked from commit 790817f5a7a640c9ceb5c2ad99135f1a69aeb77d)
route/fib_algo: Free leaked radix_masks in radix_lockless
radix_lockless algorithm creates its own radix tree and
allocates its own radix_masks by directly calling rnh_addaddr().
However, during destruction, it only frees the radix_tree without
freeing its allocated radix_masks.
Fix the leak by calling rn_delete() during radix_destroy().
PR: 297339
Reviewed by: melifaro
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D59112
(cherry picked from commit 790817f5a7a640c9ceb5c2ad99135f1a69aeb77d)
devstat: Fix a kernel stack disclosure
The 16-byte "device_name" field was not zero-filled, so could contain
uninitialized stack data. Zero the whole struct, as that's the
prevailing pattern for this kind of conversion code, and it's more
robust in the face of future revisions to struct devstat.
Approved by: re (cperciva)
Reviewed by: olce, kib
Reported by: Reo Shiseki
Fixes: a11d132f6c62 ("devstat: Provide 32-bit compatibility")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59309
(cherry picked from commit 7cb1a76f88158fb690418336b736e66c238cd4f7)
(cherry picked from commit 6e94e0734b9d3036df8c7d94d827f8eb1119905b)
gzoned: Introduce Zoned Storage emulator
gzoned(8) is a new GEOM class that exposes a host-managed zoned device
(similar to ZAC/ZBC drives) on top of regular, non-zoned providers.
The created medium is sliced into equally sized zones, by default
sequential-write-required. Such zones can be turned into conventional
zones if desired. The zoned drive's state and configuration is
persistent through metadata at the tail of the backing provider, meaning
the zoned device gets recreated at the provider retaste. Zone state
changes only mark the table dirty with BIO_FLUSH committing it,
mirroring drives whose zone state is volatile until a cache flush.
The new class tries to emulate real zoned drives by incorporating
per-zone write pointers and support for BIO_ZONE management commands.
Fault emulation through zone conditions (RWP recommended, offline, R/O),
URSWRZ bit toggling and concurrent open zone limits are additional
features useful for testing.
[11 lines not shown]
hwpmc: Add ATF regression tests for hwpmc EXTERROR diagnostics
Root-only ATF program hitting negative allocate/attach/read-write paths
and asserting the exterr(3) text. AMD/IBS cases skip without the PMC
class; program skips without hwpmc.
Additional changes by mhorne@:
- Move and rename to the established test directory tests/sys/pmc
- Remove broken test amd_missing_pmu_flag; fixed by recent change
6c4d9b9af1a3
- Add ATF_REQUIRE_FEATURE("exterr_strings") to skip the tests on kernels
compiled without the strings
- Remove arch-conditional compilation; tests are properly gated by PMC
class check
- Fix copyright formatting
Reviewed by: Ali Mashtizadeh <ali at mashtizadeh.com>
Signed-off-by: Andre Silva <andasilv at amd.com>
Co-authored-by: mhorne
[2 lines not shown]
subr_physmem_test: add tests for two edge-cases
Help validate my assertion that "physmem will never report empty
ranges". Part of this is covered by the existing tests, which check the
merging of adjacent/overlapping regions. The other part is to ensure
that addition of zero-sized ranges is ignored.
The physmem implementation also includes logic to ignore the first
physical page of memory (physical addresses 0 to PAGE_SIZE-1). Add a
second test case for this.
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45914
(cherry picked from commit 1b5ec2e466ee100161017ae2618f91829310f1d6)
g_eli: better handling of absent/disabled CPUs
Checking hlt_cpus_mask is a no-op, and the mask will be removed in the
next commit. However, we can use the more recent CPU_ABSENT() macro to
check the status.
Reviewed by: olce
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58157
(cherry picked from commit 63d4f044225d1bb86767759b18c0ae63b25a9c03)