Commit Graph

25645 Commits

Author SHA1 Message Date
Jose Luis Duran 136ff605bf libefivar: Replace BSD License with BSD+Patent License
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Note that the link above no longer exists.  The commit message was kept
verbatim.  An archive of the bug report can be found at:
https://web.archive.org/web/20240714192319/https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Obtained from:	https://github.com/tianocore/edk2/commit/9344f0921518309295da89c221d10cbead8531aa

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:25 -07:00
Jose Luis Duran 5c2ae0a209 libefivar: Add sanity check for FilePath device path
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1497

Current implementation of IsDevicePathValid() is not enough for type
of MEDIA_FILEPATH_DP, which has NULL-terminated string in the device
path. This patch add a simple NULL character check at Length position.

Note that the link above no longer exists.  The commit message was kept
verbatim.  An archived version of the bug report can be found at:
https://web.archive.org/web/20240714191428/https://bugzilla.tianocore.org/show_bug.cgi?id=1497

Add the const keyword to avoid errors/warnings about dropping a const
qualifier.

Obtained from:	https://github.com/tianocore/edk2/commit/2f7a96d6ec13b292d6f31295f3195913921173e1

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:24 -07:00
Jose Luis Duran fd606b629f libefivar: Add a checking step
Add a checking step in DevicePathUtilities.c to verify DevicePath.
https://bugzilla.tianocore.org/show_bug.cgi?id=1372

v2: Remove ASSERT() and the redundant checking step. Update related
    description.

Note that the link above no longer exists.  The commit message was kept
verbatim.  An archived version of the bug report can be found at:
https://web.archive.org/web/20240714192353/bugzilla.tianocore.org/show_bug.cgi?id=1372

Obtained from:	https://github.com/tianocore/edk2/commit/fd02394228ee1dc2378cccfde6098c461f96dd42

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:24 -07:00
Jose Luis Duran 9677ae7864 libefivar: MdePkg: Clean up source files
1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

No functional change.

Obtained from:	https://github.com/tianocore/edk2/commit/9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:24 -07:00
Jose Luis Duran 5b7b60af7b libefivar: Add and comment out unused functions
This commit introduces gratuitous white space and unused functions.
This functionality is guarded/commented out.  This change is necessary
to reduce the differences with the reference file in subsequent commits.

No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:24 -07:00
Jose Luis Duran ef191142dc libefivar: Move functions to match reference file
Move a few functions to match their locations in the reference file.
No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:24 -07:00
Jose Luis Duran b38f48d336 libefivar: Standardize #ifndef __FreeBSD__
Standardize preprocessor directives that comment out unused functions
(essentially #if 0).

No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:23 -07:00
Jose Luis Duran 0e614a4afe libefivar: Fix (some) typos
Fix typos in the files that are owned by the project.

Bring back a "duplicate word" removal (node node), which should have
been "node Node", the second "node" is not capitalized in the reference
file (yet).  We'll bring it back capitalized to avoid it from triggering
automated checking scripts and possibly reverting this change again.  A
few other typos were not fixed, as we strive to keep as close to the
reference files as possible, these fixes should be submitted to the
reference project (tianocore/edk2) in the not so distant future.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
2025-11-25 11:17:23 -07:00
Kristof Provost 238ad591da libpfctl: improve error handling
If we fail to open /dev/pf don't try to close it again. That would result in
errno getting overwritten by close(), hiding potentially useful information.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-11-25 14:50:09 +01:00
John Baldwin e928afc531 Use ZFSTOP more broadly
Reviewed by:	brooks
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D53791
2025-11-24 10:47:10 -05:00
Dag-Erling Smørgrav 961b934407 pam_krb5: Fix manual page in MIT case
* Always install the manual page as pam_krb5(8) regardless of which
  version we're using.
* Regenerate it using pod2mdoc instead of pod2man so it doesn't claim
  to be part of “User Contributed Perl Documentation”.
* Put the correct section number in the header and footer.
* Don't cross-reference non-existent pam(7) manual page.

Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D53885
2025-11-24 03:40:49 +01:00
Dimitry Andric 3289bace53 Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):"
[Driver] Enable outline atomics for FreeBSD/aarch64 (#156089)

The compiler_rt helper functions have been built since 12.4, 13.1, 14
and anything newer.

This reverts commit bd27bd1f51.

Only some people (including the release manager, unfortunately) ran into
build issues with the previous iteration of this commit, because they
were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER
src.conf(5) setting, or because the build system determined that their
base system compiler was out of date.

The bootstrapped compiler would then enable outline atomics and compile
libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs,
it could not find the helper routines in libcompiler_rt.a.

In contrast, people who did not bootstrap the compiler never saw any
issues, because libgcc_s was built using their 'old' base system
compiler, and so libgcc_s would not contain any calls to those helper
routines.

Fix this by ensuring that libgcc_s is linked against libcompiler_rt.a
explicitly, similar to some other binaries and libraries that are built
with -nodefaultlibs.

Also, bump FREEBSD_CC_VERSION to ensure that everybody gets the updated
compiler with outline atomics enabled. (This should have been done in
the first iteration of this commit, because the error would have shown
up right away then.)

MFC after:	3 days
2025-11-23 19:40:00 +01:00
Gordon Bergling 9334fa3ef5 exit.3: Fix a typo in the manual page
- s/avaliable/available/

MFC after:	3 days
2025-11-19 15:17:40 +01:00
Gordon Bergling d76ea20f99 mpool(3): Fix a typo in statistical message
- s/cacheing/caching/

MFC after:	5 days
2025-11-19 15:16:33 +01:00
Martin Matuska 007679a138 libarchive: merge from vendor branch
libarchive 3.8.3

Important bugfixes:
 #2753 lib: Create temporary files in the target directory
 #2768 lha: Fix for an out-of-bounds buffer overrun when using
       p[H_LEVEL_OFFSET]
 #2769 7-zip: Fix a buffer overrun when reading truncated 7zip headers
 #2771 lz4 and zstd: Support both lz4 and zstd data with leading
       skippable frames

Obtained from:	libarchive
Vendor commit:	1368b08875351df8aa268237b882c8f4ceb0882d
MFC after:	1 week
2025-11-19 14:53:24 +01:00
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