libc/stdlib: Port strtonumx() from Illumos
Add strtonumx(), a companion to strtonum(3) that preserves its safety
and error-reporting semantics while allowing the caller to specify a
conversion base, similar to the strtol(3) family of functions.
Reviewed by: emaste, kib, ziaee
Obtained from: https://www.illumos.org/issues/15365
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54270
nvme: Add ability to override ioq to put the request on
Sometimes the client device needs to manage the IOQ the request goes
to. Expand the interface we have for the request to allow it to be set
for this special use case.
Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D54714
jexec: Add -e parameter to customize the environment
Currently, to define a new environment variable or modify an existing
one, we need to use env(1), which may or may not be available inside
the jail, especially in OCI containers created with the scratch
layer (i.e., those containers that are only a single static binary,
plus configuration files and related stuff). With this option, we
can specify environment variables of arbitrary length for the
specified process running inside the jail.
Reviewed by: jamie@
Approved by: jamie@
Differential Revision: https://reviews.freebsd.org/D54660
netinet6: garbage collect OSIOCGIFINFO_IN6
This ioctl has been marked as "old" starting with the original KAME export
over 20 years ago and has been hidden under #ifdef _KERNEL since. There
is no software that uses it.
EC2: Add extra SSM Parameter names for releases
Record releases in the SSM Parameter Store not just as e.g.
/aws/service/freebsd/arm64/small/ufs/15.0/RELEASE
but also as .../RELEASE/latest, e.g.
/aws/service/freebsd/arm64/small/ufs/15.0/RELEASE/latest
The latter parameters will be updated when new AMIs are built with
security and errata updates appplied, and have been backfilled for
15.0.
MFC after: 3 days
MFC to: stable/15 (14.x will not get security-update AMIs)
Sponsored by: Amazon
(cherry picked from commit b558c92fd0005d311edbcd02953c17d4a34fb909)
net80211: fix arguments to IEEE80211_NOTE in ieee80211_fix_rate
Fix the arguments to the debug statement.
(slightly adjusted from the original submission by bz)
PR: 286448
MFC after: 3 days
LinuxKPI: pci: fix pcie_get_speed_cap()
pcie_get_speed_cap() has a hard coded skip of 3 devices at the
beginning. It is either called on a pdev or on a result from
pci_upstream_bridge(). In the latter case skipping another three
devices might get us to acpi0 or nexus, neither of which is a
PCI device still and pci_get_vendor() will panic() on that.
Sponsored by: The FreeBSD Foundation (commit)
GHI: https://github.com/freebsd/drm-kmod/issues/393
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D53862
modules: factor out LinuxKPI based wireless drivers and add RISC-V
The LinuxKPI based wireless drivers are currently limited to amd64 and
arm64 (and until cleaned up i386). Adding RISC-V now as we have a
report that iwlwifi(4) works on RISC-V [1]. Factor the LinuxKPI based
wireless drivers out into their own block.
Given RISC-V has no ACPI support yet (though we fixed #includes in
order to keep compiling the drivers without further modifications
where possible) we need to take care of rtw89 which fails to compile
without ACPI enabled. A quick check at the Linux build files indicates
that the depenency is not correctly recorded there either. Disable
compiling rtw89 without ACPI (on RISC-V) for the moment until this is
fixed.
[1] https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=5947+0+archive/2026/freebsd-wireless/20260112.freebsd-wireless
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
[2 lines not shown]
LinuxKPI: include acpi headers for RISC-V
In order to compile iwlwifi(4), which is reported to work on RISC-V,
include the ACPI headers to avoid adding further FreeBSD-specific #ifdefs
to the driver. With this iwlwifi(4) just compiles on RISC-V (at least
if ACPI support is turned off in the module Makefile).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54692
riscv: add (a dummy) acpica_machdep.h
We have reports that iwlwifi(4) works on RISC-V. While we can turn off
full ACPI-specific files easily, intermittent code still relies on the
header files to be present. In order to not need to completely #ifdef
everything out we want to include acpi.h from LinuxKPI and as a result
need this file. With this the iwlwifi(4) code compiles just fine and
will do the right thing (given the functional ACPI parts are disabled/
unavailable).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: mhorne, emaste
Differential Revision: https://reviews.freebsd.org/D54691
swab: Correctly treat the data as misaligned
The __aligned attribute in the previous version applied to the location
of the pointers, not the data the pointers pointed to. While this
could be fixed by applying the attribute to a local typedef of uint16_t,
just using memcpy() for the unaligned access is simpler and ISO C.
This fixes the build on CHERI architectures which do not support
misaligned pointers and were thus failing with:
lib/libc/string/swab.c:12:18: error: alignment (1) of 'const uint16_t *' (aka 'const unsigned short *') is less than the required capability alignment (16) [-Werror,-Wcheri-capability-misuse]
12 | const uint16_t *f __aligned(1) = from;
|
Co-authored by: Jessica Clarke <jrtc27 at FreeBSD.org>
Fixes: 02ebbc781f08 ("swab: Fix implementation to support overlapping copies")
Sponsored by: AFRL, DARPA
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54399
rtld: Use uintptr_t instead of Elf_Addr for init/fini function pointers
This is a no-op on non-CHERI architectures, but is required for CHERI
where Elf_Addr is only an address and not a complete pointer.
While here, consistently use `uintptr_t *` for arrays of init/fini
function pointers.
Reviewed by: imp, kib
Effort: CHERI upstreaming
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54711
rtld: Simplify walking program headers
Store phnum in Obj_Entry instead of phsize and use that to simplify
the terminate expressions when iterating over program headers.
Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54710
rtld: Switch to using <assert.h> for assert
The stock assert() works because rtld-libc includes a custom
implementation of __assert().
Reviewed by: imp, kib
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54712
libexecinfo: tests: Expect failure on aarch64
Add a guard that expects a failure of the test on aarch64.
Reviewed by: emaste
Fixes: df1ea5887326 ("tests: Test libexecinfo backtrace call througth signal trampoline")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54675
tuning.7: use the correct word for collapsing
Fixes: 457b940bfb6a228af1281f357b627ecf1e26fea5
Signed-off-by: Oliver Pinter <oliver.pntr+freebsd at gmail.com>
MFC after: 1 week