Commit Graph

25680 Commits

Author SHA1 Message Date
Martin Matuska 1b9254f4d4 zfs: unbreak gcc builds after openzfs/zfs@e63d026b9 2025-11-17 22:17:19 +01:00
Robert Clausecker 4fcc58afbf msun: document that {sin,cos,tan}pi(3) follow C23
- also use new .St -ieee754-2008 request in *pi.3

Reviewed by:	imp
Approved by	markj (mentor)
See also:	D53784
Differential Revision:	https://reviews.freebsd.org/D53783
2025-11-17 18:18:46 +01:00
Robert Clausecker 37fa5b36ab msun: expose the C23 functions we already support in <math.h>
This is the *pi family of trigonometric functions. Quite a few C23
functions are still missing.  These seem to be:
acospi, acospif, acospil, asinpi, asinpif, asinpil, atan2pi, atan2pif,
atan2pil, atanpi, atanpif, atanpil, canonicalize, canonicalizef,
canonicalizel, compoundn, compoundnf, compoundnl, daddl, ddivl, dfmal,
dmull, dsqrtl, dsubl, exp10, exp10f, exp10l, exp10m1, exp10m1f,
exp10m1l, exp2m1, exp2m1f, exp2m1l, fadd, faddl, fdiv, fdivl, ffma,
ffmal, fmaximum, fmaximum_mag, fmaximum_mag_num, fmaximum_mag_numf,
fmaximum_mag_numl, fmaximum_magf, fmaximum_magl, fmaximum_num,
fmaximum_numf, fmaximum_numl, fmaximumf, fmaximuml, fminimum,
fminimum_mag, fminimum_mag_num, fminimum_mag_numf, fminimum_mag_numl,
fminimum_magf, fminimum_magl, fminimum_num, fminimum_numf,
fminimum_numl, fminimumf, fminimuml, fmul, fmull, fromfp, fromfpf,
fromfpl, fromfpx, fromfpxf, fromfpxl, fsqrt, fsqrtl, fsub, fsubl,
iscanonical, iseqsig, issignaling, issubnormal, iszero, nextdown,
nextdownf, nextdownl, nextup, nextupf, nextupl, pown, pownf, pownl,
powr, powrf, powrl, rootf, rootl, rootn, roundeven, roundevenf,
roundevenl, rsqrt, rsqrtf, rsqrtl, ufromfp, ufromfpf, ufromfpl,
ufromfpx, ufromfpxf, ufromfpxl.

Reviewed by:	imp
Approved by:	markj (mentor)
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D53783
2025-11-17 18:18:46 +01:00
Martin Matuska 4303bde429 zfs: fix build after openzfs/zfs@e63d026b9
Fix Makefiles
Update zfs_config.h and zfs_gitrev.h
2025-11-17 17:11:56 +01:00
Warner Losh 3c5ca68b9b stand: Fix secureboot build
Make libesecureboot build, enabled when WITH_BEARSSL=y
WITH_LOADER_EFI_SECUREBOOT=y.

Copy EDK2 files related to secure boot to sys/contrib/edk2 and delete
duplicates under libsecreboot/efi/include.
Adjust efi_variables.c to build in the new environment.

Undefine MIN and MAX before include sys/param.h in libsecureboot.h. I'm
not sure that sys/param.h is needed here, but either the param.h or the
Base.h definitions are fine.

Fix include paths to reflect the new way.

Fixes:		43b8edb320
Sponsored by:	Netflix
2025-11-16 22:58:36 -07:00
Warner Losh 67c7e94315 edk2: Move ProcessorBind.h to contrib/edk2
Have our own ProcessorBind.h. It just includes sys/efi-edk2.h, but
undefines TRUE, FALSE and MAC. The first two are from acpica and are
redefined to something almost the same. MAC is a global option that,
well, interferes with using EDK2, dangit. I suppose I should redefine it
after, but I don't think you can save the value of a pre-processor
variable.

This breaks a little with the tradition of having this in a seprate
directory and using build magic. However, the build is already magical
enough and having this here makes things less magical. Also, EDK2 puts
this in a processor specific directory, so we won't have conflicts (they
need it there since they run on more processors than we do: we can just
include sys/efi-edk2.h which covers the smallar variance we have in
processors).

Sponsored by:		Netflix
2025-11-16 11:29:03 -07:00
Warner Losh ce1342883e efi: Move edk2 compat defines to sys/efi-edk2.h
Create efi-freebsd.h, which is safe to include from the FreeBSD context
(all of userland, except the small bits we share with edk2 and the
kernel). This defines anything that we need. At the moment, it just
includes NULL definitions.

Create efi-edk2.h, which is approximately ProcessorBind.h from edk2 that
we can include in FreeBSD compontents that are re-using edk2 components
(bits of the boot laoder, and libefi*). Update the efi_gid definitions
to match edk2 better. Add this file to badfiles.inc, since we can't
write it in a way that's compatible. This is copied from the old
efi-osdep.h.

This has to be done in one commit that's bigger than I like since we
can't easily move things piecemeal around they are so inter-related.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D53651
2025-11-16 11:29:02 -07:00
Robert Clausecker 6c57e368eb lib/libc: implement C23 memalignment()
This new function computes the alignment of a pointer.
It is part of ISO/IEC 9899:2024, the new C standard.
If the pointer is a null pointer, null is returned.
I have tried to write an implementation that can cope
with traditional address-based architectures, even if
size_t and uintptr_t are of different length.  Adjustments
may be needed for CHERI though.

A man page is provided, too.  No unit test for now.

Reviewed by:	kib, imp, ziaee (manpages), pauamma@gundo.com
Approved by:	markj (mentor)
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D53673
2025-11-12 13:23:09 +01:00
Lexi Winter 560af6b43e libpam: Move to a new "pam" package
OpenPAM is a discrete, largely self-contained system component.
Users may not need PAM for many use-cases (e.g. jails, containers),
so move it to its own package.

Use LIB_PACKAGE to create a separate pam-lib package for libpam,
so that applications that support PAM don't need to bring in all
the PAM modules if PAM isn't actually in use.

Add pam to the minimal sets, since this is a core system component that
people expect to be installed.  This means all supported installation
methods will install the PAM modules by default, so don't add explicit
dependencies on the PAM modules from things that use PAM (e.g. runtime),
allowing custom/embedded systems to omit these easily.

This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.

MFC after:	never
Reviewed by:	des, bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53602
2025-11-10 11:05:37 +00:00
Lexi Winter 9cf02c38e4 libpam: Don't put man8 in the dev package
These are user-facing manpages, but were installed in the runtime-dev
package since the PAM modules use bsd.lib.mk.  Use MANNODEV instead of
MAN to put them in the base runtime package instead.

Fixes:  031e711647 ("packages: Install development manpages in the -dev package")
MFC after:	3 days
Reviewed by:	bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53601
2025-11-10 10:17:06 +00:00
Christian S.J. Peron 51c5e2b602 libsys: install manpage links for jail_attach_jd/jail_remove_jd
This was a minor oversight from their introduction.

Commit message by kevans@.

Fixes:	851dc7f859 ("jail: add jail descriptors")
Reviewed by:	kevans
2025-11-06 19:10:13 -06:00
Lexi Winter c55f179fa7 lib/ofed: Move to the rdma package
We have an existing rdma package for IB/rdma-related files, but most
of ofed isn't in that package, making it rather useless.  Move all of
lib/ofed to the rdma package.

Add a separate rdma-lib package using LIB_PACKAGE, since utilities
depends on the rdma libraries and we don't want that to pull in all
of rdma.

This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.

PR:	263227
MFC after:	never
Reviewed by:	manu
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53604
2025-11-06 15:20:52 +00:00
Lexi Winter 0c90c9ad46 lib/googletest: Move to a new googletest package
gtest/gmock are not normally used by users unless running the tests,
so they shouldn't be in the utilities package.  Move them to a new
googletest package, to match what we did with ATF/Kyua.

While here, move tests dependencies from tests-all.ucl to tests.ucl,
which is the canonical place for that.

This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.

MFC after:	never
Reported by:	emaste
Reviewed by:	manu
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53607
2025-11-06 15:20:52 +00:00
Lexi Winter 4b342830ab atf: Move the tests back to the tests package
Commit 9065390ddc moved atf to its own package, but mistakenly moved
the tests as well.  Put the tests back into the test package.

Fixes:	9065390ddc ("packages: Remove the tests-dev package")
MFC after:	1 day
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53594
2025-11-05 21:16:32 +00:00
Kristof Provost f27e44e2e3 pf: convert DIOCRGETADDRS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-11-05 14:59:29 +01:00
Kristof Provost 9bb1c46b4c libpfctl: fix error handling
In two cases we returned E2BIG where it should have been a boolean ('false').

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-11-05 14:59:29 +01:00
Lexi Winter b8697ac70e libcasper: Move everything to the libcasper package
The libcasper package exists to contain libcasper, but for some reason
only the libcap_net service was in the package, with libcasper itself
and the rest of the services being in runtime.  Move everything to the
libcasper package, except tests which stay in the tests package.

MFC after:	1 day
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53576
2025-11-05 00:38:07 +00:00
Kyle Evans 737edb8fb5 posix_fallocate(2): move unsupported case to EOPNOTSUPP
ZFS has since been changed to use EOPNOTSUPP instead of EINVAL, and
fusefs/nfs are following suit.  POSIX Issue 8 had also made this move,
so it makes sense for us to standardize on EOPNOTSUPP.

Note in the HISTORY section where we're diverging from our previous
versions to align with the new standard.

Reviewed by:	asomers, imp (both previous version), kib
Differential Revision:	https://reviews.freebsd.org/D53537
2025-11-04 18:30:59 -06:00
Justin Hibbits a935c2a63f kexec: Add basic kexec_load man page
Also add kexec reboot flag to the reboot man page.
2025-11-04 14:23:20 -05:00
Alfonso S. Siciliano f2d966f6c1 contrib/bsddialog: import 1.1
Add: slider dialog.
Imported to enable testing and to complete the geomman(8) utility.

Developed as part of the "Full Disk Administration Tool for FreeBSD"
project, Braulio Rivas (brauliorivas@), Google Summer of Code 2025.

Sponsored by:	Google LLC (GSoC 2025)

Merge commit '5a70558d32b9680c10ab579c7491652e0838cee4'
2025-11-03 21:18:46 +01:00
Braulio Rivas 5a70558d32 contrib/bsddialog: import 1.1
Add: slider dialog.
Imported to enable testing and to complete the geomman(8) utility.

Developed as part of the "Full Disk Administration Tool for FreeBSD"
project, Braulio Rivas (brauliorivas@), Google Summer of Code 2025.

Sponsored by:	Google LLC (GSoC 2025)
2025-11-03 21:14:09 +01:00
Rick Macklem b473bb274c pathconf.2: Document the new _PC_CASE_INSENSITIVE name
Commit d6864221d8 added support for the _PC_CASE_INSENSITIVE
name for pathconf, to indicate if case insensitive lookups
are configured.

This patch documents this new name and also updates
the description for _PC_HAS_HIDDENSYSTEM to also
include UF_ARCHIVE.

This is a content change.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D53508
2025-11-01 15:20:40 -07:00
Lexi Winter a1806e6ff3 static_libpam: Don't install pam.d.5 twice
static_libpam's Makefile includes libpam's Makefile after setting some
variables (like MAN) to empty to avoid installing the manpages twice.
After commit 031e711647, it neglected to do this for MANNODEVLINKS,
causing pam.d.5.gz to be installed twice.  This is harmless for
installworld, but breaks some things that rely on METALOG (NO_ROOT
installs) since it causes two METALOG entries to be generated for
the same file.

Fixes:	031e711647 ("packages: Install development manpages in the -dev package")
MFC after:	3 days
PR:		290708
Reported by:	emaste
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53512
2025-11-01 13:38:26 +00:00
Kristof Provost 08ed87a4a2 pf: convert DIOCRSETADDRS to netlink
The list of addresses is potentially very large. Larger than we can fit in a
single netlink request, so we indicate via the PFR_FLAG_START/PFR_FLAG_DONE
flags when we start and finish, so the kernel can work out which addresses need
to be removed.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-10-31 16:24:09 +01:00
Robert Clausecker b5dbf3de56 libc/riscv64: implement bcopy() and bzero() through memcpy() and memset()
This picks up the accelerated string functions written by
strajabot@.

Event:		Google Summer of Code 2024
MFC after:	1 month
MFC to:		stable/15
See also:	79e01e7e64
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D53248
2025-10-31 13:48:00 +01:00
Strahinja Stanišić 08af0bbc9c libc: scalar strchrnul() in RISC-V assembly
Scalar implementation of strchrnul() in RISC-V assembly and changes to the
corresponding manpage.

Performance was benchmarked on a HiFive Unmatched (SiFive HF105-001) board
using: https://github.com/clausecker/strperf

os: FreeBSD
arch: riscv
        │ strchrnul_baseline │          strchrnul_scalar           │
        │       sec/op       │   sec/op     vs base                │
Short            680.2µ ± 5%   435.3µ ± 0%  -36.01% (p=0.000 n=20)
Mid              314.7µ ± 3%   221.4µ ± 0%  -29.63% (p=0.000 n=20)
Long             152.3µ ± 0%   138.5µ ± 0%   -9.08% (p=0.000 n=20)
geomean          319.5µ        237.2µ       -25.75%

        │ strchrnul_baseline │          strchrnul_scalar          │
        │       MiB/s        │   MiB/s     vs base                │
Short             183.8 ± 5%   287.2 ± 0%  +56.27% (p=0.000 n=20)
Mid               397.3 ± 3%   564.6 ± 0%  +42.12% (p=0.000 n=20)
Long              820.5 ± 0%   902.5 ± 0%   +9.99% (p=0.000 n=20)
geomean           391.3        527.0       +34.68%

MFC after:	1 month
MFC to:		stable/15
Approved by:	markj (mentor)
Reviewed by:	fuz
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D46047
2025-10-31 13:48:00 +01:00
Strahinja Stanišić 5a52f07044 libc: scalar strnlen() in RISC-V assembly
Optimized implementation of strnlen() in RISC-V assembly

Performance was measured using strperf on a HiFive Unmatched (SiFive HF105-001) board.

os: FreeBSD
arch: riscv
        │ strnlen_baseline │           strnlen_scalar            │
        │      sec/op      │   sec/op     vs base                │
Short          787.0µ ± 0%   430.9µ ± 1%  -45.24% (p=0.000 n=20)
Mid            621.6µ ± 0%   195.1µ ± 1%  -68.61% (p=0.000 n=20)
Long           569.4µ ± 1%   100.6µ ± 0%  -82.34% (p=0.000 n=20)
geomean        653.1µ        203.7µ       -68.81%

        │ strnlen_baseline │            strnlen_scalar            │
        │      MiB/s       │    MiB/s     vs base                 │
Short           158.8 ± 0%    290.1 ± 1%   +82.62% (p=0.000 n=20)
Mid             201.1 ± 0%    640.6 ± 1%  +218.59% (p=0.000 n=20)
Long            219.5 ± 1%   1242.9 ± 0%  +466.19% (p=0.000 n=20)
geomean         191.4         613.5       +220.57%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Reviewed by:	fuz, Jari Sihvola <jsihv@gmx.com>
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D46230
2025-10-31 13:47:59 +01:00
Strahinja Stanišić 25fdd86a4c libc: scalar memcpy() in RISC-V assembly
Optimized assembly implementation of memcpy() for the RISC-V architecture.
The implementation has two paths:

 - An aligned path - (dst - src) % 8 = 0, runs faster
 - An unaligned path - (dst - src) % 8 != 0, runs slower

os: FreeBSD
arch: riscv
           │ memcpy_baseline │            memcpy_scalar            │
           │     sec/op      │   sec/op     vs base                │
64Align8         851.6µ ± 1%   488.9µ ± 1%  -42.59% (p=0.000 n=12)
4kAlign8         681.5µ ± 1%   255.1µ ± 2%  -62.57% (p=0.000 n=12)
256kAlign8       273.0µ ± 2%   230.7µ ± 2%  -15.50% (p=0.000 n=12)
16mAlign8        98.07m ± 0%   95.29m ± 0%   -2.84% (p=0.000 n=12)
64UAlign         887.5µ ± 1%   531.6µ ± 1%  -40.10% (p=0.000 n=12)
4kUAlign         725.6µ ± 1%   262.2µ ± 1%  -63.87% (p=0.000 n=12)
256kUAlign       844.1µ ± 2%   322.8µ ± 0%  -61.76% (p=0.000 n=12)
16mUAlign        134.9m ± 0%   101.2m ± 0%  -24.97% (p=0.000 n=20)
geomean          2.410m        1.371m       -43.12%

           │ memcpy_baseline │            memcpy_scalar             │
           │      MiB/s      │    MiB/s     vs base                 │
64Align8          293.6 ± 1%    511.3 ± 1%   +74.18% (p=0.000 n=12)
4kAlign8          366.8 ± 1%    980.0 ± 2%  +167.15% (p=0.000 n=12)
256kAlign8        915.8 ± 2%   1083.7 ± 2%   +18.34% (p=0.000 n=12)
16mAlign8         163.1 ± 0%    167.9 ± 0%    +2.92% (p=0.000 n=12)
64UAlign          281.7 ± 1%    470.3 ± 1%   +66.94% (p=0.000 n=12)
4kUAlign          344.5 ± 1%    953.6 ± 1%  +176.77% (p=0.000 n=12)
256kUAlign        296.2 ± 2%    774.5 ± 0%  +161.49% (p=0.000 n=12)
16mUAlign         118.6 ± 0%    158.1 ± 0%   +33.28% (p=0.000 n=20)
geomean           293.4         515.8        +75.81%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Reviewed by:	fuz
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D46139
2025-10-31 13:47:59 +01:00
Strahinja Stanišić e09c1583ed libc: scalar strlen() in RISC-V assembly
Includes a scalar implementation of strlen() for the RISC-V
architecture and changes to the corresponding manpage.

Performance was benchamarked using before and after:
https://github.com/clausecker/strperf

os: FreeBSD
arch: riscv
        │ strlen_baseline │             strlen_scalar              │
        │     sec/op      │   sec/op     vs base                   │
Short        541.2µ ± 17%   401.6µ ± 0%  -25.78% (p=0.000 n=21+20)
Mid          249.6µ ±  3%   191.9µ ± 0%  -23.13% (p=0.000 n=21+20)
Long         124.6µ ±  0%   110.7µ ± 0%  -11.13% (p=0.000 n=21+20)
geomean      256.3µ         204.3µ       -20.26%

        │ strlen_baseline │              strlen_scalar               │
        │       B/s       │      B/s       vs base                   │
Short       220.3Mi ± 14%    296.8Mi ± 0%  +34.74% (p=0.000 n=21+20)
Mid         477.6Mi ±  3%    621.3Mi ± 0%  +30.09% (p=0.000 n=21+20)
Long        956.9Mi ±  0%   1076.7Mi ± 0%  +12.52% (p=0.000 n=21+20)
geomean     465.2Mi          583.4Mi       +25.40%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Reviewed by:	fuz
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D45693
2025-10-31 13:47:59 +01:00
Strahinja Stanišić 40a958d585 libc: scalar memset() in RISC-V assembly
Adds scalar implementation of memset for RISC-V
and updates the relevant manpage

os: FreeBSD
arch: riscv
        │ ./results/memset/memset_baseline │   ./results/memset/memset_scalar    │
        │              sec/op              │   sec/op     vs base                │
40                             527.5µ ± 1%   479.4µ ± 1%   -9.12% (p=0.000 n=20)
168                            254.5µ ± 1%   216.7µ ± 1%  -14.86% (p=0.000 n=20)
2k                             169.5µ ± 1%   128.4µ ± 0%  -24.24% (p=0.000 n=20)
256k                           161.2µ ± 1%   118.6µ ± 1%  -26.42% (p=0.000 n=20)
16m                            56.58m ± 0%   53.91m ± 0%   -4.72% (p=0.000 n=20)
geomean                        730.2µ        611.2µ       -16.29%

        │ ./results/memset/memset_baseline │    ./results/memset/memset_scalar     │
        │               B/s                │      B/s       vs base                │
40                            452.0Mi ± 1%    497.3Mi ± 1%  +10.04% (p=0.000 n=20)
168                           936.9Mi ± 1%   1100.4Mi ± 1%  +17.45% (p=0.000 n=20)
2k                            1.373Gi ± 1%    1.813Gi ± 0%  +32.00% (p=0.000 n=20)
256k                          1.444Gi ± 1%    1.962Gi ± 1%  +35.91% (p=0.000 n=20)
16m                           269.7Mi ± 0%    283.1Mi ± 0%   +4.96% (p=0.000 n=20)
geomean                       750.1Mi         896.1Mi       +19.47%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Reviewed by:	fuz
Sponsored by:	Google LLC (GSoc 2024)
Differential Revision:	https://reviews.freebsd.org/D45730
2025-10-31 13:47:58 +01:00
Strahinja Stanišić 563efdd3bd libc: scalar memchr() in RISC-V assembly
Added an optimized memchr() implementation in RISC-V assembly and updated
the relevant manpage.

        │ memchr_baseline │            memchr_scalar            │
        │     sec/op      │   sec/op     vs base                │
Short         636.6µ ± 1%   495.9µ ± 1%  -22.10% (p=0.000 n=20)
Mid           279.7µ ± 1%   224.1µ ± 1%  -19.87% (p=0.000 n=20)
Long          138.8µ ± 0%   124.9µ ± 0%  -10.00% (p=0.000 n=20)
geomean       291.3µ        240.3µ       -17.48%

        │ memchr_baseline │            memchr_scalar             │
        │       B/s       │     B/s       vs base                │
Short        187.3Mi ± 1%   240.4Mi ± 1%  +28.37% (p=0.000 n=20)
Mid          426.2Mi ± 1%   531.9Mi ± 1%  +24.79% (p=0.000 n=20)
Long         859.0Mi ± 0%   954.4Mi ± 0%  +11.11% (p=0.000 n=20)
geomean      409.3Mi        496.0Mi       +21.19%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Reviewed by:	fuz
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D46023
2025-10-31 13:47:58 +01:00
Strahinja Stanišić 63ff982b17 simd.7: add scalar strrchr() for RISC-V to manpage
MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:  https://reviews.freebsd.org/D47275
2025-10-31 13:47:57 +01:00
Strahinja Stanišić df21a004be libc: scalar strrchr() in RISC-V assembly
Implements strrchr in RISC-V assembly, leading to the following
improvements (performance measured on SiFive HF105-001)

os: FreeBSD
arch: riscv
        │ strrchr_baseline │             strrchr_scalar             │
        │      sec/op      │   sec/op     vs base                   │
Short          837.2µ ± 1%   574.6µ ± 1%  -31.37% (p=0.000 n=20+21)
Mid            639.7µ ± 0%   269.7µ ± 0%  -57.84% (p=0.000 n=20+21)
Long           589.1µ ± 0%   176.7µ ± 0%  -70.01% (p=0.000 n=20+21)
geomean        680.8µ        301.4µ       -55.73%

        │ strrchr_baseline │             strrchr_scalar             │
        │      MiB/s       │   MiB/s     vs base                    │
Short           149.3 ± 1%   217.6 ± 1%   +45.71% (p=0.000 n=20+21)
Mid             195.4 ± 0%   463.6 ± 0%  +137.22% (p=0.000 n=20+21)
Long            212.2 ± 0%   707.4 ± 0%  +233.40% (p=0.000 n=20+21)
geomean         183.6        414.7       +125.88%

MFC after:	1 month
MFC to:		stable/15
Approved by:	mhorne, markj (mentor)
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D47275
2025-10-31 13:47:57 +01:00
Mateusz Piotrowski 48b63e821d revoke.2: Remove mention of block special device files
Block devices are a thing of a past in FreeBSD.

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D53332
2025-10-31 13:37:45 +01:00
Alexander Ziaee 05d4858460 gshsec.8: Fix list alignment, tag spdx
MFC after:	3 days
2025-10-30 11:51:06 -04:00
Kyle Evans d617806aac libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails
We don't support CPU hotplug, but we do support cpuset(8) restrictions
on jails (including prison0, which uses cpuset 1).  The process cannot
widen its cpuset beyond its root set, so it makes sense to instead
report the number of cpus enabled there rather than the total number
in the system.

This change is effectively a nop for the majority of systems and jails
in the wild, though it does reduce the performance of this query now
that we can't take advantage of AT_NCPUS being provided in the auxinfo.

The implementation here is notably different than Linux, which would not
take cgroups into account.  They do, however, take CPU hotplug into
account, so the possibility for it to diverge from (and be lower than)
the # configured count to reflect what the process can actually be
scheduled on doesn't really diverge in semantics.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D52295
2025-10-29 11:32:30 -05:00
Kyle Evans 98edcbcce0 libutil: defer setting the MAC label until after the login class
MAC policies, like mac_biba(4), may forbid changing the login class once
a label has been applied.  For setting up the initial login context,
this isn't really expected and in-fact may break some class-based
configuration.

Defer setting the MAC label until after the login class is set, and
remove the requirement that we have a pwd entry since the label is
pulled from the login class -- we only use pwd for syslog in this path.

Patch is largely by Kevin Barry, with some modifications and this commit
message by kevans@.

PR:		177698
Reviewed by:	des, olce
MFC after:	3 days
Co-authored-by:	Kevin Barry <ta0kira gmail com>
Differential Revision:	https://reviews.freebsd.org/D53362
2025-10-28 21:37:21 -05:00
Mateusz Piotrowski cb1315c15a getvfsbyname.3 mount.8: Reference lsvfs(1)
MFC after:	3 days
Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D53411
2025-10-28 22:17:00 +01:00
Lexi Winter 924c0c60d4 zlib: Move to a new zlib package
zlib is a standalone third-party component, and deserves its own
package rather than living in runtime.  For example, this will make
future security updates less invasive.  This also means there's no
dependency on runtime for ports that just require zlib, which is
useful for service jails.

MFC after:	3 days
Reviewed by:	bapt, emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53058
2025-10-28 19:24:55 +00:00
Jose Luis Duran a943a96a50 libpfctl: Fix displaying deeply nested anchors
Set the number of rulesets (i.e., anchors) directly attached to the
anchor and its path in pfctl_get_ruleset().

While here, add a test to document this behavior.

PR:		290478
Reviewed by:	kp
Fixes:		041ce1d690 ("pfctl: recursively flush rules and tables")
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D53358
2025-10-28 11:29:19 +00:00
Ed Maste 514fff24b1 closefrom.2: Add introduction of close_range to HISTORY
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53240
2025-10-27 15:36:39 -04:00
Justin Hibbits efd00c75f4 sysent: Regen for kexec_load() 2025-10-27 10:33:50 -04:00
Konstantin Belousov 1c8d7bb4cf write.2: explain the atomicity guarantees of the writes
Also provide the pointer to the latest POSIX standard that justifies the
requirement.

Reviewed by:	emaste
Discussed with:	rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D53361
2025-10-26 19:35:31 +02:00
Kyle Evans 081218b7a2 libc: fix description issues in mac_text(3)/mac_free(3)
mac_text(3) as-written would seem to indicate that a `mac_t` should be
freed with free(3), but this isn't the case.  One can derive from
context from when the change was introduced and COMPATIBILITY that this
was intended to talk about *text in `mac_to_text`, so move the comment
there.

PR:		179832
Co-authored-by:	Priit Järv <priit cc ttu ee>
MFC after:	3 days
2025-10-26 10:13:21 -05:00
Lexi Winter 031e711647 packages: Install development manpages in the -dev package
Add a new per-group SUBPACKAGE option to bsd.man.mk.  When MANSPLITPKG
is enabled, this is forced to "-man", otherwise it defaults to empty
but can be overridden by the caller.

Use this in bsd.lib.mk to install library manpages in the -dev package
instead of the base package.  This is nearly always preferable, since
library manpages are usually in section 2 or 3 and are only relevant
to people with development packages installed.

For manpages which should be installed in the base package even for
libraries, add a new MANNODEV group in bsd.lib.mk.  Update existing
Makefiles to use this where appropriate.

MFC after:	3 days
Discussed with:	olce
Reviewed by:	olce
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52832
2025-10-26 02:26:06 +00:00
Gordon Bergling f1cb4e9962 ffs.3: Add a STANDARDS section to the manual page
The ffs() function conforms to IEEE Std 1003.1-2008 ("POSIX.1").
The ffsl() and ffsll() functions conform to IEEE Std 1003.1-2024 ("POSIX.1").

Reviewed by:	ziaee
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D53352
2025-10-25 23:37:22 +02:00
Ed Maste 2387a51af2 getrlimitusage.2: Update HISTORY section
Add 14.2, as this was cherry-picked prior to release.

Reported by:	Harald Eilertsen
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53320
2025-10-24 12:02:45 -04:00
Mateusz Piotrowski a08b38dfce gpart.8: Document one of gpart destroy diagnostic message
Reviewed by:	ziaee
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D52992
2025-10-24 16:51:07 +02:00
Robert Clausecker c1135b2b54 lib/libmd: import aarch64 md5 SIMD implementation
Reviewed by:	andrew, imp
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D45670
MFC after:	1 month
2025-10-24 12:17:11 +02:00
Robert Clausecker d92e987421 lib/libmd: import md5 amd64 kernels
Differential Revision:	https://reviews.freebsd.org/D45670
Reviewed by:	imp
Approved by:	markj (mentor)
MFC after:	1 month
2025-10-24 12:17:05 +02:00