]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 months agoRemove SVN related Git attributes
Minsoo Choo [Tue, 26 Dec 2023 17:24:59 +0000 (10:24 -0700)]
Remove SVN related Git attributes

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/938

5 months agoUpdate MAINTAINERS for Git
Minsoo Choo [Tue, 26 Dec 2023 17:26:16 +0000 (10:26 -0700)]
Update MAINTAINERS for Git

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/937

5 months agoUpdate LOCKS for Git
Minsoo Choo [Tue, 26 Dec 2023 17:26:16 +0000 (10:26 -0700)]
Update LOCKS for Git

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/937

5 months agopax: Add missing 'for' in comment.
Zhan-Wei [Tue, 26 Dec 2023 17:08:58 +0000 (10:08 -0700)]
pax: Add missing 'for' in comment.

Event: Advanced UNIX Programming Course (Fall23) at NTHU.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/941

5 months agomv: Improve comment
Zhan-Wei [Tue, 26 Dec 2023 17:15:46 +0000 (10:15 -0700)]
mv: Improve comment

Fix typo/grammar error: Use the singlar verb ending on exists.

Event: Advanced UNIX Programming Course (Fall23) at NTHU.
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/940

5 months agobluetooth: fix comment in bluetooth.device.conf
lherschi [Tue, 26 Dec 2023 17:18:54 +0000 (10:18 -0700)]
bluetooth: fix comment in bluetooth.device.conf

The default for discoverable is 'NO' not 'YES'. This now matches the man
page.

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/939

5 months agodiff(1): fix a typo
Pin-Yi Kuo [Tue, 26 Dec 2023 17:06:03 +0000 (10:06 -0700)]
diff(1): fix a typo

On the manpage of diff(1), "when" is mistyped to "wen".

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Signed-off-by: Pin-Yi Kuo <kuokuoyiyi@gapp.nthu.edu.tw>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/943

5 months agodf(1): fix a typo
Pin-Yi Kuo [Tue, 26 Dec 2023 16:37:43 +0000 (09:37 -0700)]
df(1): fix a typo

On the manpage of df(1), "according" is mistyped into "acccording"

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Signed-off-by: Pin-Yi Kuo <kuokuoyiyi@gapp.nthu.edu.tw>
Reviewed by: imp, zlei, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/944

5 months agobhyve/audio.c: avoid re-calculating the length of dev_name
rilysh [Tue, 26 Dec 2023 16:24:04 +0000 (09:24 -0700)]
bhyve/audio.c: avoid re-calculating the length of dev_name

In the function audio_init(), strlen() is being called two times,
first to get the length of dev_name and second to use in memcpy().
Creating a local variable and keeping the length avoids this
re-calculation.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/945

5 months agogvinum(8): Fix a typo
Che-Yu Chang [Tue, 26 Dec 2023 16:05:26 +0000 (09:05 -0700)]
gvinum(8): Fix a typo

On line 354, "go up from" is mistyped as "go up form".

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/951

5 months agocamcontrol(8): Fix typos
Che-Yu Chang [Tue, 26 Dec 2023 16:07:26 +0000 (09:07 -0700)]
camcontrol(8): Fix typos

On line 748, "bigger than" is mistyped as "bigger then", and on line
765, "more than" is mistyped as "more then".

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/949

5 months agoacpi_cpu: Reduce BUS_MASTER_RLD manipulations
Alexander Motin [Tue, 26 Dec 2023 02:19:28 +0000 (21:19 -0500)]
acpi_cpu: Reduce BUS_MASTER_RLD manipulations

Instead of setting and clearing BUS_MASTER_RLD register on every C3
state enter/exit, set it only once if the system supports C3 state
and we are going to "disable" bus master arbitration while in it.

This is what Linux does for the past 14 years, and for even more time
this register is not implemented in a relevant hardware.  Same time
since this is only a single bit in a bigger register, ACPI has to
do take a global lock and do read-modify-write for it, that is too
expensive, saved only by C3 not entered frequently, but enough to be
seen in idle system CPU profiles.

MFC after: 1 month

5 months agovmm: Fix handling of errors from subyte()
Mark Johnston [Tue, 26 Dec 2023 01:43:51 +0000 (20:43 -0500)]
vmm: Fix handling of errors from subyte()

subyte() returns -1 upon an error, not an errno value.

MFC after: 1 week
Fixes: e17eca327633 ("vmm: Avoid embedding cpuset_t ioctl ABIs")

5 months agocompat_freebsd4: Fix handling of errors from subyte()
Mark Johnston [Tue, 26 Dec 2023 01:43:38 +0000 (20:43 -0500)]
compat_freebsd4: Fix handling of errors from subyte()

Upon failure, subyte() returns -1, not an errno value.

MFC after: 1 week

5 months agoiscsi: Check for copyout errors in iscsi_ioctl_daemon_receive()
Mark Johnston [Tue, 26 Dec 2023 01:43:31 +0000 (20:43 -0500)]
iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive()

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43148

5 months agonmount: Ignore errors when copying out an error string
Mark Johnston [Tue, 26 Dec 2023 01:43:21 +0000 (20:43 -0500)]
nmount: Ignore errors when copying out an error string

In general we copy error strings as part of reporting an error from
lower layers, so if the copyout() fails there's nothing to do since we'd
prefer to preserve the original error.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: olce, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43147

5 months agogeom: Report copyout() errors in g_ctl_ioctl_ctl()
Mark Johnston [Tue, 26 Dec 2023 01:43:06 +0000 (20:43 -0500)]
geom: Report copyout() errors in g_ctl_ioctl_ctl()

Despite the name, req->serror is used in some cases to copy non-error
messages to userspace.  So, report errors when copying out so long as
they don't clobber an earlier error.

Reviewed by: mav, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43146

5 months agogntdev: Handle errors from suword32() in gntdev_alloc_gref()
Mark Johnston [Tue, 26 Dec 2023 01:42:58 +0000 (20:42 -0500)]
gntdev: Handle errors from suword32() in gntdev_alloc_gref()

Try to copy out output values before handling errors, and check that we
did so successfully.  In particular, it doesn't seem sensible to ignore
errors here, otherwise userspace won't have any way to refer to the
allocations.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43145

5 months agompr: Handle errors from copyout() in ioctl handlers
Mark Johnston [Tue, 26 Dec 2023 01:42:49 +0000 (20:42 -0500)]
mpr: Handle errors from copyout() in ioctl handlers

In preparation for adding a __result_use_check annotation to copyin()
and related functions, start checking for errors from copyout() in
the mpr(4) user command handler.  This should make it easier to catch
bugs.

Reviewed by: imp, asomers
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43177

5 months agomps: Handle errors from copyout() in ioctl handlers
Mark Johnston [Tue, 26 Dec 2023 01:42:33 +0000 (20:42 -0500)]
mps: Handle errors from copyout() in ioctl handlers

In preparation for adding a __result_use_check annotation to copyin()
and related functions, start checking for errors from copyout() in
the mps(4) user command handler.  This should make it easier to catch
bugs.

Reviewed by: imp, asomers
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43176

5 months agoumtx: Check for errors from suword32()
Mark Johnston [Tue, 26 Dec 2023 01:42:17 +0000 (20:42 -0500)]
umtx: Check for errors from suword32()

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43144

5 months agothread: Ignore errors when copying out during thr_exit()
Mark Johnston [Tue, 26 Dec 2023 01:42:04 +0000 (20:42 -0500)]
thread: Ignore errors when copying out during thr_exit()

It does not seem reasonable to return to userspace after calling
umtx_thread_exit().

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: olce, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43143

5 months agojail: Ignore errors from copyout() while copying the error string
Mark Johnston [Tue, 26 Dec 2023 01:41:54 +0000 (20:41 -0500)]
jail: Ignore errors from copyout() while copying the error string

Reviewed by: zlei, jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43142

5 months agosendfile: Explicitly ignore errors from copyout()
Mark Johnston [Tue, 26 Dec 2023 01:41:32 +0000 (20:41 -0500)]
sendfile: Explicitly ignore errors from copyout()

There is a documented bug in sendfile.2 which notes that sendfile(2)
does not raise an error if it fails to copy out the number of bytes
written.  Explicitly ignore the error from copyout() calls in
preparation for annotating copyout() with __result_use_check.

Reviewed by: glebius, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43129

5 months agoses: Add error checking for copyout() calls
Mark Johnston [Tue, 26 Dec 2023 01:40:33 +0000 (20:40 -0500)]
ses: Add error checking for copyout() calls

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: mav, imp, asomers
Tested by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43130

5 months agopowerpc: Avoid ignoring copyin()'s return value
Mark Johnston [Tue, 26 Dec 2023 01:40:16 +0000 (20:40 -0500)]
powerpc: Avoid ignoring copyin()'s return value

A recent change made it possible for cpu_set_upcall() to return an
error.  Do that here instead of ignoring an error from copyin().

Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43105

5 months agolinux: Check for copyout errors in linux_fixup()
Mark Johnston [Tue, 26 Dec 2023 01:40:05 +0000 (20:40 -0500)]
linux: Check for copyout errors in linux_fixup()

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: olce, dchagin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43104

5 months agothread: Add a return value to cpu_set_upcall()
Mark Johnston [Tue, 26 Dec 2023 01:39:39 +0000 (20:39 -0500)]
thread: Add a return value to cpu_set_upcall()

Some implementations copy data to userspace, an operation which can in
principle fail.  In preparation for adding a __result_use_check
annotation to copyin() and related functions, let implementations of
cpu_set_upcall() return an error, and check for errors when copying data
to user memory.

Reviewed by: kib, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43100

5 months agocompat_freebsd4: Check for errors from subyte() in freebsd4_uname()
Mark Johnston [Tue, 26 Dec 2023 01:39:21 +0000 (20:39 -0500)]
compat_freebsd4: Check for errors from subyte() in freebsd4_uname()

This is in preparation for adding a __result_use_check annotation to
copyin() and related functions.

Reviewed by: imp, kib, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43099

5 months agoocs: Check for copyin errors in the ioctl handler
Mark Johnston [Tue, 26 Dec 2023 01:38:57 +0000 (20:38 -0500)]
ocs: Check for copyin errors in the ioctl handler

If copyin() fails, the driver will blindly proceed with whatever had
been in the uninitialized DMA buffer.  This is not what we want.  Check
for copyin failures.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: ram
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43097

5 months agompi3mr: Check for copyin errors in mpi3mr_map_data_buffer_dma()
Mark Johnston [Tue, 26 Dec 2023 01:38:12 +0000 (20:38 -0500)]
mpi3mr: Check for copyin errors in mpi3mr_map_data_buffer_dma()

A failed copyin will cause the driver to use the contents of
uninitialized buffers instead, which is unlikely to be the behaviour
that we want.  Check for errors.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43098

5 months agouhid: Check for errors from copyin() in ioctl handlers
Mark Johnston [Tue, 26 Dec 2023 01:38:04 +0000 (20:38 -0500)]
uhid: Check for errors from copyin() in ioctl handlers

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by: wulf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43103

5 months agohid: Handle errors from copyin() in ioctl handlers
Mark Johnston [Tue, 26 Dec 2023 01:37:49 +0000 (20:37 -0500)]
hid: Handle errors from copyin() in ioctl handlers

If copyin() fails, the driver will proceed blindly with a zeroed buffer,
which is not what we want.  In preparation for annotating copyin() with
__result_use_check, start checking for errors.

Reviewed by: wulf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43102

5 months agofreebsd32: Report errors when copying out oldlenp in __sysctl
Mark Johnston [Tue, 26 Dec 2023 01:37:32 +0000 (20:37 -0500)]
freebsd32: Report errors when copying out oldlenp in __sysctl

This matches the native implementation's behaviour.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43101

5 months agoath: Handle errors from copyout() in ath_rate_fetch_node_stats()
Mark Johnston [Tue, 26 Dec 2023 01:35:43 +0000 (20:35 -0500)]
ath: Handle errors from copyout() in ath_rate_fetch_node_stats()

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43096

5 months agovfs_domount_update(): correct fsidcmp() usage
Andrew Gierth [Sun, 24 Dec 2023 12:04:21 +0000 (14:04 +0200)]
vfs_domount_update(): correct fsidcmp() usage

MFC after: 3 days

5 months agoiommu_gas_remove(): consolidate places where decision is made to keep the entry
Konstantin Belousov [Fri, 22 Dec 2023 22:41:19 +0000 (00:41 +0200)]
iommu_gas_remove(): consolidate places where decision is made to keep the entry

Move all flag checks into iommu_gas_remove_unmap().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu_gas: make placeholder entry at the start of the GAS zero size
Konstantin Belousov [Fri, 22 Dec 2023 22:19:05 +0000 (00:19 +0200)]
iommu_gas: make placeholder entry at the start of the GAS zero size

same as the placeholder at the end.  This is required to allow GAS to
start at zero, for integration with vmm.

Also, in iommu_gas_remove(), accept placeholders after remove op.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu: add iommu_gas_remove_locked()
Konstantin Belousov [Thu, 14 Dec 2023 02:41:31 +0000 (04:41 +0200)]
iommu: add iommu_gas_remove_locked()

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoIOMMU: add GAS map entry flag IOMMU_MAP_ENTRY_FAKE
Konstantin Belousov [Fri, 22 Dec 2023 22:39:27 +0000 (00:39 +0200)]
IOMMU: add GAS map entry flag IOMMU_MAP_ENTRY_FAKE

to allow to shut down assert in iommu_gas_cmp_entries() when used
against fake entry to search for specific place in the tree.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu_gas: zero fake on-stack map entry used in iommu_gas_remove_clip_left()
Konstantin Belousov [Sun, 24 Dec 2023 00:59:19 +0000 (02:59 +0200)]
iommu_gas: zero fake on-stack map entry used in iommu_gas_remove_clip_left()

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu_gas: print entries flags and domains if an overlap detected
Konstantin Belousov [Sat, 23 Dec 2023 23:34:16 +0000 (01:34 +0200)]
iommu_gas: print entries flags and domains if an overlap detected

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoDMAR: add knob to disable RMRR entries installation into domains
Konstantin Belousov [Sat, 23 Dec 2023 16:57:19 +0000 (18:57 +0200)]
DMAR: add knob to disable RMRR entries installation into domains

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu_gas: add ddb 'show iommu_domain' command
Konstantin Belousov [Sun, 24 Dec 2023 14:52:00 +0000 (16:52 +0200)]
iommu_gas: add ddb 'show iommu_domain' command

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu_gas_match_one(): check for underflow
Konstantin Belousov [Tue, 26 Dec 2023 00:57:00 +0000 (02:57 +0200)]
iommu_gas_match_one(): check for underflow

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agodmar(9): style, fix indent
Konstantin Belousov [Fri, 15 Dec 2023 11:24:44 +0000 (13:24 +0200)]
dmar(9): style, fix indent

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoiommu: remove leftover sys/cdefs.h includes
Konstantin Belousov [Sun, 24 Dec 2023 14:24:05 +0000 (16:24 +0200)]
iommu: remove leftover sys/cdefs.h includes

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 months agoMinimize libc++ errno-related header diffs with upstream
Dimitry Andric [Mon, 25 Dec 2023 17:18:31 +0000 (18:18 +0100)]
Minimize libc++ errno-related header diffs with upstream

In commit 88640c0e8b6f5 the new EINTEGRITY errno value was added, and
this caused us to carry a patch for upstream libc++ since that time.
Because it can cause merge conflicts when importing libc++ code from
upstream, I have submitted an upstream pull request to get most of that
patch integrated.

It turns out that we do not need the errno.h part of it at all, since
all supported FreeBSD versions define EOWNERDEAD and ENOTRECOVERABLE,
and therefore the block that juggles with ELAST values is never used in
FreeBSD. At the moment it only applies to older versions of Linux, or
possibly other platforms.

Therefore the only part that needs to stay is the definition of a enum
errc value for EINTEGRITY, and this is made optional upon EINTEGRITY
being defined, to make it suitable for upstreaming.

No functional change is intended.

MFC after: 1 week

5 months agoshare/man/man7/simd.7: document SIMD-enhanced memrchr implementation
Robert Clausecker [Wed, 6 Dec 2023 13:47:03 +0000 (08:47 -0500)]
share/man/man7/simd.7: document SIMD-enhanced memrchr implementation

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785

5 months agolib/libc/amd64/string: add memrchr() scalar, baseline implementation
Robert Clausecker [Wed, 6 Dec 2023 10:05:47 +0000 (05:05 -0500)]
lib/libc/amd64/string: add memrchr() scalar, baseline implementation

The scalar implementation is fairly simplistic and only performs
slightly better than the generic C implementation. It could be
improved by using the same algorithm as for memchr, but it would
have been a lot more complicated.

The baseline implementation is similar to timingsafe_memcmp.  It's
slightly slower than memchr() due to the more complicated main
loop, but I don't think that can be significantly improved.

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42925

5 months agolib/libc/tests/string: add memrchr unit tests
Robert Clausecker [Wed, 6 Dec 2023 09:11:40 +0000 (04:11 -0500)]
lib/libc/tests/string: add memrchr unit tests

The "values" test case is specifically crafted to detect the off-by-one
error previous discovered in the scalar strchrnul implementation.

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42925

5 months agolib/libc/string: document restrict qualification of memccpy() arguments
Robert Clausecker [Tue, 5 Dec 2023 14:03:28 +0000 (09:03 -0500)]
lib/libc/string: document restrict qualification of memccpy() arguments

POSIX.1-2004 and the upcoming C23 agree that memccpy()'s arguments
are restrict qualified and must not overlap.  In 2002, restrict
qualifiers were added to <string.h>'s declaration of the function.
Make things official and document that the arguments must not
overlap.

See also: 61b60edfd3fff20f884419f8097870c7045315c9
Approved by: kib
MFC after: 1 month
MFC to: stable/14

5 months agolib/libc/amd64/string: implement strncat() by calling strlen(), memccpy()
Robert Clausecker [Mon, 4 Dec 2023 17:32:49 +0000 (12:32 -0500)]
lib/libc/amd64/string: implement strncat() by calling strlen(), memccpy()

This picks up the accelerated implementation of memccpy().

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42902

5 months agoshare/man/man7/simd.7: document simd-enhanced memccpy, strncat
Robert Clausecker [Mon, 4 Dec 2023 17:16:50 +0000 (12:16 -0500)]
share/man/man7/simd.7: document simd-enhanced memccpy, strncat

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: HTTPS://reviews.freebsd.org/D42902

5 months agolib/libc/amd64/string: add memccpy scalar, baseline implementation
Robert Clausecker [Sat, 2 Dec 2023 12:28:05 +0000 (07:28 -0500)]
lib/libc/amd64/string: add memccpy scalar, baseline implementation

Based on the strlcpy code from D42863, this patch adds a SIMD-enhanced
implementation of memccpy for amd64. A scalar implementation calling
into memchr and memcpy to do the job is provided, too.

Please note that this code does not behave exactly the same as the C
implementation of memccpy for overlapping inputs. However, overlapping
inputs are not allowed for this function by ISO/IEC 9899:1999 and neither
has the C implementation any code to deal with the possibility. It just
proceeds byte-by-byte, which may or may not do the expected thing for
some overlaps. We do not document whether overlapping inputs are
supported in memccpy(3).

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42902

5 months agolib/libc/tests/string: add unit tests for memccpy()
Robert Clausecker [Sun, 3 Dec 2023 11:42:17 +0000 (06:42 -0500)]
lib/libc/tests/string: add unit tests for memccpy()

Adapted from the strlcpy() unit tests.

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785

5 months agoshare/man/man7/simd.7: add forgotten aarch64 string functions
Robert Clausecker [Wed, 29 Nov 2023 03:33:18 +0000 (22:33 -0500)]
share/man/man7/simd.7: add forgotten aarch64 string functions

I previously forgot to mention these as they are set up through
contrib/arm-optimized/routines/string.

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785

5 months agoshare/man/man7/simd.7: document scalar/baseline strlcpy, strlcat
Robert Clausecker [Wed, 29 Nov 2023 02:35:45 +0000 (21:35 -0500)]
share/man/man7/simd.7: document scalar/baseline strlcpy, strlcat

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42863

5 months agolib/libc/amd64/string: implement strlcat() through strlcpy()
Robert Clausecker [Wed, 29 Nov 2023 02:32:28 +0000 (21:32 -0500)]
lib/libc/amd64/string: implement strlcat() through strlcpy()

This should pick up our optimised memchr(), strlen(), and strlcpy()
when strlcat() is called.

Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42863

5 months agolib/libc/amd64/string: add strlcpy scalar, baseline implementation
Robert Clausecker [Sun, 12 Nov 2023 22:47:06 +0000 (17:47 -0500)]
lib/libc/amd64/string: add strlcpy scalar, baseline implementation

Somewhat similar to stpncpy, but different in that we need to compute
the full source length even if the buffer is shorter than the source.

strlcat is implemented as a simple wrapper around strlcpy.  The scalar
implementation of strlcpy just calls into strlen() and memcpy() to do
the job.

Perf-wise we're very close to stpncpy.  The code is slightly slower as
it needs to carry on with finding the source string length even if the
buffer ends before the string.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42863

5 months agolib/libc/tests/string: add unit test for strlcpy
Robert Clausecker [Thu, 9 Nov 2023 18:08:23 +0000 (13:08 -0500)]
lib/libc/tests/string: add unit test for strlcpy

A straightforward derivation from the stpncpy unit test.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42863

5 months agoshare/man/man7/simd.7: document SIMD-enhanced strcat
Robert Clausecker [Tue, 14 Nov 2023 18:26:21 +0000 (13:26 -0500)]
share/man/man7/simd.7: document SIMD-enhanced strcat

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42600

5 months agolib/libc/amd64/string/strcat.S: enable use of SIMD
Robert Clausecker [Tue, 14 Nov 2023 18:09:08 +0000 (13:09 -0500)]
lib/libc/amd64/string/strcat.S: enable use of SIMD

strcat has a bespoke scalar assembly implementation we
inherited from NetBSD.  While it performs well, it is
better to call into our SIMD implementations if any SIMD
features are available at all.  So do that and implement
strcat() by calling into strlen() and strcpy() if these
are available.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Reviison: https://reviews.freebsd.org/D42600

5 months agoshare/man/man7/simd.7: document simd-enhanced strncpy, stpncpy
Robert Clausecker [Thu, 9 Nov 2023 04:39:11 +0000 (23:39 -0500)]
share/man/man7/simd.7: document simd-enhanced strncpy, stpncpy

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42519

5 months agolib/libc/amd64/string: implement strncpy() by calling stpncpy()
Robert Clausecker [Thu, 9 Nov 2023 04:25:55 +0000 (23:25 -0500)]
lib/libc/amd64/string: implement strncpy() by calling stpncpy()

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42519

5 months agolib/libc/amd64/string: add stpncpy scalar, baseline implementation
Robert Clausecker [Mon, 30 Oct 2023 03:15:46 +0000 (23:15 -0400)]
lib/libc/amd64/string: add stpncpy scalar, baseline implementation

This was surprisingly annoying to get right, despite being such a simple
function.  A scalar implementation is also provided, it just calls into
our optimised memchr(), memcpy(), and memset() routines to carry out its
job.

I'm quite happy with the performance.  glibc only beats us for very long
strings, likely due to the use of AVX-512.  The scalar implementation
just calls into our optimised memchr(), memcpy(), and memset() routines,
so it has a high overhead to begin with but then performs ok for the
amount of effort that went into it.  Still beats the old C code, except
for very short strings.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42519

5 months agolib/libc/tests/string/stpncpy_test.c: extend for upcoming SSE implementation
Robert Clausecker [Sun, 5 Nov 2023 04:02:00 +0000 (00:02 -0400)]
lib/libc/tests/string/stpncpy_test.c: extend for upcoming SSE implementation

This adds additional unit tests validating the function for
All possible alignment offsets of source and destination.

Also extend the test to allow testing of an external stpncpy
implementation, which greatly simplifies the development of
custom implementations.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42519

5 months agoshare/man/man7/simd.7: document amd64 SIMD use for strsep()
Robert Clausecker [Tue, 24 Oct 2023 03:57:56 +0000 (23:57 -0400)]
share/man/man7/simd.7: document amd64 SIMD use for strsep()

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42346

5 months agolib/libc/amd64/string: implement strsep() through strcspn()
Robert Clausecker [Tue, 24 Oct 2023 03:52:01 +0000 (23:52 -0400)]
lib/libc/amd64/string: implement strsep() through strcspn()

The strsep() function is basically strcspn() with extra steps.
On amd64, we now have an optimised implementation of strcspn(),
so instead of implementing the inner loop manually, just call
into the optimised routine.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42346

5 months agoshare/man/man7/simd.7: document strrchr scalar, baseline implementation
Robert Clausecker [Thu, 12 Oct 2023 22:31:55 +0000 (18:31 -0400)]
share/man/man7/simd.7: document strrchr scalar, baseline implementation

Also mention missing rindex() entry, which is provided through
strrchr().

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42217

5 months agolib/libc/amd64/string: add strrchr scalar, baseline implementation
Robert Clausecker [Thu, 12 Oct 2023 05:37:41 +0000 (01:37 -0400)]
lib/libc/amd64/string: add strrchr scalar, baseline implementation

The baseline implementation is very straightforward, while the scalar
implementation suffers from register pressure and the need to use SWAR
techniques similar to those used for strchr().

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42217

5 months agoshare/man/man7/simd.7: document strncmp amd64 scalar, baseline implementations
Robert Clausecker [Sun, 8 Oct 2023 02:46:36 +0000 (22:46 -0400)]
share/man/man7/simd.7: document strncmp amd64 scalar, baseline implementations

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42122

5 months agolib/libc/amd64/string: add strncmp scalar, baseline implementation
Robert Clausecker [Wed, 27 Sep 2023 22:46:04 +0000 (18:46 -0400)]
lib/libc/amd64/string: add strncmp scalar, baseline implementation

The scalar implementation is fairly straightforward and merely unrolled
four times.  The baseline implementation closely follows D41971 with
appropriate extensions and extra code paths to pay attention to string
length.

Performance is quite good.  We beat both glibc (except for very long
strings, but they likely use AVX which we don't) and Bionic (except for
medium-sized aligned strings, where we are still in the same ballpark).

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42122

5 months agolib/libc/tests/string: add unit tests for strncmp(3)
Robert Clausecker [Thu, 28 Sep 2023 20:40:20 +0000 (16:40 -0400)]
lib/libc/tests/string: add unit tests for strncmp(3)

These are patterned after the previously added (D41970)
strcmp tests, but are extended to check for various length
conditions.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D42122

5 months agoshare/man/man7/simd.7: document amd64 SIMD use for strpbrk()
Robert Clausecker [Mon, 25 Sep 2023 21:45:26 +0000 (17:45 -0400)]
share/man/man7/simd.7: document amd64 SIMD use for strpbrk()

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D41980

5 months agolib/libc/amd64/string: implement strpbrk() through strcspn()
Robert Clausecker [Mon, 25 Sep 2023 21:43:12 +0000 (17:43 -0400)]
lib/libc/amd64/string: implement strpbrk() through strcspn()

This lets us use our optimised strcspn() routine for strpbrk() calls.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D41980

5 months agoshare/man/man7/simd.7: document new amd64 baseline strcmp()
Robert Clausecker [Mon, 25 Sep 2023 06:18:06 +0000 (02:18 -0400)]
share/man/man7/simd.7: document new amd64 baseline strcmp()

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D41971

5 months agolib/libc/amd64/string/strcmp.S: add baseline implementation
Robert Clausecker [Sat, 16 Sep 2023 05:29:39 +0000 (01:29 -0400)]
lib/libc/amd64/string/strcmp.S: add baseline implementation

This is the most complicated one so far.  The basic idea is to process
the bulk of the string in aligned blocks of 16 bytes such that one
string runs ahead and the other runs behind.  The string that runs ahead
is checked for NUL bytes, the one that runs behind is compared with the
corresponding chunk of the string that runs ahead.  This trades an extra
load per iteration for the very complicated block-reassembly needed in
the other implementations (bionic, glibc).  On the flip side, we need
two code paths depending on the relative alignment of the two buffers.

The initial part of the string is compared directly if it is known not
to cross a page boundary.  Otherwise, a complex slow path to avoid
crossing into unmapped memory commences.

Performance-wise we beat bionic for misaligned strings (i.e. the strings
do not share an alignment offset) and reach comparable performance for
aligned strings.  glibc is a bit better as it has a special kernel for
AVX-512, where this stuff is a bit easier to do.

Sponsored by: The FreeBSD Foundation
Tested by: developers@, exp-run
Approved by: mjg
MFC after: 1 month
MFC to: stable/14
PR: 275785
Differential Revision: https://reviews.freebsd.org/D41971

5 months agoig4: Actively use FIFO thresholds
Alexander Motin [Sun, 24 Dec 2023 23:18:11 +0000 (18:18 -0500)]
ig4: Actively use FIFO thresholds

Before every wait for FIFO interrupt set how much data/space do we
want to see there.  Previous code was not using it for receive, as
result aggregating interrupts only within processing latency.  The
new code needs only one interrupt per transfer per FIFO length.

On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces the interrupt rate per device down to 2 per sample or 16-20
per second when idle and 120-160 per second when actively touched.

MFC after: 1 month

5 months agoLinuxKPI: Constify src parameter of bitmap_copy
Vladimir Kondratyev [Sun, 24 Dec 2023 12:48:06 +0000 (15:48 +0300)]
LinuxKPI: Constify src parameter of bitmap_copy

in bitmap_from_arr32() to fix build on 32 bit archs.

Sponsored by: Serenity Cyber Security, LLC
Fixes: 5ae2e6f913fa ("LinuxKPI: Add bitmap_intersects(), bitmap_from_arr32()")
MFC after: 1 week

5 months agoLinuxKPI: Define ioread64() in linux/io.h only on 64 bit archs.
Vladimir Kondratyev [Sun, 24 Dec 2023 12:48:06 +0000 (15:48 +0300)]
LinuxKPI: Define ioread64() in linux/io.h only on 64 bit archs.

32 bit archs includes nonatomic version from linux/io-64-nonatomic-*.h

Sponsored by:   Serenity Cyber Security, LLC
Fixes: dcfc983373c3 ("LinuxKPI: Implement ioread64()")
MFC after:      1 week

5 months agoLinuxKPI: Do not use explicit context in FPU sections on powerpc64
Vladimir Kondratyev [Sun, 24 Dec 2023 12:48:06 +0000 (15:48 +0300)]
LinuxKPI: Do not use explicit context in FPU sections on powerpc64

It is not supported yet.

Sponsored by: Serenity Cyber Security, LLC
Fixes: 5a3bd281672b ("LinuxKPI: Add explicit software context to FPU sections")
MFC after: 1 week

5 months agoBump __FreeBSD_version after LinuxKPI changes.
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:01 +0000 (11:20 +0300)]
Bump __FreeBSD_version after LinuxKPI changes.

Sponsored by: Serenity Cyber Security, LLC

5 months agoLinuxKPI: Add explicit software context to FPU sections
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:01 +0000 (11:20 +0300)]
LinuxKPI: Add explicit software context to FPU sections

Amdgpu driver does a lot of memory allocations in FPU-protected sections
of code for certain display cores, e.g. for DCN30. This does not work
currently on FreeBSD as its malloc function can not be run within a
critical section. Allocate memory for FPU context to overcome such
restriction.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu (previous version), markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42822

5 months agoLinuxKPI: Add acpi_dev_present() function.
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add acpi_dev_present() function.

acpi_dev_present detects that a given ACPI device is present based on
Hardware ID, Unique ID and Hardware Revision of the device.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42823

5 months agoLinuxKPI: Add pcie_capability_clear_and_set_word() function
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add pcie_capability_clear_and_set_word() function

It does a Read-Modify-Write operation using clear and set bitmasks on
PCI Express Capability Register at pos. As certain PCI Express
Capability Registers are accessed concurrently in RMW fashion, hence
require locking which is handled transparently to the caller.

Sponsored by: Serenity CyberSecurity, LLC
Reviewed by: manu, bz
MFC after: 1 week
MFC TODO: Move pcie_cap_lock to bottom to preserve KBI compatibility
Differential Revision: https://reviews.freebsd.org/D42821

5 months agoLinuxKPI: Add x86_vendor field to struct cpuinfo_x86
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add x86_vendor field to struct cpuinfo_x86

and initialize it at linuxkpi module load.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42820

5 months agoLinuxKPI: Add linux/apple-gmux.h
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add linux/apple-gmux.h

Sponsored by: Serenity Cyber Security, LLC
Obtained from: OpenBSD
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42819

5 months agoLinuxKPI: Rename linux_list_add to __list_add() in linux/list.h
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Rename linux_list_add to __list_add() in linux/list.h

to match Linux

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42818

5 months agoLinuxKPI: Add linux/ioport.h header
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add linux/ioport.h header

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42817

5 months agoLinuxKPI: Add get_random_u64() function
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add get_random_u64() function

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42816

5 months agoLinuxKPI: Add linux/dynamic_debug.h header
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add linux/dynamic_debug.h header

Sponsored by: Serenity Cyber Security, LLC
Obtained from: OpenBSD
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42815

5 months agoLinuxKPI: Add acpi_video_backlight_use_native()
Vladimir Kondratyev [Sun, 24 Dec 2023 08:20:00 +0000 (11:20 +0300)]
LinuxKPI: Add acpi_video_backlight_use_native()

We assume that backlight (in Linux term) is always "native".

Also stub acpi_video_register_backlight()

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42814

5 months agoLinuxKPI: Add bitmap_intersects(), bitmap_from_arr32()
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add bitmap_intersects(), bitmap_from_arr32()

and bitmap_shift_right() functions to linux/bitmap.h

They perform calculation of two bitmaps intersection,
copying the contents of u32 array of bits to bitmap and
logical right shifting of the bits in a bitmap.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42812

5 months agoLinuxKPI: Add cancel_work() function.
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add cancel_work() function.

Cancel a work not waiting for it to finish.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42811

5 months agoLinuxKPI: Add write_seqcount_invalidate() and seqprop_sequence()
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add write_seqcount_invalidate() and seqprop_sequence()

functions to linux/seqlock.h

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42810

5 months agoLinuxKPI: Chase for new "name" argument of register_shrinker()
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Chase for new "name" argument of register_shrinker()

Linux uses it only if SHRINKER_DEBUG config option is enabled. Ignore it.

Sponsored by: Serenity Cyber Security, LLC
Reviewers: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42809

5 months agoLinuxKPI: Add ida_alloc_min()
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add ida_alloc_min()

ida_alloc_min() allocates an unused ID. between min and INT_MAX.

While here allow end parameter of ida_simple_get() be larger than
INT_MAX. Linux caps the value to INT_MAX.

Sponsored by: Serenity Cyber Security, LLC
Reviewers: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42806

5 months agoLinuxKPI: Add IOMEM_ERR_PTR() to linux/io.h
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add IOMEM_ERR_PTR() to linux/io.h

The function creates an error pointer.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42805

5 months agoLinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h
Vladimir Kondratyev [Sun, 24 Dec 2023 08:19:59 +0000 (11:19 +0300)]
LinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h

It is implemented like ktime_get_raw_ns() function but uses less
precise getnanouptime() call.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42804