]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 months agojail: add ".include" directive to jail.conf
Jamie Gritton [Wed, 7 Jun 2023 00:19:12 +0000 (17:19 -0700)]
jail: add ".include" directive to jail.conf

Jail config files can now include literal filenames and file globs.
They can not (yet) include files based on variables/parameters.

13 months agotcp: Add and update cubic module variable names
Richard Scheffenegger [Tue, 6 Jun 2023 21:03:30 +0000 (23:03 +0200)]
tcp: Add and update cubic module variable names

Prepare the cubic congestion control module to better align with
the specifications in RFC8312bis.

Rename a few cubic state variables to the variable names found in
the RFC8312bis specification. This makes the code more understandable
for someone reading the RFC and the code. It also makes the variable
naming convention more uniform. Add some variables needed subsequently.

No functional change.

Submitted By: Bhaskar Pardeshi, VMware Inc.
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D40436

13 months agotcp: make the maximum number of retransmissions tunable per VNET
Richard Scheffenegger [Tue, 6 Jun 2023 20:56:44 +0000 (22:56 +0200)]
tcp: make the maximum number of retransmissions tunable per VNET

Both Windows (TcpMaxDataRetransmissions) and Linux (tcp_retries2)
allow to restrict the maximum number of consecutive timer based
retransmissions. Add that same capability on a per-VNet basis to
FreeBSD.

Reviewed By: cc, tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D40424

13 months agolinux(4) rt_sendsig: Remove the use of caddr_t
Dmitry Chagin [Tue, 6 Jun 2023 20:01:39 +0000 (23:01 +0300)]
linux(4) rt_sendsig: Remove the use of caddr_t

Replace caddr_t by more appropriate char *.

MFC after: 2 weeks

13 months agontp: Fix build
Cy Schubert [Tue, 6 Jun 2023 13:27:05 +0000 (06:27 -0700)]
ntp: Fix build

Two files used to obtain time from reference clocks did not include
ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT.

Fixes: e6bfd18d21b2
MFC after: 3 days
X-MFC-with: e6bfd18d21b2

13 months agontp: import ntp-4.2.8p17
Cy Schubert [Tue, 6 Jun 2023 12:43:04 +0000 (05:43 -0700)]
ntp: import ntp-4.2.8p17

Fixes two small bugs including one regression.

MFC after: 3 days

Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f'

13 months agontp: import ntp-4.2.8p17
Cy Schubert [Tue, 6 Jun 2023 12:26:44 +0000 (05:26 -0700)]
ntp: import ntp-4.2.8p17

13 months agoSwitch to contigmalloc in the Hyper-V code
Andrew Turner [Mon, 22 May 2023 18:52:54 +0000 (19:52 +0100)]
Switch to contigmalloc in the Hyper-V code

In the Hyper-V drivers we need to allocate buffers shared between the
host and guest. This memory has been allocated with bus_dma, however
it doesn't use this correctly, e.g. it is missing calls to
bus_dmamap_sync. Along with this on arm64 we need this memory to be
mapped with the correct memory type that bus_dma may not use.

Switch to contigmalloc to allocate this memory as this will correctly
allocate cacheable memory.

Reviewed by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40227

13 months agopf tests: test reassembly in the slow path
Kristof Provost [Fri, 2 Jun 2023 14:42:08 +0000 (16:42 +0200)]
pf tests: test reassembly in the slow path

Ensure that 'fragment reassemble' works as expected, even in the IP
stack's slow forwarding path. (So not via ip_tryforward())

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40396

13 months agonetinet: re-read IP length after PFIL hook
Kristof Provost [Fri, 2 Jun 2023 14:38:30 +0000 (16:38 +0200)]
netinet: re-read IP length after PFIL hook

The pfil hook may modify the packet, so before we check its length (to
decide if it needs to be fragmented or not) we should re-read that
length.

This is most likely to happen when pf is reassembling packets. In that
scenario we'd receive the last fragment, which is likely to be a short
packet, pf would reassemble it (likely exceeding the interface MTU) and
then we'd transmit it without fragmenting, because we're comparing the
MTU to the length of the last fragment, not the fully reassembled
packet.

See also: https://redmine.pfsense.org/issues/14396
Reviewed by: cy
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40395

13 months agoif_epair: do not transmit packets that exceed the interface MTU
Kristof Provost [Fri, 2 Jun 2023 14:37:09 +0000 (16:37 +0200)]
if_epair: do not transmit packets that exceed the interface MTU

While if_epair has no issues doing this we should drop those packets
anyway, because it improves the fidelity of the automated tests.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40397

13 months agogve: Add PNP info to PCI attachment of gve(4) driver.
Xin LI [Tue, 6 Jun 2023 00:58:43 +0000 (17:58 -0700)]
gve: Add PNP info to PCI attachment of gve(4) driver.

Reviewed-by: imp
Differential Revision: https://reviews.freebsd.org/D40429

13 months agotcp: improve sending of TTL/hoplimit and DSCP
Michael Tuexen [Mon, 5 Jun 2023 16:43:06 +0000 (18:43 +0200)]
tcp: improve sending of TTL/hoplimit and DSCP

Ensure that a user specified value of TTL/hoplimit and DSCP is
used when sending packets.

Reviewed by: cc, rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D40423

13 months agortld: do not allow both dynamic DTV index and static TLS offset
Konstantin Belousov [Mon, 5 Jun 2023 00:54:46 +0000 (03:54 +0300)]
rtld: do not allow both dynamic DTV index and static TLS offset

If we are allocating static offset for an object with dynamic index,
return failure.  In the opposite case, if dynamic index is requested for
statically allocated TLS area, directly use the offset instead of
setting the index.

Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c
rev. 1.18.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 months agortld: rename tls_done to tls_static
Konstantin Belousov [Mon, 5 Jun 2023 00:43:55 +0000 (03:43 +0300)]
rtld: rename tls_done to tls_static

The meaning of the flag is that static TLS allocation was done.

Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c
rev. 1.18.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 months agortld_tls.h: style
Konstantin Belousov [Mon, 5 Jun 2023 01:15:31 +0000 (04:15 +0300)]
rtld_tls.h: style

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 months agoxargs: Consistently use strtonum() to parse arguments.
Dag-Erling Smørgrav [Mon, 5 Jun 2023 18:50:54 +0000 (20:50 +0200)]
xargs: Consistently use strtonum() to parse arguments.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40425

13 months agodecryptcore: Request the OpenSSL 1.1 API
Pierre Pronchery [Thu, 1 Jun 2023 19:07:23 +0000 (21:07 +0200)]
decryptcore: Request the OpenSSL 1.1 API

OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update may migrate to use the OpenSSL 3.0 APIs.

PR: 271615
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

13 months agovm_phys: Change the return type of vm_phys_unfree_page() to bool
Mark Johnston [Mon, 5 Jun 2023 14:40:15 +0000 (10:40 -0400)]
vm_phys: Change the return type of vm_phys_unfree_page() to bool

This is in keeping with the trend of removing uses of boolean_t, and the
sole caller was implicitly converting it to a "bool".

No functional change intended.

Reviewed by: dougm, alc, imp, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40401

13 months agoxargs: Fix typo in error message.
Dag-Erling Smørgrav [Mon, 5 Jun 2023 16:10:53 +0000 (18:10 +0200)]
xargs: Fix typo in error message.

MFC after: 1 week
Sponsored by: Klara, Inc.

13 months agoctags: Don't undercount lines when handling // comments.
Dag-Erling Smørgrav [Mon, 5 Jun 2023 15:53:45 +0000 (17:53 +0200)]
ctags: Don't undercount lines when handling // comments.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40374

13 months agonfsstat.1: Add a missing argument to -w
Mateusz Piotrowski [Mon, 5 Jun 2023 12:32:46 +0000 (14:32 +0200)]
nfsstat.1: Add a missing argument to -w

MFC after: 3 days
Sponsored by: Klara Inc.

13 months agoRevert "Revert "tslog: Annotate some early boot functions""
Colin Percival [Sun, 4 Jun 2023 23:01:31 +0000 (16:01 -0700)]
Revert "Revert "tslog: Annotate some early boot functions""

Now that <sys/tslog.h> is wrapped in #ifdef _KERNEL, it's safe to have
tslog annotations in files which might be built from userland (i.e. in
subr_boot.c, which is built as part of the boot loader).

This reverts commit 59588a546f55523d6fd37ab42eb08b719311d7d6.

13 months agotslog.h: Wrap in #ifdef _KERNEL
Colin Percival [Sun, 4 Jun 2023 22:59:10 +0000 (15:59 -0700)]
tslog.h: Wrap in #ifdef _KERNEL

This is not intended to be used from outside of the kernel; in
particular, the boot loader has its own version of tslog.

13 months agoEnable support for printing 8-byte integers. For some reason, most of the
Ben Harris [Fri, 7 Dec 2001 13:37:39 +0000 (13:37 +0000)]
Enable support for printing 8-byte integers.  For some reason, most of the
code for this was present, but disabled.
This is required for POSIX compliance on platforms with 8-byte longs.

Obtained-From: NetBSD
PR: 238586
Reported-By: Mohamed Akram <mohd.akram@outlook.com>
MFC after: 2 weeks

13 months agogve: Fix build on i386 and enable LINT builds.
Xin LI [Sun, 4 Jun 2023 23:35:00 +0000 (16:35 -0700)]
gve: Fix build on i386 and enable LINT builds.

Reviewed-by: imp
Differential Revision: https://reviews.freebsd.org/D40419

13 months agonfsuserd.8: Change machines to machine's
Rick Macklem [Sun, 4 Jun 2023 19:52:04 +0000 (12:52 -0700)]
nfsuserd.8: Change machines to machine's

Change machines to machine's.

Suggested by: grahamperrin
Differential Revision: https://reviews.freebsd.org/D39877

13 months agoRevert "tslog: Annotate some early boot functions"
Colin Percival [Sun, 4 Jun 2023 18:39:45 +0000 (11:39 -0700)]
Revert "tslog: Annotate some early boot functions"

The change to subr_boot.c broke the libsa build because the TSLOG
macros have their own definitions for the boot loader -- I didn't
realize that the loader code used subr_boot.c.

I'm currently testing a fix and I'll revert this revert once I'm
satisfied that everything works, but I don't want to leave the
tree broken for too long.

This reverts commit 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a.

13 months agotslog: Annotate parts of SYSINIT cpu
Colin Percival [Tue, 30 May 2023 00:29:24 +0000 (17:29 -0700)]
tslog: Annotate parts of SYSINIT cpu

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
SYSINIT cpu takes roughly 2770 us:
* 2280 us in vm_ksubmap_init
  * 535 us in kmem_malloc
    * 450 us in pmap_zero_page
  * 1720 us in pmap_growkernel
    * 1620 us in pmap_zero_page
* 80 us in bufinit
* 480 us in cpu_setregs
  * 430 us in cpu_setregs calling load_cr0

Much of this is hypervisor overhead: load_cr0 is slow because it traps
to the hypervisor, and 99% of the time in pmap_zero_page is spent when
we first touch the page, presumably due to the host Linux kernel
faulting in backing pages one by one.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40327

13 months agotslog: Optionally instrument pmap_zero_page
Colin Percival [Mon, 29 May 2023 23:03:14 +0000 (16:03 -0700)]
tslog: Optionally instrument pmap_zero_page

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
pmap_zero_page is responsible for 4.6 ms of the 25.0 ms of boot time.
This is not in fact time spent zeroing pages though; almost all of
that time is spent in a first-touch penalty, presumably due to the
host Linux kernel faulting in backing pages one by one.

There's probably a way to improve that by teaching Firecracker to
fault in all the VM's pages from the start rather than having them
faulted in one at a time, but that's outside of FreeBSD's control.

This commit adds a TSLOG_PAGEZERO option which enables TSLOG on the
amd64 pmap_zero_page function; it's a separate option (turned off
by default even if TSLOG is enabled) since zeroing pages happens
enough that it can easily fill the TSLOG buffer and prevent other
timing information from being recorded.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40326

13 months agotslog: Annotate some early boot functions
Colin Percival [Mon, 22 May 2023 09:54:04 +0000 (02:54 -0700)]
tslog: Annotate some early boot functions

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
hammer_time takes roughly 2740 us:
* 55 us in xen_pvh_parse_preload_data
  * 20 us in boot_parse_cmdline_delim
  * 20 us in boot_env_to_howto
* 15 us in identify_hypervisor
* 1320 us in link_elf_reloc
  * 1310 us in relocate_file1 handling ef->rela
* 25 us in init_param1
* 30 us in dpcpu_init
* 355 us in initializecpu
  * 255 us in initializecpu calling load_cr4
* 425 us in getmemsize
  * 280 us in pmap_bootstrap
    * 205 us in create_pagetables
* 10 us in init_param2
* 25 us in pci_early_quirks
* 60 us in cninit
* 90 us in kdb_init
* 105 us in msgbufinit
* 20 us in fpuinit
* 205 us elsewhere in hammer_time

Some of these are unavoidable (e.g. identify_hypervisor uses CPUID and
load_cr4 loads the CR4 register, both of which trap to the hypervisor)
but others may deserve attention.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40325

13 months agotslog: Handle curthread equal to NULL
Colin Percival [Sun, 21 May 2023 20:03:33 +0000 (13:03 -0700)]
tslog: Handle curthread equal to NULL

Early in the kernel boot, curthread goes through three stages:

1. Kernel crash when you try to access it, because PCPU doesn't exist.
2. NULL, because PCU exists but isn't initialized.
3. &thread0, which is where most of the kernel boot process runs.

This broke TSLOG from inside hammer_time since the scripts which parse
logged records didn't understand that NULL meant &thread0.

Tell tslog to record &thread0 as the active thread if passed NULL.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40324

13 months agoossl: Provide a fallback definition of __uint128_t when needed
Mark Johnston [Fri, 2 Jun 2023 22:18:05 +0000 (18:18 -0400)]
ossl: Provide a fallback definition of __uint128_t when needed

This is required on i386.  The patch has no functional change, since
AES-GCM isn't implemented for that platform.

Fixes: 9a3444d91c70 ("ossl: Add a VAES-based AES-GCM implementation for amd64")
Reported by: Jenkins

13 months agoxregs_sig: Add avx registers to test
Dmitry Chagin [Sun, 4 Jun 2023 09:07:02 +0000 (12:07 +0300)]
xregs_sig: Add avx registers to test

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40384

13 months agoxregs_sig: Add a ability to handle multiple register banks
Dmitry Chagin [Sun, 4 Jun 2023 09:06:25 +0000 (12:06 +0300)]
xregs_sig: Add a ability to handle multiple register banks

While here replace the .global directive by traditionally used .globl.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40410

13 months agojail: Use re-entrant versions of lex & yacc, and lex's yylineno
Jamie Gritton [Sun, 4 Jun 2023 03:07:09 +0000 (20:07 -0700)]
jail: Use re-entrant versions of lex & yacc, and lex's yylineno

13 months agojail: Allow nested jail definitions.
Jamie Gritton [Sun, 4 Jun 2023 00:45:54 +0000 (17:45 -0700)]
jail: Allow nested jail definitions.

Make the jail.conf specification recursive, with jail definitions
allowed within a jail's parameter list, just as they are allowed
at the top level.  Such inner jails are part of the outer jail's
hierarchy, as if they were specified with hierarchical names.

13 months agosh(1): initialize smark to zero in main()
Daniel Kolesa [Sat, 3 Jun 2023 21:08:56 +0000 (23:08 +0200)]
sh(1): initialize smark to zero in main()

As popstackmark may be called on this without pushstackmark having
been called, we need to initialize it so that we don't get a bogus
comparison inside popstackmark, which would have resulted in a
NULL pointer dereference.

MFC After: 3 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40413

13 months agokinst: fix kinst_probe_md field indentation
Christos Margiolis [Sat, 3 Jun 2023 20:03:14 +0000 (23:03 +0300)]
kinst: fix kinst_probe_md field indentation

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40411

13 months agokinst: use bool where appropriate
Christos Margiolis [Sat, 3 Jun 2023 20:02:53 +0000 (23:02 +0300)]
kinst: use bool where appropriate

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40412

13 months agoxregs_sig: Simplify Makefile by using MACHINE_CPUARCH in SRCS
Dmitry Chagin [Sat, 3 Jun 2023 17:13:23 +0000 (20:13 +0300)]
xregs_sig: Simplify Makefile by using MACHINE_CPUARCH in SRCS

Reviewed by: kib, jhb
Differential Revision: https://reviews.freebsd.org/D40383

13 months agoxregs_sig: Finish renaming simd to xregs before adding avx
Dmitry Chagin [Sat, 3 Jun 2023 17:11:44 +0000 (20:11 +0300)]
xregs_sig: Finish renaming simd to xregs before adding avx

Reviewed by: kib, jhb
Differential Revision: https://reviews.freebsd.org/D40382

13 months agoavx_sig: Better naming as the test will include more register banks
Dmitry Chagin [Sat, 3 Jun 2023 17:10:49 +0000 (20:10 +0300)]
avx_sig: Better naming as the test will include more register banks

Reviewed by: jhb, kib (early revision)
Differential Revision: https://reviews.freebsd.org/D40381

13 months agokinst: simplify trampoline fill definitions
Christos Margiolis [Sat, 3 Jun 2023 17:04:57 +0000 (20:04 +0300)]
kinst: simplify trampoline fill definitions

Centralize KINST_TRAMP_FILL_PATTERN and KINST_TRAMP_FILL_SIZE to reduce
redefinitions, and use the architecture-dependent kinst_patchval_t as
their size.

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40406

13 months agofbt: simplify arm64 function-prologue parsing
Christos Margiolis [Sat, 3 Jun 2023 17:04:33 +0000 (20:04 +0300)]
fbt: simplify arm64 function-prologue parsing

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40364

13 months agodtrace: deduplicate arm64 breakpoint definition
Christos Margiolis [Sat, 3 Jun 2023 17:04:10 +0000 (20:04 +0300)]
dtrace: deduplicate arm64 breakpoint definition

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40363

13 months agopf: Fix tests broken by enabling inet-local filtering
Doug Rabson [Fri, 2 Jun 2023 15:58:33 +0000 (16:58 +0100)]
pf: Fix tests broken by enabling inet-local filtering

Summary:
Three of the pf dummynet tests were using filter rules which matched
both the intended epair interface as well as lo0 which now receives
PFIL_OUT events for messages delivered to the local network stack (if
enabled). This commit changes the rules to match only for the expected
epair interface.

PR:             268717
Reviewed-by: kp
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40393

13 months agodd(1): neutralize SIGINT while non-async-signal safe code is executing
Konstantin Belousov [Fri, 26 May 2023 10:27:02 +0000 (13:27 +0300)]
dd(1): neutralize SIGINT while non-async-signal safe code is executing

making the SIGINT handler (the terminate() function) safe to execute at
any interruption moment.  This fixes a race in
5807f35c541c26bbd91a3ae12506cd8dd8f20688 where SIGINT delivered right
after the check_terminate() but before a blocking syscall would not
cause abort.

Do it by setting the in_io flag around potentially blocking io syscalls.
If handler sees the flag, it terminates the program.  Otherwise,
termination is delegated to the before_io/after_io fences.

Reviewed by: Andrew Gierth <andrew@tao146.riddles.org.uk>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40281

13 months agoAdd gve, the driver for Google Virtual NIC (gVNIC)
Shailend Chand [Fri, 2 Jun 2023 18:58:24 +0000 (11:58 -0700)]
Add gve, the driver for Google Virtual NIC (gVNIC)

gVNIC is a virtual network interface designed specifically for
Google Compute Engine (GCE). It is required to support per-VM Tier_1
networking performance, and for using certain VM shapes on GCE.

The NIC supports TSO, Rx and Tx checksum offloads, and RSS.
It does not currently do hardware LRO, and thus the software-LRO
in the host is used instead. It also supports jumbo frames.

For each queue, the driver negotiates a set of pages with the NIC to
serve as a fixed bounce buffer, this precludes the use of iflib.

Reviewed-by: markj
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D39873

13 months agorc(8): document how to reload rc's configuration
Mina Galić [Fri, 2 Jun 2023 18:01:03 +0000 (19:01 +0100)]
rc(8): document how to reload rc's configuration

The fact that rc(8) only reads its configuration once is in the man
page, but how to trigger a reload is only in the code.

Discovered while trying to make cloud-init disable and stop syslogd.

Thanks to RhodiumToad for providing the words.

Reviewed by:           debdrup, grahamperrin
Approved by:           grahamperrin, imp
MFC after:             1 week
Sponsored by:          The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D40329

13 months agoossl: Compile newly added files into the kernel if so requested
Mark Johnston [Fri, 2 Jun 2023 17:35:44 +0000 (13:35 -0400)]
ossl: Compile newly added files into the kernel if so requested

Fixes: 9a3444d91c70 ("ossl: Add a VAES-based AES-GCM implementation for amd64")
Fixes: 9b1d87286c78 ("ossl: Add a fallback AES-GCM implementation using AES-NI")

13 months agoipsec: Make algorithm tables read-only
Mark Johnston [Fri, 2 Jun 2023 17:22:56 +0000 (13:22 -0400)]
ipsec: Make algorithm tables read-only

No functional change intended.

MFC after: 1 week

13 months agox86: Mark the CPU idle function table as const
Mark Johnston [Fri, 2 Jun 2023 17:22:32 +0000 (13:22 -0400)]
x86: Mark the CPU idle function table as const

No functional change intended.

MFC after: 1 week

13 months agokevent: Make references to filter definitions const
Mark Johnston [Fri, 2 Jun 2023 17:14:13 +0000 (13:14 -0400)]
kevent: Make references to filter definitions const

Follow-up revisions can make individual filter definitions const.  No
functional change intended.

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

13 months ago<sys/memrange.h>: Include <sys/ioccom.h>.
John Baldwin [Fri, 2 Jun 2023 17:40:46 +0000 (10:40 -0700)]
<sys/memrange.h>: Include <sys/ioccom.h>.

This makes this header more self-contained.

Reviewed by: imp, markj
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D40387

13 months agoFix panic in nfs bootp/diskless after 0785c323f3.
Alexander Motin [Fri, 2 Jun 2023 16:53:08 +0000 (12:53 -0400)]
Fix panic in nfs bootp/diskless after 0785c323f3.

If there is no interface, count won't be initialized, while cnt is
not even relevant. Check ifp, that really matters, and delete count.

13 months agonproc.1: Fix "first appeared in" details
Mateusz Piotrowski [Fri, 2 Jun 2023 16:49:36 +0000 (18:49 +0200)]
nproc.1: Fix "first appeared in" details

nproc(1) has been MFC'ed into 13-STABLE and made it into 13.2-RELEASE.

MFC after: 3 days

13 months agonlsysevent: Fix the EXPORT_SYMS definition
Mark Johnston [Fri, 2 Jun 2023 16:11:27 +0000 (12:11 -0400)]
nlsysevent: Fix the EXPORT_SYMS definition

EXPORT_SYMS=YES has a special meaning, EXPORT_SYMS=yes does not.

Fixes: 8a2af0b469b6 ("nlsysevent: add a genetlink(4) module to report kernel events")

13 months agoossl: Add a fallback AES-GCM implementation using AES-NI
Mark Johnston [Fri, 2 Jun 2023 16:01:41 +0000 (12:01 -0400)]
ossl: Add a fallback AES-GCM implementation using AES-NI

This lets one use ossl(4) for AES-GCM operations on contemporary amd64
platforms.  A kernel benchmark indicates that this gives roughly
equivalent throughput to aesni(4) for various buffer sizes.

Bulk processing is done in aesni-gcm-x86_64.S, the rest is handled in a
C wrapper ported from OpenSSL's gcm128.c.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Reviewed by: jhb
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39967

13 months agoossl: Add a VAES-based AES-GCM implementation for amd64
Mark Johnston [Fri, 2 Jun 2023 15:58:29 +0000 (11:58 -0400)]
ossl: Add a VAES-based AES-GCM implementation for amd64

aes-gcm-avx512.S is generated from OpenSSL 3.1 and implements AES-GCM.
ossl_x86.c detects whether the CPU implements the required AVX512
instructions; if not, the ossl(4) module does not provide an AES-GCM
implementation.  The VAES implementation increases throughput for all
buffer sizes in both directions, up to 2x for sufficiently large
buffers.

The "process" implementation is in two parts: a generic OCF layer in
ossl_aes.c that calls a set of MD functions to do the heavy lifting.
The intent there is to make it possible to add other implementations for
other platforms, e.g., to reduce the diff required for D37421.

A follow-up commit will add a fallback path to legacy AES-NI, so that
ossl(4) can be used in preference to aesni(4) on all amd64 platforms.
In the long term we would like to replace aesni(4) and armv8crypto(4)
with ossl(4).

Note, currently this implementation will not be selected by default
since aesni(4) and ossl(4) return the same probe priority for crypto
sessions, and the opencrypto framework selects the first registered
implementation to break a tie.  Since aesni(4) is compiled into the
kernel, aesni(4) wins.  A separate change may modify ossl(4) to have
priority.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Reviewed by: jhb
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39783

13 months agoossl: Expose more CPUID bits in OPENSSL_ia32cap_P
Mark Johnston [Fri, 2 Jun 2023 15:57:38 +0000 (11:57 -0400)]
ossl: Expose more CPUID bits in OPENSSL_ia32cap_P

This is needed to let OpenSSL 3.1 routines detect VAES and VPCLMULQDQ
extensions.  The intent is to import ASM routines which implement
AES-GCM using VEX-prefixed AES-NI instructions.

No functional change intended.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D39782

13 months agonetlink: fix compilation withous INET6
Gleb Smirnoff [Fri, 2 Jun 2023 16:09:55 +0000 (09:09 -0700)]
netlink: fix compilation withous INET6

Fixes: a77facd27368f618520d25391cfce11149879a41

13 months agoarm64: Fix the definition of ID_AA64DFR1_EL1
Andrew Turner [Fri, 2 Jun 2023 15:23:47 +0000 (16:23 +0100)]
arm64: Fix the definition of ID_AA64DFR1_EL1

13 months agoAdd more arm64 ID registers
Andrew Turner [Fri, 2 Jun 2023 14:59:46 +0000 (15:59 +0100)]
Add more arm64 ID registers

These will be used by bhyve to emulate these registers.

Sponsored by: Arm Ltd

13 months agoarm64: Correct a pmap unlock in pmap_stage2_fault
Andrew Turner [Fri, 2 Jun 2023 09:58:56 +0000 (10:58 +0100)]
arm64: Correct a pmap unlock in pmap_stage2_fault

This is used by bhyve so was not an issue as it is still in development.
Sponsored by: Arm Ltd

13 months agopf: fix log message
Kristof Provost [Tue, 30 May 2023 19:29:24 +0000 (21:29 +0200)]
pf: fix log message

Use __func__ so we log the correct function name.

Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agopf: carry over rule actions from route-to rules
Kristof Provost [Tue, 30 May 2023 19:17:54 +0000 (21:17 +0200)]
pf: carry over rule actions from route-to rules

If we route-to (or dup-to/reply-to) we re-run pf_test(), which will also
create states for the connection.
This means that we may end up matching a different (i.e. not the state
that was created by the route-to rule) state, without the attributes
(such as dummynet pipes/queues) set by the route-to rule.

Address this by inheriting the pf_rule_actions from the route-to rule
while evaluating the connection again in pf_test(). That is, we set
default pf_rule_actions based on the route-to rule for the new
evaluation. The new rule may still overrule these, but if it does not
have such actions the route-to actions are applied.

Do the same for IPv6 rules in pf_test6()/pf_route6().

See also: https://redmine.pfsense.org/issues/14039
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40340

13 months agodumpon: Request the OpenSSL 1.1 API
Pierre Pronchery [Thu, 25 May 2023 17:09:27 +0000 (19:09 +0200)]
dumpon: Request the OpenSSL 1.1 API

OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update may migrate to use the OpenSSL 3.0 APIs.

PR: 271615
Pull request: https://github.com/freebsd/freebsd-src/pull/757
Sponsored by: The FreeBSD Foundation

13 months agonetlink: use netlink mbufs in the mbuf chains.
Alexander V. Chernikov [Fri, 2 Jun 2023 13:04:03 +0000 (13:04 +0000)]
netlink: use netlink mbufs in the mbuf chains.

Continue D40356 and switch the remaining parts of mbuf-related
code to the Netlink mbufs.

Reviewed By: gallatin
Differential Revision: https://reviews.freebsd.org/D40368
MFC after: 2 weeks

13 months agonlsysevent: add default command to the events
Baptiste Daroussin [Fri, 2 Jun 2023 12:19:17 +0000 (14:19 +0200)]
nlsysevent: add default command to the events

13 months agonlsysevent: deduplicate the code and split into smaller functions
Baptiste Daroussin [Fri, 2 Jun 2023 08:19:27 +0000 (10:19 +0200)]
nlsysevent: deduplicate the code and split into smaller functions

No functional changes intended

Suggested by: melifaro

13 months agonlsysevent: rename variables for clarity of the code
Baptiste Daroussin [Fri, 2 Jun 2023 07:58:24 +0000 (09:58 +0200)]
nlsysevent: rename variables for clarity of the code

Suggested by: melifaro

13 months agonlsysevent: specify all netlink header the same way
Baptiste Daroussin [Fri, 2 Jun 2023 07:55:42 +0000 (09:55 +0200)]
nlsysevent: specify all netlink header the same way

13 months agogpart(8): Improve manual page syntax
Tom Hukins [Fri, 2 Jun 2023 02:41:28 +0000 (20:41 -0600)]
gpart(8): Improve manual page syntax

Fix various warnings from `mandoc -Tlint lib/geom/part/gpart.8`.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agogpart(8): Refer to a related manual page
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
gpart(8): Refer to a related manual page

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocamcontrol(8): Use simpler language
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
camcontrol(8): Use simpler language

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocamcontrol(8): Add manual page cross references
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
camcontrol(8): Add manual page cross references

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agocam(3): Add a manual page cross reference
Tom Hukins [Fri, 2 Jun 2023 02:41:27 +0000 (20:41 -0600)]
cam(3): Add a manual page cross reference

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/702

13 months agoports(7): '*-list' targets: Add/fix doc on whether they are recursive
Olivier Certner [Fri, 2 Jun 2023 02:36:54 +0000 (20:36 -0600)]
ports(7): '*-list' targets: Add/fix doc on whether they are recursive

Signed-off-by: Olivier Certner <olce.freebsd@certner.fr>
Reviewed-by: imp
Pull-request: https://github.com/freebsd/freebsd-src/pull/691

13 months agomfiuitl: Spell acquire correctly
Warner Losh [Thu, 1 Jun 2023 23:49:41 +0000 (17:49 -0600)]
mfiuitl: Spell acquire correctly

13 months agozfsd: Fix typo in comment
Elyes Haouas [Fri, 3 Mar 2023 10:58:17 +0000 (11:58 +0100)]
zfsd: Fix typo in comment

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoiovctl: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:53:33 +0000 (07:53 +0100)]
iovctl: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agofstyp: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:53:13 +0000 (07:53 +0100)]
fstyp: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomfiutil: Fix typos
Elyes Haouas [Fri, 24 Feb 2023 06:52:47 +0000 (07:52 +0100)]
mfiutil: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomakefs: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:35 +0000 (17:41 -0600)]
makefs: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomld6query: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
mld6query: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoefidp: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
efidp: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocron/lib: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
cron/lib: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agofsck_ffs: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
fsck_ffs: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agomountd: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
mountd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipfw/ipfw2: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
ipfw/ipfw2: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoroute6d: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
route6d: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocdcontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
cdcontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agobsnmpd/modules/snmp_lm75: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:34 +0000 (17:41 -0600)]
bsnmpd/modules/snmp_lm75: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agorpc.lockd: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
rpc.lockd: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agowlandebug: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
wlandebug: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoipf: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
ipf: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agoifconfig: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:33 +0000 (17:41 -0600)]
ifconfig: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agocamcontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
camcontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653

13 months agonvmecontrol: Fix typos
Elyes Haouas [Thu, 1 Jun 2023 23:41:32 +0000 (17:41 -0600)]
nvmecontrol: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653