]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 months agozfs: merge openzfs/zfs@95f71c019
Martin Matuska [Sat, 2 Sep 2023 10:32:48 +0000 (12:32 +0200)]
zfs: merge openzfs/zfs@95f71c019

Notable upstream pull request merges:
  #15018 Increase limit of redaction list by using spill block
  #15161 Make zoned/jailed zfsprops(7) make more sense
  #15216 Relax error reporting in zpool import and zpool split
  #15218 Selectable block allocators
  #15227 ZIL: Tune some assertions
  #15228 ZIL: Revert zl_lock scope reduction
  #15233 ZIL: Change ZIOs issue order

Obtained from: OpenZFS
OpenZFS commit: 95f71c019d7c3e3b728a9b05e2117ce6b09f1b87

9 months agotimerfd: convert timerfd_list_lock from sx to mtx
Mateusz Guzik [Sat, 2 Sep 2023 09:55:50 +0000 (09:55 +0000)]
timerfd: convert timerfd_list_lock from sx to mtx

There was no good reason to use the former. This should prevent some
head-scratching by an interested and qualified reader.

9 months agolocaledef: correct definition of right-parenthesis in default charmap
Kyle Evans [Sat, 2 Sep 2023 05:56:31 +0000 (00:56 -0500)]
localedef: correct definition of right-parenthesis in default charmap

It turns out that right parentheses do exist and are different than
left parentheses, so let's switch to that.

Sponsored by: Klara, Inc.

9 months agoSelectable block allocators
ednadolski-ix [Sat, 2 Sep 2023 01:00:30 +0000 (19:00 -0600)]
Selectable block allocators

ZFS historically has had several space allocators that were
dynamically selectable.  While these have been retained in
OpenZFS, only a single allocator has been statically compiled
in. This patch compiles all allocators for OpenZFS and provides
a module parameter to allow for manual selection between them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Edmund Nadolski <edmund.nadolski@ixsystems.com>
Closes #15218

9 months agoRelax error reporting in zpool import and zpool split
Umer Saleem [Sat, 2 Sep 2023 00:25:11 +0000 (05:25 +0500)]
Relax error reporting in zpool import and zpool split

For zpool import and zpool split, zpool_enable_datasets is called
to mount and share all datasets in a pool. If there is an error
while mounting or sharing any dataset in the pool, the status of
import or split is reported as failure. However, the changes do
show up in zpool list.

This commit updates the error reporting in zpool import and zpool
split path. More descriptive messages are shown to user in case
there is an error during mount or share. Errors in mount or share
do not effect the overall status of zpool import and zpool split.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15216

9 months agoLinux 6.5 compat: safe cleanup in spl_proc_fini()
Andrea Righi [Sat, 2 Sep 2023 00:21:40 +0000 (02:21 +0200)]
Linux 6.5 compat: safe cleanup in spl_proc_fini()

If we fail to create a proc entry in spl_proc_init() we may end up
calling unregister_sysctl_table() twice: one in the failure path of
spl_proc_init() and another time during spl_proc_fini().

Avoid the double call to unregister_sysctl_table() and while at it
refactor the code a bit to reduce code duplication.

This was accidentally introduced when the spl code was
updated for Linux 6.5 compatibility.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Closes #15234
Closes #15235

9 months agoZIL: Change ZIOs issue order.
Alexander Motin [Sat, 2 Sep 2023 00:14:50 +0000 (20:14 -0400)]
ZIL: Change ZIOs issue order.

In zil_lwb_write_issue(), after issuing lwb_root_zio/lwb_write_zio,
we have no right to access lwb->lwb_child_zio. If it was not there,
the first two ZIOs may have already completed and freed the lwb.
ZIOs issue in opposite order from children to parent should keep
the lwb valid till the end, since the lwb can be freed only after
lwb_root_zio completion callback.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15233

9 months agoZIL: Revert zl_lock scope reduction.
Alexander Motin [Sat, 2 Sep 2023 00:13:52 +0000 (20:13 -0400)]
ZIL: Revert zl_lock scope reduction.

While I have no reports of it, I suspect possible use-after-free
scenario when zil_commit_waiter() tries to dereference zcw_lwb
for lwb already freed by zil_sync(), while zcw_done is not set.
Extension of zl_lock scope as it was originally should block
zil_sync() from freeing the lwb, closing this race.

This reverts #14959 and couple chunks of #14841.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15228

9 months agoZIL: Tune some assertions.
Alexander Motin [Sat, 2 Sep 2023 00:13:22 +0000 (20:13 -0400)]
ZIL: Tune some assertions.

In zil_free_lwb() we should first assert lwb_state or the rest of
assertions can be misleading if it is false.

Add lwb_state assertions in zil_lwb_add_block() to make sure we are
not trying to add elements to lwb_vdev_tree after it was processed.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15227

9 months agoamd64 db_trace: Reject unaligned frame pointers
John Baldwin [Fri, 1 Sep 2023 22:55:05 +0000 (15:55 -0700)]
amd64 db_trace: Reject unaligned frame pointers

Switch to using db_addr_t to hold frame pointer values until they are
verified to be suitably aligned.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D41532

9 months agolibc: Further nit in fopen(3) man page.
Dag-Erling Smørgrav [Fri, 1 Sep 2023 22:53:27 +0000 (22:53 +0000)]
libc: Further nit in fopen(3) man page.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41687

9 months agopci_iov: Refuse to create VFs which require ARI if ARI is not available
John Baldwin [Fri, 1 Sep 2023 21:18:30 +0000 (14:18 -0700)]
pci_iov: Refuse to create VFs which require ARI if ARI is not available

If a parent downstream port doesn't support ARI, the code would try to
create VFs anyway but then all PCI config space access to those VFs
would fail.

Tested by: np
Sponsored by: Chelsio Communications

9 months agoscandir.3: Fix several typos
Trond Endrestøl [Fri, 1 Sep 2023 20:48:16 +0000 (16:48 -0400)]
scandir.3: Fix several typos

PR: 273480
Reviewed by: markj
MFC after: 1 week

9 months agolibc: Fix fmemopen(3) prototype in fopen(3) man page.
Dag-Erling Smørgrav [Fri, 1 Sep 2023 20:56:17 +0000 (20:56 +0000)]
libc: Fix fmemopen(3) prototype in fopen(3) man page.

While here, also update a mention of ANSI C.

Sponsored by: Klara, Inc.
Reviewed by: kevans, markj
Differential Revision: https://reviews.freebsd.org/D41686

9 months agopf: retire pf_krule_to_rule and pf_kpool_to_pool
Mateusz Guzik [Fri, 1 Sep 2023 18:12:41 +0000 (18:12 +0000)]
pf: retire pf_krule_to_rule and pf_kpool_to_pool

Discussed with: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

9 months agosrc.conf.5: regen
Brooks Davis [Fri, 1 Sep 2023 17:23:14 +0000 (18:23 +0100)]
src.conf.5: regen

9 months agoLIBC_MALLOC: description typo fix
Brooks Davis [Fri, 1 Sep 2023 17:19:25 +0000 (18:19 +0100)]
LIBC_MALLOC: description typo fix

Fixes: 09e32b2fddf5f673f76e2fffa415a73d99a6f309
Reported by: jrtc27

9 months agoUPDATING: typo fox
Brooks Davis [Fri, 1 Sep 2023 17:19:06 +0000 (18:19 +0100)]
UPDATING: typo fox

Fixes: 2befa269b869c810b4436b7b5fe922ac3278ee5e
Reported by: jrtc27

9 months agosrc.conf.5: regen
Brooks Davis [Fri, 1 Sep 2023 16:47:11 +0000 (17:47 +0100)]
src.conf.5: regen

9 months agoAdd INIT_ALL build option
Brooks Davis [Fri, 1 Sep 2023 16:42:52 +0000 (17:42 +0100)]
Add INIT_ALL build option

This option replaces WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO with
INIT_ALL=pattern and INIT_ALL=zero respectively.  As these are
relatively rarely used options no backwards compatibility is
implemented.

Reviewed by: emaste
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D41675

9 months agolibc: add LIBC_MALLOC option
Brooks Davis [Fri, 1 Sep 2023 16:42:39 +0000 (17:42 +0100)]
libc: add LIBC_MALLOC option

This will enable alternative mallocs to be included in the tree and
selected by setting LIBC_MALLOC.  As there is only one today (jemalloc)
this option does nothing, but we expect to add other implementations
in the future.  This will also reduce diffs to CheriBSD.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41660

9 months agoTeach make showconfig about group options
Brooks Davis [Fri, 1 Sep 2023 16:42:27 +0000 (17:42 +0100)]
Teach make showconfig about group options

Output OPT_ variables in addition to MK_ variables.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41682

9 months agomakeman: add minimal support for group options
Brooks Davis [Fri, 1 Sep 2023 16:41:59 +0000 (17:41 +0100)]
makeman: add minimal support for group options

Ignore OPT_* values in showconfig out in exising code paths and add
a new path to include descriptions for each. For now, hardcode the
description contents rather than attempting to generate it.  This runs
the risk of docs getting out of date, limits the amount of new shell
code added today while a lua rewrite is nearly ready to land.

This change requires a followup commit to enable OPT_* values in
"make showconfig" in order to actually find group options.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41681

9 months agoshare/mk: support for "single" group options
Brooks Davis [Fri, 1 Sep 2023 16:41:07 +0000 (17:41 +0100)]
share/mk: support for "single" group options

Support group options where 1 of n values will be selected (or a default
value will be used).  After processing, an OPT_FOO will be set to one
value from __FOO_OPTIONS for each FOO in __SINGLE_OPTIONS.  If the user
sets FOO that value will be used, otherwise __FOO_DEFAULT will be used.

Options that don't work an a particular system can be remapped to an
alternative using BROKEN_SINGLE_OPTIONS which can be set to a list of
3-tuples of the form:
OPTION broken_value replacement_value

This is somewhat inspired by OPTIONS_SINGLE from ports, but the
structure is quite different with a per-option variable in the style of
MK_FOO={yes,no}.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41659

9 months agoarmv8_crypto: fix recursive fpu_kern_enter call
Zachary Leaf [Thu, 31 Aug 2023 13:11:53 +0000 (14:11 +0100)]
armv8_crypto: fix recursive fpu_kern_enter call

Now armv8_crypto is using FPU_KERN_NOCTX, this results in a kernel panic
in armv8_crypto.c:armv8_crypto_cipher_setup:

    panic: recursive fpu_kern_enter while in PCB_FP_NOSAVE state

This is because in armv8_crypto.c:armv8_crypto_cipher_process,
directly after calling fpu_kern_enter() a call is made to
armv8_crypto_cipher_setup(), resulting in nested calls to
fpu_kern_enter() without the required fpu_kern_leave() in between.

Move fpu_kern_enter() in armv8_crypto_cipher_process() after the
call to armv8_crypto_cipher_setup() to resolve this.

Reviewed by: markj, andrew
Fixes: 6485286f536f ("armv8_crypto: Switch to using FPU_KERN_NOCTX")
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41671

9 months agogicv3: Add logging for when its_device_alloc fails
Andrew Turner [Wed, 23 Aug 2023 17:44:38 +0000 (18:44 +0100)]
gicv3: Add logging for when its_device_alloc fails

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41566

9 months agogicv3: Support indirect ITS tables
Andrew Turner [Tue, 22 Aug 2023 16:01:21 +0000 (17:01 +0100)]
gicv3: Support indirect ITS tables

The GICv3 ITS device supports two options for device tables. Currently
we support a single table to hold all device IDs, however when the
device ID space grows large this can be too large for the GITS_BASER
register to describe.

To handle this case, and to reduce the memory needed when this space
is sparse support the second option, the indirect table. The indirect
table is a 2 level table where the first level contains the physical
address of the second with a valid bit. The second level is an ITS
page sized table where each entry is the original entry size.

As we don't need to allocate a second level table for devices IDs that
don't exist this can reduce the allocation size.

Reviewed by: gallatin
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41555

9 months agoarm: Add a userspace physical timer check
Andrew Turner [Wed, 23 Aug 2023 12:34:09 +0000 (13:34 +0100)]
arm: Add a userspace physical timer check

We currently use the same Arm generic time in both userspace and the
kernel. As we always enable userspace access to the virtual timer we
can tell userspace to use it.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41565

9 months agojail(8): Fix mandoc warnings
Dmitry Chagin [Fri, 1 Sep 2023 08:13:46 +0000 (11:13 +0300)]
jail(8): Fix mandoc warnings

Reviewed by: gbe
Differential Revision: https://reviews.freebsd.org/D41680
MFC after: 1 week

9 months agoextattr(9): Remove a reference to a non-existent VFS_EXTATTRCTL(9)
Dmitry Chagin [Fri, 1 Sep 2023 08:13:22 +0000 (11:13 +0300)]
extattr(9): Remove a reference to a non-existent VFS_EXTATTRCTL(9)

Reviewed by: gbe
Differential Revision: https://reviews.freebsd.org/D41678
MFC after: 1 week

9 months agoextattr(9): Mention system namespace restrictions in a jail
Dmitry Chagin [Fri, 1 Sep 2023 08:12:51 +0000 (11:12 +0300)]
extattr(9): Mention system namespace restrictions in a jail

Reported by: netchild
Reviewed by: gbe
Differential revision: https://reviews.freebsd.org/D41676
MFC after: 1 week

9 months agojail: Add the ability to access system-level filesystem extended attributes
Shawn Webb [Fri, 1 Sep 2023 08:11:33 +0000 (11:11 +0300)]
jail: Add the ability to access system-level filesystem extended attributes

Prior to this commit privileged accounts in a jail could not access to the
filesystem extended attributes in the system namespace. To control access to
the system namespace in a per-jail basis add a new configuration parameter
allow.extattr which is off by default.

Reported by: zirias
Tested by: zirias
Obtained from: HardenedBSD
Reviewed by: kevans, jamie
Differential revision: https://reviews.freebsd.org/D41643
MFC after: 1 week
Relnotes: yes

9 months agolinux(4): Return ENOTSUP from xattr syscalls instead of EPERM
Dmitry Chagin [Fri, 1 Sep 2023 08:11:02 +0000 (11:11 +0300)]
linux(4): Return ENOTSUP from xattr syscalls instead of EPERM

FreeBSD does not permits manipulating extended attributes in the system
namespace by unprivileged accounts, even if account has appropriate
privileges to access filesystem object.
In Linux the system namespace is used to preserve posix acls. Some Gnu
coreutils binaries uses posix acls, eg, install, ls.  And fails if we
unexpectedly return EPERM error from xattr system calls.

In the other hands, in Linux read and write access to the system
namespace depend on the policy implemented for each filesystem, so we'll
mimics we're a filesystem that prohibits this for unpriveleged accounts.

Reported by: zirias
Tested by: zirias
MFC after: 1 week

9 months agolinux(4): Merge removexattr for future error recode
Dmitry Chagin [Fri, 1 Sep 2023 08:10:44 +0000 (11:10 +0300)]
linux(4): Merge removexattr for future error recode

Tested by: zirias
MFC after: 1 week

9 months agolinux(4): Return ENODATA from getxattr syscalls instead of EPERM
Dmitry Chagin [Fri, 1 Sep 2023 08:10:12 +0000 (11:10 +0300)]
linux(4): Return ENODATA from getxattr syscalls instead of EPERM

On Linux ENODATA mean the named attribute does not exist, or the
process has no access to this attribute.

Reported by: zirias
Tested by: zirias
MFC after: 1 week

9 months agolinux(4): Merge getxattr for future error recode
Dmitry Chagin [Fri, 1 Sep 2023 08:09:49 +0000 (11:09 +0300)]
linux(4): Merge getxattr for future error recode

Tested by: zirias
MFC after: 1 week

9 months agoarm64: initialize pcb in the TBI/PAC/etc. fault case
Kyle Evans [Fri, 1 Sep 2023 02:10:38 +0000 (21:10 -0500)]
arm64: initialize pcb in the TBI/PAC/etc. fault case

After 2c10be9e06d, we may jump to the bad_far label without `pcb` being
set, resulting in a follow-up fault as we may dereference it immediately
after the jump if td_intr_nesting_level == 0.  In this branch, it should
be safe to dereference `td` as we're not handling the special case
mentioned below of accessing it during promotion/demotion.

This seems to fix a null ptr deref I hit during my most recent pkgbase
build attempt on the Windows DevKit, though that was admittedly
encountered while we were on the way to a panic from an apparent
use-after-free in ZFS bits.

Reviewed by: andrew, markj
Fixes: 2c10be9e06d ("arm64: Handle translation faults for thread [..]")
Differential Revision: https://reviews.freebsd.org/D41677

9 months agodmu_buf_will_clone: change assertion to fix 32-bit compiler warning
Dimitry Andric [Fri, 1 Sep 2023 01:17:12 +0000 (03:17 +0200)]
dmu_buf_will_clone: change assertion to fix 32-bit compiler warning

Building module/zfs/dbuf.c for 32-bit targets can result in a warning:

In file included from
/usr/src/sys/contrib/openzfs/include/sys/zfs_context.h:97,
                 from /usr/src/sys/contrib/openzfs/module/zfs/dbuf.c:32:
/usr/src/sys/contrib/openzfs/module/zfs/dbuf.c: In function
'dmu_buf_will_clone':
/usr/src/sys/contrib/openzfs/lib/libspl/include/assert.h:116:33: error:
cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
  116 |         const uint64_t __left = (uint64_t)(LEFT);
  \
      |                                 ^
/usr/src/sys/contrib/openzfs/lib/libspl/include/assert.h:148:25: note:
in expansion of macro 'VERIFY0'
  148 | #define ASSERT0         VERIFY0
      |                         ^~~~~~~
/usr/src/sys/contrib/openzfs/module/zfs/dbuf.c:2704:9: note: in
expansion of macro 'ASSERT0'
 2704 |         ASSERT0(dbuf_find_dirty_eq(db, tx->tx_txg));
      |         ^~~~~~~

This is because dbuf_find_dirty_eq() returns a pointer, which if
pointers are 32-bit results in a warning about the cast to uint64_t.

Instead, use the ASSERT3P() macro, with == and NULL as second and third
arguments, which should work regardless of the target's bitness.

Reviewed-by: Kay Pedersen <mail@mkwg.de>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #15224

9 months agosrc.conf.5: regen
Brooks Davis [Fri, 1 Sep 2023 00:02:20 +0000 (01:02 +0100)]
src.conf.5: regen

9 months agomakeman: clarify scope of ignored option values
Brooks Davis [Thu, 31 Aug 2023 23:58:39 +0000 (00:58 +0100)]
makeman: clarify scope of ignored option values

The values of WITH_ and WITHOUT_ options are ignored, but group options
are not.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41683

9 months agorelease: remove arm/armv6 RPI-B configuration file
Glen Barber [Thu, 31 Aug 2023 23:24:38 +0000 (19:24 -0400)]
release: remove arm/armv6 RPI-B configuration file

The arm/armv6 RPI-B images are deprecated in 15 and 14.
An MFC to stable/14 will follow.

MFC after: 3 days
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

9 months agoRe-remove $FreeBSD$ inadvertantly put back into jail.8
Jamie Gritton [Thu, 31 Aug 2023 22:35:00 +0000 (15:35 -0700)]
Re-remove $FreeBSD$ inadvertantly put back into jail.8

9 months agolibipf: fix parser error message.
Dag-Erling Smørgrav [Thu, 31 Aug 2023 20:15:54 +0000 (22:15 +0200)]
libipf: fix parser error message.

MFC after: 1 week
Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D41652

9 months agolibc: fix history for strverscmp(3) and versionsort(3)
Mina Galić [Thu, 31 Aug 2023 11:50:17 +0000 (11:50 +0000)]
libc: fix history for strverscmp(3) and versionsort(3)

strverscmp(3) and versionsort(3) where first released in 13.2

PR: 273401
Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41617

9 months agomcast: fix memory leak in imf_purge()
Kristof Provost [Tue, 29 Aug 2023 09:33:17 +0000 (11:33 +0200)]
mcast: fix memory leak in imf_purge()

The IGMP code buffers packets in the imf_inm->inm_scq mbufq, but does
not clear this queue when struct in_mfilter is freed by imf_purge().
This can cause memory leaks if IGMPv3 is used.

Purge the mbufq on imf_purge().

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41629

9 months agopf: remove DIOCGETRULE and DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:17:24 +0000 (17:17 +0200)]
pf: remove DIOCGETRULE and DIOCGETSTATUS

These calls have nvlist variants that completely supersede them.
Remove the old code.

Reviewed by: mjg
MFC after: never
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41651

9 months agosnmp_pf: use libpfctl's pfctl_get_status() rather than DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:16:19 +0000 (17:16 +0200)]
snmp_pf: use libpfctl's pfctl_get_status() rather than DIOCGETSTATUS

Prefer libpfctl functions over direct access to the ioctl whenever
possible. This will allow subsequent removal of DIOCGETSTATUS (in 15) as
there already is an nvlist-based alternative.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41650

9 months agolibpfctl: implement status counter accessor functions
Kristof Provost [Tue, 29 Aug 2023 15:04:17 +0000 (17:04 +0200)]
libpfctl: implement status counter accessor functions

The new nvlist-based status call allows us to easily add new counters.
However, the libpfctl interface defines a TAILQ, so it's not quite
trivial to find the counter consumers are interested in.

Provide convenience functions to access the counters.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41649

9 months agolibpfctl: allow pfctl_free_status(NULL)
Kristof Provost [Tue, 29 Aug 2023 15:02:34 +0000 (17:02 +0200)]
libpfctl: allow pfctl_free_status(NULL)

Mimic free() and friends, and allow free()ing of NULL.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41648

9 months agopf (t)ftp-proxy: use libpfctl instead of DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:00:44 +0000 (17:00 +0200)]
pf (t)ftp-proxy: use libpfctl instead of DIOCGETSTATUS

Prefer libpfctl functions over direct access to the ioctl whenever
possible. This will allow subsequent removal of DIOCGETSTATUS (in 15) as
there already is an nvlist-based alternative.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41647

9 months agovmxnet3: do restart on VLAN changes
Kristof Provost [Thu, 31 Aug 2023 07:32:54 +0000 (09:32 +0200)]
vmxnet3: do restart on VLAN changes

At least one user reports issues with vmx interfaces after 725e4008ef,
where we default to not resetting the interface on VLAN changes. This
was on an ESXi 7.0.3 setup.

Reported by: Marcos Mendoza <mmendoza@netgate.com>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

9 months agonss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().
Dag-Erling Smørgrav [Thu, 31 Aug 2023 07:49:41 +0000 (07:49 +0000)]
nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().

These aren't really needed, since TACACS+ does not support enumeration, but providing placeholders keeps nsdispatch() from complaining that they're missing.

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

9 months agounbreak BEGEMOT-LM75-MIB.txt
Eugene Grosbein [Thu, 31 Aug 2023 02:47:57 +0000 (09:47 +0700)]
unbreak BEGEMOT-LM75-MIB.txt

The MIB has several bugs making it unusable. Fix it.

Reported-by: Eugene M. Zheganin <eugene@zhegan.in>
MFC-after: 2 weeks

9 months agoice_ddp: Update to 1.3.35.0
Eric Joyner [Tue, 22 Aug 2023 04:55:34 +0000 (21:55 -0700)]
ice_ddp: Update to 1.3.35.0

This is intended to be used with the upcoming updated ice(4) version
1.38.16-k.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation

9 months agoAdd sys.dirdeps.mk to share/mk FILES
Simon J. Gerraty [Wed, 30 Aug 2023 14:46:08 +0000 (07:46 -0700)]
Add sys.dirdeps.mk to share/mk FILES

A few recent makefiles should have been added to FILES.
Rename sys.machine.mk to local.sys.machine.mk as it is very
tree specific so does not belong in /usr/share/mk/

Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D41642

9 months agonet: Remove vlan metadata on pcp / vlan encapsulation
Zhenlei Huang [Wed, 30 Aug 2023 09:36:38 +0000 (17:36 +0800)]
net: Remove vlan metadata on pcp / vlan encapsulation

For oubound traffic, the flag M_VLANTAG is set in mbuf packet header to
indicate the underlaying interface do hardware VLAN tag insertion if
capable, otherwise the net stack will do 802.1Q encapsulation instead.

Commit 868aabb4708d introduced per-flow priority which set the priority ID
in the mbuf packet header. There's a corner case that when the driver is
disabled to do hardware VLAN tag insertion, and the net stack do 802.1Q
encapsulation, then it will result double tagged packets if the driver do
not check the enabled capability (hardware VLAN tag insertion).

Unfortunately some drivers, currently known cxgbe(4) re(4) ure(4) igc(4)
and vmx(4), have this issue. From a quick review for other interface
drivers I believe a lot more drivers have the same issue. It makes more
sense to fix in net stack than to try to change every single driver.

PR: 270736
Reviewed by: kp
Fixes: 868aabb4708d Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39499

9 months agoigmp: do not upgrade IGMP version beyond net.inet.igmp.default_version
Kristof Provost [Tue, 29 Aug 2023 09:23:49 +0000 (11:23 +0200)]
igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version

IGMP requires hosts to use the lowest version they've seen on the
network. When the IGMP timers expire we take the opportunity to upgrade again.
However, we did not take the net.inet.igmp.default_version sysctl
setting into account, so we could end up switching to IGMPv3 even if the
user had requested IGMPv2 or IGMPv1 via the sysctl.

Check V_igmp_default_version before we upgrade the IGMP version.

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

9 months agolibcrypto: Switch back to the generated assembly in sys/crypto/openssl
John Baldwin [Tue, 29 Aug 2023 21:46:44 +0000 (14:46 -0700)]
libcrypto: Switch back to the generated assembly in sys/crypto/openssl

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41569

9 months agoossl: Update the generated assembly files from OpenSSL 3.0.
John Baldwin [Tue, 29 Aug 2023 21:44:15 +0000 (14:44 -0700)]
ossl: Update the generated assembly files from OpenSSL 3.0.

Tested with: cryptocheck -d ossl0 -a all -z on amd64
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41568

9 months agolibcrypto: Add buildasm and cleanasm targets
John Baldwin [Tue, 29 Aug 2023 21:39:54 +0000 (14:39 -0700)]
libcrypto: Add buildasm and cleanasm targets

These targets generate all the assembly files in sys/crypto/openssl.

Reviewed by: markj, emaste (earlier version)
Differential Revision: https://reviews.freebsd.org/D41590

9 months agolibcrypto: Refactor Makefile.asm so it can be run outside of buildenv
John Baldwin [Tue, 29 Aug 2023 21:39:36 +0000 (14:39 -0700)]
libcrypto: Refactor Makefile.asm so it can be run outside of buildenv

Currently Makefile.asm relies on the current buildenv to set CFLAGS
for i386.  The current approach also leaves various temporary *.s
files around in the current directory.  To make this a bit better:

- Instead of using CFLAGS from buildenv for i386, define the actual
  flags the perl scripts need: -DOPENSSL_IA32_SSE2 to enable SSE2.

- Change i386 to have the perl scripts write to /dev/stdout to avoid
  creating temporaries.  Previously i386 was generating the temporary
  files in the OpenSSL contrib src.

- Cleanup temporary *.s files in the all target after generating the
  real *.S files for architectures which need them.

- Remove a duplicate rule for aes-armv4.S.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41589

9 months agoMakefile.asm: Simplify variable expansions in generated headers
John Baldwin [Tue, 29 Aug 2023 21:38:27 +0000 (14:38 -0700)]
Makefile.asm: Simplify variable expansions in generated headers

The :R:S expressions removed the .pl extension only to add it back
again, so just trim them to using :T alone.

Reviewed by: Pierre Pronchery <pierre@freebsdfoundation.org>, markj, emaste
Differential Revision: https://reviews.freebsd.org/D41588

9 months agoOpenSSL: Fix handling of the "0:" label in arm-xlate.pl
Tom Cosgrove [Tue, 29 Aug 2023 21:38:11 +0000 (14:38 -0700)]
OpenSSL: Fix handling of the "0:" label in arm-xlate.pl

When $label == "0", $label is not truthy, so `if ($label)` thinks there isn't
a label. Correct this by looking at the result of the s/// command.

Verified that there are no changes in the .S files created during a normal
build, and that the "0:" labels appear in the translation given in the error
report (and they are the only difference in the before and after output).

Obtained from: OpenSSL commit 9607f5ccf285ac9988a86f95c5ad9f92b556a843

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41587

9 months agoreleng-gce: Add ZFS support to GCE image buliding and uploading
Li-Wen Hsu [Tue, 29 Aug 2023 17:41:43 +0000 (01:41 +0800)]
releng-gce: Add ZFS support to GCE image buliding and uploading

Approved by: delphij (re), gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41527

9 months agoreleng-azure: Add ZFS support to Azure image buliding and uploading
Li-Wen Hsu [Tue, 29 Aug 2023 17:40:39 +0000 (01:40 +0800)]
releng-azure: Add ZFS support to Azure image buliding and uploading

Approved by: gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41454

9 months agoreleng-azure: Use port name to install Azure CLI
Li-Wen Hsu [Tue, 29 Aug 2023 17:39:11 +0000 (01:39 +0800)]
releng-azure: Use port name to install Azure CLI

To overcome package name changing on default Python version updates.

Approved by: gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41453

9 months agox86: Introduce APIC ID limit by default on AMD hardware
Ed Maste [Fri, 18 Aug 2023 03:39:08 +0000 (23:39 -0400)]
x86: Introduce APIC ID limit by default on AMD hardware

Lack of an AMD IOMMU driver means we cannot successfully route
interrupts to APIC IDs 255 and over.  Do not add the corresponding CPUs
to the per-domain lists of CPUs to which interrupts can be assigned.

This change should be reverted (or, at least the APIC ID limit) once we
have an AMD IOMMU / interrupt remapping driver.

See also commits fa5f94140a83 ("msi: handle error from BUS_REMAP_INTR in
msi_assign_cpu") and 4258eb5a0d97 ("x86: handle domains with no CPUs
usable for intr delivery.").

Reviewed by: markj, jhb
Tested by: cperciva (earlier version)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41618

9 months agoiostat: getopt() / usage() cleanup.
Dag-Erling Smørgrav [Tue, 29 Aug 2023 17:23:23 +0000 (17:23 +0000)]
iostat: getopt() / usage() cleanup.

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

9 months agowmistat: don't restrict reading to the pid that opened the fd.
Dag-Erling Smørgrav [Tue, 29 Aug 2023 17:23:16 +0000 (17:23 +0000)]
wmistat: don't restrict reading to the pid that opened the fd.

PR: 273405
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41621

9 months agocheckstyle: fix action failures
Serapheim Dimitropoulos [Tue, 29 Aug 2023 16:12:40 +0000 (09:12 -0700)]
checkstyle: fix action failures

Reviewed-by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #15220

9 months agopf: Remove DIOCCLRSTATES and DIOCKILLSTATES
Kristof Provost [Mon, 28 Aug 2023 13:30:50 +0000 (15:30 +0200)]
pf: Remove DIOCCLRSTATES and DIOCKILLSTATES

These now have nvlist based alternatives, so remove them.

Reviewed by: mjg, Pau Amma <pauamma@gundo.com> (man page)
MFC after: never
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30056

9 months agoaesni: Push FPU sections down further
Mark Johnston [Tue, 29 Aug 2023 01:26:53 +0000 (21:26 -0400)]
aesni: Push FPU sections down further

After commit 937b4473be21 aesni_cipher_crypt() and aesni_cipher_mac()
execute in a FPU_KERN_NOCTX section, which means that they must run with
preemption disabled.  These functions handle discontiguous I/O buffers
by allocating a contiguous buffer and copying as necessary, but this
allocation cannot happen with preemption disabled.  Fix the problem by
pushing the FPU section down into aesni_cipher_crypt() and
aesni_cipher_mac().  In particular, encrypt-then-auth transforms need
not be handled with a single FPU section.

Reported by: syzbot+78258dbb02eb92157357@syzkaller.appspotmail.com
Discussed with: jhb
Fixes: 937b4473be21 ("aesni: Switch to using FPU_KERN_NOCTX.")

9 months agolibc: Fix fixed-width case in the new integer parser.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 23:38:09 +0000 (23:38 +0000)]
libc: Fix fixed-width case in the new integer parser.

Fixes: d9dc1603d6e4
Differential Revision: https://reviews.freebsd.org/D41622

9 months agospibus: Make ofw_spibus probe just a little more favored
Justin Hibbits [Mon, 28 Aug 2023 23:27:11 +0000 (19:27 -0400)]
spibus: Make ofw_spibus probe just a little more favored

With ade70a1ad(svn r332196) ofw_spibus probes at the BUS_PROBE_DEFAULT
instead of 0.  However, this races with spibus, resulting in ofw_spibus
often times losing the race and the OFW node not being referenced.  This
in turn causes child device tree nodes to not be attached.  Solve this
by returning 1 higher than spibus, just like acpi_spibus.

Sponsored by: Juniper Networks, Inc.
MFC after: 1 week

9 months agoblake2: Remove dieing flag and rw lock
John Baldwin [Mon, 28 Aug 2023 23:24:42 +0000 (16:24 -0700)]
blake2: Remove dieing flag and rw lock

crypto_unregister_all already disables new sessions and waits for
existing sessions to be destroyed before returning.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41581

9 months agoblake2: Switch to using FPU_KERN_NOCTX
John Baldwin [Mon, 28 Aug 2023 23:24:32 +0000 (16:24 -0700)]
blake2: Switch to using FPU_KERN_NOCTX

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41580

9 months agoarmv8_crypto: Remove dieing flag and rw lock
John Baldwin [Mon, 28 Aug 2023 23:23:43 +0000 (16:23 -0700)]
armv8_crypto: Remove dieing flag and rw lock

crypto_unregister_all already disables new sessions and waits for
existing sessions to be destroyed before returning.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41579

9 months agoarmv8_crypto: Switch to using FPU_KERN_NOCTX
John Baldwin [Mon, 28 Aug 2023 23:22:33 +0000 (16:22 -0700)]
armv8_crypto: Switch to using FPU_KERN_NOCTX

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41578

9 months agoaesni: Switch to using FPU_KERN_NOCTX.
John Baldwin [Mon, 28 Aug 2023 23:22:15 +0000 (16:22 -0700)]
aesni: Switch to using FPU_KERN_NOCTX.

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

9 months agoefirt_machdep.c: Trim some unused includes
John Baldwin [Mon, 28 Aug 2023 23:22:03 +0000 (16:22 -0700)]
efirt_machdep.c: Trim some unused includes

Reviewed by: imp, kib, markj
Differential Revision: https://reviews.freebsd.org/D41596

9 months agolibrt: Hoist SHLIBDIR?= so it actually works
Jessica Clarke [Mon, 28 Aug 2023 19:27:50 +0000 (20:27 +0100)]
librt: Hoist SHLIBDIR?= so it actually works

src.opts.mk includes bsd.own.mk, which sets SHLIBDIR, so having this
line after it does nothing. Hoist it like other libraries so it takes
effect.

Reported by: vishwin
Fixes: 2964804ef95c ("librt: unbreak LIB32 build")

9 months agojail: make jail(8) man page more readable and more correct
Jamie Gritton [Mon, 28 Aug 2023 18:22:36 +0000 (11:22 -0700)]
jail: make jail(8) man page more readable and more correct

The synopsis section of jail(8) is fine at showing everything that could
be on the command line, but doesn't make much sense. Add some sub-
ections for the different uses of the command.

Also fix up the paragraph about command-line parameter specification,
including removing some clearly erroneous information.

Reviewed by: dvl
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41606

9 months agoRevert "libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_ut...
Li-Wen Hsu [Mon, 28 Aug 2023 17:18:42 +0000 (01:18 +0800)]
Revert "libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test"

This reverts commit b80572fe3b3a93e0490c90901c7e5336f0210303.

This has been fixed in e2030ca246a777c50a7aacb3a35f88addded21cf.

PR: 265871

9 months agolibc: Document support for binary integers.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:34:17 +0000 (15:34 +0000)]
libc: Document support for binary integers.

Reviewed by: debdrup, emaste
Differential Revision: https://reviews.freebsd.org/D41522

9 months agolibc: Add unit tests for N2630 and possible collateral damage.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:34:05 +0000 (15:34 +0000)]
libc: Add unit tests for N2630 and possible collateral damage.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41512

9 months agolibc: Implement N2630.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:32:23 +0000 (15:32 +0000)]
libc: Implement N2630.

This adds formatted input/output of binary integer numbers to the printf(), scanf(), and strtol() families, including their wide-character counterparts.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41511

9 months agolibrt: unbreak LIB32 build
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:11:32 +0000 (15:11 +0000)]
librt: unbreak LIB32 build

Fixes: f006023b2281
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41616

9 months agogeli tests: Add a regression test for geli setkey -J
Mark Johnston [Mon, 28 Aug 2023 14:58:43 +0000 (10:58 -0400)]
geli tests: Add a regression test for geli setkey -J

Make sure that it can be used to change the passphrase of both attached
and detached providers.

PR: 254966
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 months agogeli: Fix geli setkey -J for detached providers
Arjan de Vet [Mon, 28 Aug 2023 14:54:18 +0000 (10:54 -0400)]
geli: Fix geli setkey -J for detached providers

Clear cached_passphrase before generating a new key, otherwise the
operation nonsensically tries to reuse the old passphrase.

PR: 254966
Pull Request: https://github.com/freebsd/freebsd-src/pull/780
MFC after: 1 week

9 months agolibrt: Chase 315ee00fa961, fixing boot
Cy Schubert [Mon, 28 Aug 2023 03:02:17 +0000 (20:02 -0700)]
librt: Chase 315ee00fa961, fixing boot

libzfs uses librt as a dependency. Following 315ee00fa961 systems with
a separate / and /usr will fail to load the libzfs.so library because
librt.so is not available due to the fact that /usr is not mounted yet.
Install librt in /lib making it available to libzfs.

Reported by: emaste, imp
Fixes: 315ee00fa961
Differential Revision: https://reviews.freebsd.org/D41612

9 months agonetcat: add --crlf to convert LF into CRLF
Pietro Cerutti [Thu, 17 Aug 2023 11:42:23 +0000 (11:42 +0000)]
netcat: add --crlf to convert LF into CRLF

This adds the --crlf option to netcat, which triggers translation of \n
characters into \r\n sequences in the input -> network direction.
The Linux version of nc also supports this functionality with --crlf and
-C. The OpenBSD version uses -C to specify client certificates. Our
version is too old and doesn't have it, but I avoided adding -C anyway
to ease future syncs with upstream.

Attempts to upstream the feature were unsuccessful:
https://marc.info/?t=169282068500001

Differential Revision: https://reviews.freebsd.org/D41489

9 months agomana: batch ringing RX queue doorbell on receiving packets
Wei Hu [Mon, 28 Aug 2023 09:15:16 +0000 (09:15 +0000)]
mana: batch ringing RX queue doorbell on receiving packets

It's inefficient to ring the doorbell page every time a WQE is posted to
the received queue. Excessive MMIO writes result in CPU spending more
time waiting on LOCK instructions (atomic operations), resulting in
poor scaling performance.

Move the code for ringing doorbell page to where after we have posted all
WQEs to the receive queue in mana_poll_rx_cq().

In addition, use the correct WQE count for ringing RQ doorbell.
The hardware specification specifies that WQE_COUNT should set to 0 for
the Receive Queue. Although currently the hardware doesn't enforce the
check, in the future releases it may check on this value.

Tested by: whu
MFC after: 1 week
Sponsored by: Microsoft

9 months agozfs: merge openzfs/zfs@804414aad
Martin Matuska [Sat, 26 Aug 2023 21:20:04 +0000 (23:20 +0200)]
zfs: merge openzfs/zfs@804414aad

Notable upstream pull request merges:
  #15024 Add missed DMU_PROJECTUSED_OBJECT prefetch
  #15029 Do not request data L1 buffers on scan prefetch
  #15036 FreeBSD: catch up to __FreeBSD_version 1400093
  #15039 Fix raw receive with different indirect block size
  #15047 FreeBSD: Fix build on stable/13 after 1302506
  #15049 Fix the ZFS checksum error histograms with larger record sizes
  #15052 Reduce bloat in ereport.fs.zfs.checksum events
  #15056 Avoid extra snprintf() in dsl_deadlist_merge()
  #15061 Ignore pool ashift property during vdev attachment
  #15063 Don't panic if setting vdev properties is unsupported for this vdev type
  #15067 spa_min_alloc should be GCD, not min
  #15071 Add explicit prefetches to bpobj_iterate()
  #15072 Adjust prefetch parameters
  #15076 Refactor dmu_prefetch()
  #15079 set autotrim default to 'off' everywhere
  #15080 ZIL: Fix config lock deadlock
  #15088 metaslab: tuneable to better control force ganging
  #15096 Avoid waiting in dmu_sync_late_arrival()
  #15097 BRT should return EOPNOTSUPP
  #15103 Remove zl_issuer_lock from zil_suspend()
  #15107 Remove fastwrite mechanism
  #15113 libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1
  #15122 ZIL: Second attempt to reduce scope of zl_issuer_lock
  #15129 zpool_vdev_remove() should handle EALREADY error return
  #15132 ZIL: Replay blocks without next block pointer
  #15148 zfs_clone_range should return descriptive error codes
  #15153 ZIL: Avoid dbuf_read() before dmu_sync()
  #15172 copy_file_range: fix fallback when source create on same txg
  #15180 Update outdated assertion from zio_write_compress

Obtained from: OpenZFS
OpenZFS commit: 804414aad224b432590afe3f9ec114ffb49e0f13

9 months agokqueue(9): sweep references to knlist_remove_inevent()
Robert Wing [Sat, 26 Aug 2023 19:11:50 +0000 (11:11 -0800)]
kqueue(9): sweep references to knlist_remove_inevent()

knlist_remove_inevent() gone in 9e590ff04b687e910579a5851d95cedf9eb10bfd

9 months agoIncrease limit of redaction list by using spill block
Paul Dagnelie [Sat, 26 Aug 2023 18:34:43 +0000 (11:34 -0700)]
Increase limit of redaction list by using spill block

Currently redaction bookmarks and their associated redaction lists
have a relatively low limit of 36 redaction snapshots. This is imposed
by the number of snapshot GUIDs that fit in the bonus buffer of the
redaction list object. While this is more than enough for most use
cases, there are some limited cases where larger numbers would be
useful to support.

We tweak the redaction list creation code to use a spill block if
the number of redaction snapshots is above the amount that would fit
in the bonus buffer. We also make a small change to allow spill blocks
to be use for types of data besides SA. In order to fully leverage
this logic, we also change the redaction code to use vmem_alloc, to
handle extremely large allocations if needed. Finally, small tweaks
were made to the zfs commands and the test suite.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15018

9 months agoTry to clarify wording to reduce zpool add incidents
Paul Dagnelie [Sat, 26 Aug 2023 18:30:19 +0000 (11:30 -0700)]
Try to clarify wording to reduce zpool add incidents

Try to clarify wording to reduce zpool add incidents.
Add an attach example.

Reviewed-by: Rich Ercolani <Rincebrain@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15179

9 months agoAvoid save/restoring AMX registers to avoid a SPR erratum
Rich Ercolani [Sat, 26 Aug 2023 18:25:46 +0000 (14:25 -0400)]
Avoid save/restoring AMX registers to avoid a SPR erratum

Intel SPR erratum SPR4 says that if you trip into a vmexit while
doing FPU save/restore, your AMX register state might misbehave...
and by misbehave, I mean save all zeroes incorrectly, leading to
explosions if you restore it.

Since we're not using AMX for anything, the simple way to avoid
this is to just not save/restore those when we do anything, since
we're killing preemption of any sort across our save/restores.

If we ever decide to use AMX, it's not clear that we have any
way to mitigate this, on Linux...but I am not an expert.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14989
Closes #15168

9 months agozed: update zed.d/statechange-slot_off.sh
Brian Behlendorf [Sat, 26 Aug 2023 18:22:28 +0000 (11:22 -0700)]
zed: update zed.d/statechange-slot_off.sh

The statechange-slot_off.sh zedlet which was added in #15200
needed to be installed so it's included by the packages.

Additional testing has also shown that multiple retries are
often needed for the script to operate reliably.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15210

9 months agodtsec: Support multicast receive.
Justin Hibbits [Fri, 25 Aug 2023 15:36:35 +0000 (11:36 -0400)]
dtsec: Support multicast receive.

Implemented based on the tsec(4) multicast support.  This is the minimum
required to support VLANs.  The hardware does support vlan tagging,
among other acceleration features, which will be added at a later time.

MFC after: 2 weeks

9 months agoFix MNT_IGNORE for devfs, fdescfs and nullfs
Doug Rabson [Sat, 26 Aug 2023 09:32:32 +0000 (10:32 +0100)]
Fix MNT_IGNORE for devfs, fdescfs and nullfs

The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.

The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.

MFC after: 1 week