]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 months agoshare/man/man7/simd.7: document new timingsafe_bcmp(3) scalar, baseline implementations
Robert Clausecker [Thu, 31 Aug 2023 15:34:44 +0000 (15:34 +0000)]
share/man/man7/simd.7: document new timingsafe_bcmp(3) scalar, baseline implementations

Sponsored by: The FreeBSD Foundation
Approved by: security (cperciva)
Differential Revision: https://reviews.freebsd.org/D41673

8 months agolib/libc/amd64/string: add timingsafe_bcmp(3) scalar, baseline implementations
Robert Clausecker [Wed, 30 Aug 2023 15:37:26 +0000 (15:37 +0000)]
lib/libc/amd64/string: add timingsafe_bcmp(3) scalar, baseline implementations

Very straightforward and similar to memcmp(3). The code has
been written to use only instructions specified as having
data operand independent timing by Intel.

Sponsored by: The FreeBSD Foundation
Approved by: security (cperciva)
Differential Revision: https://reviews.freebsd.org/D41673

8 months agoefibootmgr: provide explicit error message if run as non-root
Ed Maste [Sun, 15 Oct 2023 17:21:52 +0000 (13:21 -0400)]
efibootmgr: provide explicit error message if run as non-root

This should be less confusing for new users.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42213

8 months agoifconfig: add static bridge addresses for vlan 0, not 1
Kristof Provost [Fri, 13 Oct 2023 10:34:06 +0000 (12:34 +0200)]
ifconfig: add static bridge addresses for vlan 0, not 1

Since fd7edfcdc3 ("bridge: fix lookup for untagged packets in
bridge_transmit()") and b0e38a1373 ("bridge: distinguish no vlan and
vlan 1") we do a better job of distinguishing between untagged and VLAN
1 traffic.

However, ifconfig still defaulted to adding addresses for VLAN 1, rather
than for untagged traffic. Change this to be the most common (i.e.
untagged) option.

Reviewed by: zlei, philip
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42188

8 months agoveriexec: Correctly export symbols
Zhenlei Huang [Sun, 15 Oct 2023 14:29:18 +0000 (22:29 +0800)]
veriexec: Correctly export symbols

There's no symbol named 'mac_veriexec_get_executable_flags', the right
one should be the function 'mac_veriexec_metadata_get_executable_flags()'.

Reviewed by: stevek
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42133

8 months agouma.h: Fix a typo in a source code comment
Gordon Bergling [Sun, 15 Oct 2023 12:09:21 +0000 (14:09 +0200)]
uma.h: Fix a typo in a source code comment

- s/setable/settable/

MFC after: 3 days

8 months agoptsname.3: accommodate upcoming POSIX Issue 8 ptsname_r
Ed Maste [Fri, 13 Oct 2023 20:25:53 +0000 (16:25 -0400)]
ptsname.3: accommodate upcoming POSIX Issue 8 ptsname_r

POSIX has accepted a proposal[1] to add glibc-compatible ptsname_r.  It
indicates an error by returning the error number, rather than returning
-1 and setting errno.  Update RETURN VALUES in ptsname_r's man page now
to encourage folks to test that the return value != 0 rather than == -1.

[1] https://www.austingroupbugs.net/bug_view_page.php?bug_id=508

Reported by: Collin Funk
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42204

8 months agoprf: add setting of msgbuftrigger in paths where it is missing
Chuck Silvers [Fri, 13 Oct 2023 22:00:34 +0000 (15:00 -0700)]
prf: add setting of msgbuftrigger in paths where it is missing

Logging things to msgbuf is supposed to set msgbuftrigger so that
syslogd will notice that there is more to read from /dev/klog,
but several paths do not do that.  Add the missing trigger.

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

8 months agoHandle MOVED_LIBS in list-old-files
Ed Maste [Fri, 13 Oct 2023 18:06:58 +0000 (14:06 -0400)]
Handle MOVED_LIBS in list-old-files

MOVED_LIBS is used when a library moves from one directory to another,
e.g. /usr/lib/libc++.so.1 to /lib/libc++.so.1.

delete-old-files and delete-old-libs are two separate steps, so that
old libraries can be retained until third party software packages are
rebuilt or reinstalled.

Having two copies of the same shared library with the same so version
(as can happen when delete-old-libs hasn't been run) causes trouble.
The PR below gives one example.

Libraries listed in MOVED_LIBS are logically equivalent to updating a
library without changing the so version, and should be removed as soon
as possible.  Handle them in list-old-files and thus delete-old-files.

Leave them also in *-old-libs for now, in case the user updates their
tree between running delete-old-files and delete-old-libs.

PR: 272642
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Co-authored-by: Dimitry Andric <dim@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D42197

8 months agoatf_python: Standardize custom sections
Jose Luis Duran [Thu, 12 Oct 2023 14:52:52 +0000 (14:52 +0000)]
atf_python: Standardize custom sections

To be replaced with pytest's section/add_report_section.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/865

8 months agoatf_python: Set verbosity for commands in a vnet
Jose Luis Duran [Thu, 12 Oct 2023 16:15:04 +0000 (16:15 +0000)]
atf_python: Set verbosity for commands in a vnet

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/865

8 months agoatf_python: vnet: Use absolute paths within helpers
Jose Luis Duran [Thu, 12 Oct 2023 15:14:44 +0000 (15:14 +0000)]
atf_python: vnet: Use absolute paths within helpers

Usually tests are run in sterile environments; however, there is a
slight chance that the PATH overrides the utilities used for testing.

Pedantically use absolute paths, even inside VNETs, to avoid ambiguity.

Chiefly, jexec -> /usr/sbin/jexec, and ifconfig -> /sbin/ifconfig.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/865

8 months agoatf_python: Actually implement verbosity for run_cmd
Jose Luis Duran [Thu, 12 Oct 2023 14:51:45 +0000 (14:51 +0000)]
atf_python: Actually implement verbosity for run_cmd

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/865

8 months agoatf_python: Do not attempt to automatically delete lo0
Jose Luis Duran [Thu, 12 Oct 2023 13:15:15 +0000 (13:15 +0000)]
atf_python: Do not attempt to automatically delete lo0

Else `ifconfig lo0 destroy` will throw an:

    ifconfig: SIOCIFDESTROY: Invalid argument

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/865

8 months agobhyve ahci: Replace WPRINTF with EPRINTLN
John Baldwin [Fri, 13 Oct 2023 19:26:58 +0000 (12:26 -0700)]
bhyve ahci: Replace WPRINTF with EPRINTLN

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

8 months agobhyve: Some fwctl simplifications.
John Baldwin [Fri, 13 Oct 2023 19:26:22 +0000 (12:26 -0700)]
bhyve: Some fwctl simplifications.

- Collapse IDENT_SEND/IDENT_WAIT states down to a single state.

- Remove unused 'len' argument to op_data callback.  The value passed
  in (total amount of remaining data to receive) didn't seem very useful
  and no op_data implementations used it.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D41286

8 months agobpf: Add IfAPI analogue for bpf_peers_present()
Justin Hibbits [Wed, 4 Oct 2023 20:56:52 +0000 (16:56 -0400)]
bpf: Add IfAPI analogue for bpf_peers_present()

An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference.  Solve
this by adding a new IfAPI that could deal with a NULL bpf, if such
could occur in the network stack.

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42082

8 months agoRevert "bpf: Add IfAPI analogue for bpf_peers_present()"
Justin Hibbits [Fri, 13 Oct 2023 18:29:02 +0000 (14:29 -0400)]
Revert "bpf: Add IfAPI analogue for bpf_peers_present()"

This reverts commit c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf.

Commit message needs revised.

8 months agopmap: add pmap_kextract(9) man page
Mina Galić [Wed, 23 Aug 2023 00:12:49 +0000 (01:12 +0100)]
pmap: add pmap_kextract(9) man page

Add a man page for pmap_kextract(9), with alias to vtophys(9). This man
page is based on pmap_extract(9).

Add it as cross reference in pmap(9), and add comments above the
function implementations.

Co-authored-by: Graham Perrin <grahamperrin@gmail.com>
Co-authored-by: mhorne
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/freebsd/freebsd-src/pull/827

8 months agotzsetup: add support for countries in two continents
Pierre Pronchery [Thu, 27 Jul 2023 16:07:22 +0000 (18:07 +0200)]
tzsetup: add support for countries in two continents

This supports countries located across multiple continents, as per the
zone1970.tab file. This only affects Cyprus and Türkiye at the moment.

PR: 236874
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41306

8 months agobpf: Add IfAPI analogue for bpf_peers_present()
Justin Hibbits [Wed, 4 Oct 2023 20:56:52 +0000 (16:56 -0400)]
bpf: Add IfAPI analogue for bpf_peers_present()

An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference.  Solve
this by adding a new IfAPI that includes a NULL check.  Since this API
is used in only a handful of locations, it reduces the the NULL check
scope over inserting the check into bpf_peers_present().

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

8 months agobsdinstall netconfig: avoid duplicate entries in rc.conf
Pierre Pronchery [Fri, 13 Oct 2023 15:45:19 +0000 (17:45 +0200)]
bsdinstall netconfig: avoid duplicate entries in rc.conf

This uses sysrc to write and update configuration variables in the
temporary configuration file for network access, ._rc.conf.net. This
replaces the previous mechanism, which was simply appending new values
as they were updated.

PR: 212396
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42194

8 months agobsdinstall: reset the mirror when restarting
Pierre Pronchery [Thu, 12 Oct 2023 20:34:06 +0000 (22:34 +0200)]
bsdinstall: reset the mirror when restarting

It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when setting up a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts are kept in the environment when
restarting the process; this makes it impossible to run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembers the choice made, and will
never prompt for a different one. Rebooting is then the only easy way
out of this situation.

This change only affects the `jail` script for now, as otherwise there
is no way to tell if the value had been specifically set by the user
before starting bsdinstall.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42183

8 months agobsdinstall: Add "Finish" button to finalconfig
Pierre Pronchery [Mon, 2 Oct 2023 18:34:48 +0000 (20:34 +0200)]
bsdinstall: Add "Finish" button to finalconfig

This adds a "Finish" button to the finalconfig step, replacing the
previous first choice, which was to "apply configuration and exit".
The new button is the default action, while the "OK" button is renamed
to "Select".

Also, if an unknown option is chosen, the code flow prompts the user
again instead of exiting.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42047

8 months agobsdinstall: revisit the finalconfig step
Pierre Pronchery [Mon, 2 Oct 2023 18:28:07 +0000 (20:28 +0200)]
bsdinstall: revisit the finalconfig step

This moves the "finalconfig" step into a dedicated script, where it uses
a loop instead of recursing into itself.

Reviewed by: bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42046

8 months agokmsan.9: Mention the loader tunable 'debug.kmsan.disable'
Zhenlei Huang [Fri, 13 Oct 2023 14:42:34 +0000 (22:42 +0800)]
kmsan.9: Mention the loader tunable 'debug.kmsan.disable'

Reviewed by: gbe (manpages), markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42166

8 months agokasan.9: Mention the loader tunable 'debug.kasan.disable'
Zhenlei Huang [Fri, 13 Oct 2023 14:42:34 +0000 (22:42 +0800)]
kasan.9: Mention the loader tunable 'debug.kasan.disable'

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42165

8 months agoarm64, risvc: warn about ignored kstack_pages for thread0
Konstantin Belousov [Wed, 11 Oct 2023 18:56:28 +0000 (21:56 +0300)]
arm64, risvc: warn about ignored kstack_pages for thread0

Suggested by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42143

8 months agoarm64: do not disable the kern.kstack_pages tunable on arm64
Konstantin Belousov [Tue, 10 Oct 2023 00:02:06 +0000 (03:02 +0300)]
arm64: do not disable the kern.kstack_pages tunable on arm64

Add a comment explaining what is not quite correct with arm64 and riscv.

Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42143

8 months agoarm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator
Konstantin Belousov [Mon, 9 Oct 2023 23:56:37 +0000 (02:56 +0300)]
arm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator

instead of kstack_pages. Although it is correct right now to use
kstack_pages on amd64 since the kern.kstack_pages tunable is not
functional on arm64, this is too fragile and wrong on riscv.

Include opt_kstack_pages.h into machdep.c to get the right definition
for KSTACK_PAGES.

Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42143

8 months agoarm64 locore.S: fix typos
Konstantin Belousov [Mon, 9 Oct 2023 23:55:45 +0000 (02:55 +0300)]
arm64 locore.S: fix typos

Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42143

8 months agopf: implement start/stop calls via netlink
Kristof Provost [Tue, 10 Oct 2023 15:20:12 +0000 (17:20 +0200)]
pf: implement start/stop calls via netlink

Implement equivalents to DIOCSTART and DIOCSTOP in netlink. Provide a
libpfctl implementation and add a basic test case, mostly to verify that
we still return the same errors as before the conversion

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

8 months agozfs: merge openzfs/zfs@8a7407012
Martin Matuska [Fri, 13 Oct 2023 07:45:15 +0000 (09:45 +0200)]
zfs: merge openzfs/zfs@8a7407012

Notable upstream pull request merges:
 #15368 008baa091 FreeBSD: Reduce divergence from in-tree sources
 #15371 1b310dfb1 DMU: Do not pre-read holes during write
 #15395 8a7407012 Zpool can start allocating from metaslab before
                  TRIMs have completed

Obtained from: OpenZFS
OpenZFS commit: 8a740701283495e59944839bb2607f80907d950e

8 months agonetlink: move NETLINK define to opt_global.h
Kristof Provost [Thu, 12 Oct 2023 19:55:57 +0000 (21:55 +0200)]
netlink: move NETLINK define to opt_global.h

Move the NETLINK define into opt_global.h so we can rely on it being
set correctly, without having to remember to include opt_netlink.h.
This ensures that the NETLINK define is correctly set. If not we
may end up with unloadable modules, due to missing symbols (such as
nlmsg_get_group_writer).

PR: 274306
Reviewed by: imp, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42179

8 months agoteken: fix style in teken_wcwidth.h
Christos Margiolis [Fri, 13 Oct 2023 05:14:57 +0000 (08:14 +0300)]
teken: fix style in teken_wcwidth.h

Reviewed by: bojan.novkovic_fer.hr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42164

8 months agotty/teken: fix UTF8 sequence validation logic
Bojan Novković [Fri, 13 Oct 2023 05:14:36 +0000 (08:14 +0300)]
tty/teken: fix UTF8 sequence validation logic

This patch fixes UTF-8 sequence validation logic in
teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in
ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code
previously used __bitcount() to extract sequence length information from
the leading byte. However, this assumption breaks for certain code
points that have additional bits set in the first half of the leading
byte (e.g. Cyrillic characters). This lead to incorrect behaviour when
deleting those characters using backspaces. The code now checks the
number of consecutive set bits in the leading byte starting from the
MSB, as per RFC 3629.

Reviewed by: christos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42147

8 months agosade: Fix F1 help message
Alfonso S. Siciliano [Fri, 13 Oct 2023 00:07:15 +0000 (02:07 +0200)]
sade: Fix F1 help message

Fix F1 message of the disk menu because the button label is "[Modify]".
This is a UI fix, no functional change.

8 months agounbound: Import upstream 0ee44ef3 when ENOBUFS is returned
Cy Schubert [Fri, 13 Oct 2023 00:04:25 +0000 (17:04 -0700)]
unbound: Import upstream 0ee44ef3 when ENOBUFS is returned

From upstream 0ee44ef3:

- Fix send of udp retries when ENOBUFS is returned. It stops looping
  and also waits for the condition to go away. Reported by Florian
  Obser.

PR: 274352
MFC after: 3 days

Merge commit '292d51198aa319c58f534549851e9c28486abdf4'

8 months agounbound: Import upstream 0ee44ef3 when ENOBUFS is returned
Cy Schubert [Thu, 12 Oct 2023 23:44:55 +0000 (16:44 -0700)]
unbound: Import upstream 0ee44ef3 when ENOBUFS is returned

From upstream 0ee44ef3:

- Fix send of udp retries when ENOBUFS is returned. It stops looping
  and also waits for the condition to go away. Reported by Florian
  Obser.

8 months agobhyve nvme: Add NQN value
Chuck Tuffli [Thu, 12 Oct 2023 22:04:17 +0000 (15:04 -0700)]
bhyve nvme: Add NQN value

Add a NVMe Qualified Name (NQN) to the Controller Data structure using
the "first format" (i.e., "... used by any organization that owns a
domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified).

This avoids a Linux kernel warning about a missing or invalid NQN.

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

8 months agolibbsddialog: delete formw dependency
Alfonso S. Siciliano [Thu, 12 Oct 2023 20:26:58 +0000 (22:26 +0200)]
libbsddialog: delete formw dependency

libbsddialog >= 0.3 has a built-in form implementation so delete
formw dependency.

Approved by: bapt (share/mk maintainer)
Differential Revision: https://reviews.freebsd.org/D42167

8 months agobhyve: Document the hw.vmm.maxcpu tunable and the current limit on vCPUs
Yuri Pankov [Thu, 12 Oct 2023 19:49:47 +0000 (12:49 -0700)]
bhyve: Document the hw.vmm.maxcpu tunable and the current limit on vCPUs

Reviewed by: corvink (original version)
Co-authored-by: John Baldwin <jhb@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D40074

8 months agopf: Free pf_rule_items when state is not created
Kajetan Staszkiewicz [Thu, 12 Oct 2023 17:43:04 +0000 (19:43 +0200)]
pf: Free pf_rule_items when state is not created

This addresses the issues of pf_rule_times leaking in case of stateless
rules and in case of state creation failures, like hitting the state
limit.

Reviewed by: kp
MFC after: 1 week
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D42169

8 months agodwc: re-rewrite barrier part
Emmanuel Vadot [Thu, 12 Oct 2023 18:54:52 +0000 (20:54 +0200)]
dwc: re-rewrite barrier part

We need the DMA engine to have everything coherent *before* we
set the OWN bit (the bit that tells the DMA engine that it owns
the descriptor).

Fixes: 487034648805 ("dwc: Rewrite barrier part")

Reported by: jhb

8 months agopkgbase: Put atf_python files in FreeBSD-tests
Emmanuel Vadot [Thu, 12 Oct 2023 17:41:38 +0000 (19:41 +0200)]
pkgbase: Put atf_python files in FreeBSD-tests

Sponsored by: Beckhoff Automation GmbH & Co. KG

8 months agoZpool can start allocating from metaslab before TRIMs have completed
Jason King [Thu, 12 Oct 2023 18:01:54 +0000 (13:01 -0500)]
Zpool can start allocating from metaslab before TRIMs have completed

When doing a manual TRIM on a zpool, the metaslab being TRIMmed is
potentially re-enabled before all queued TRIM zios for that metaslab
have completed. Since TRIM zios have the lowest priority, it is
possible to get into a situation where allocations occur from the
just re-enabled metaslab and cut ahead of queued TRIMs to the same
metaslab.  If the ranges overlap, this will cause corruption.

We were able to trigger this pretty consistently with a small single
top-level vdev zpool (i.e. small number of metaslabs) with heavy
parallel write activity while performing a manual TRIM against a
somewhat 'slow' device (so TRIMs took a bit of time to complete).
With the patch, we've not been able to recreate it since. It was on
illumos, but inspection of the OpenZFS trim code looks like the
relevant pieces are largely unchanged and so it appears it would be
vulnerable to the same issue.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jason King <jking@racktopsystems.com>
Illumos-issue: https://www.illumos.org/issues/15939
Closes #15395

8 months agoacpi_ged: Handle events directly
Andrew Gallatin [Thu, 12 Oct 2023 15:15:06 +0000 (11:15 -0400)]
acpi_ged:  Handle events directly

Handle ged interrupts directly from the interrupt handler,
while the interrupt source is masked, so as to conform
with the acpi spec, and avoid spurious interrupts and
lockups on boot.

When an acpi ged interrupt is encountered, the spec requires
the os (as stated in 5.6.4: General Purpose Event Handling)
to leave the interrupt source masked until it runs the
EOI handler.  This is not a good fit for our method of
queuing the work (including the EOI ack of the interrupt),
via the AcpiOsExecute() taskqueue mechanism.

Note this fixes a bug where an arm64 server could lock up if
it encountered a ged interrupt at boot.  The lockup was
due to running on a single core (due to arm64 not using
EARLY_AP_STARTUP), and due to that core encountering a
new interrupt each time the interrupt handler unmasked
the interrupt source, and having the EOI queued on a taskqueue
which never got a chance to run. This is also possible
on any platform when using just a single processor.
The symptom of this is a lockup at boot, with:
"AcpiOsExecute: failed to enqueue task, consider
increasing the debug.acpi.max_tasks tunable" scrolling
on console.

Similarly, spurious interrupts would occur when running
with multiple cores, because it was likely that the
interrupt would fire again immediately, before the
ged task could be run, and before an EOI could be sent
to lower the interrupt line.  I would typically see
3-5 copies of every ged event due to this issue.

This adds a tunable, debug.acpi.ged_defer, which can be
set to 1 to restore the old behavior.  This was done
because acpi is a complex system, and it may be
theoretically possible something the ged handler does
may sleep (though I cannot easily find anthing by inspection).

MFC after: 1 month
Reviewed by: andrew, jhb, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42158

8 months agoUPDATING: fix typo
Ceri Davies [Thu, 12 Oct 2023 12:00:56 +0000 (13:00 +0100)]
UPDATING: fix typo

8 months agovm_phys: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:49 +0000 (18:14 +0800)]
vm_phys: Add corresponding sysctl knob for loader tunable

The loader tunable 'vm.numa.disabled' does not have corresponding sysctl
MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also
report it correctly.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42138

8 months agovm_page: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:49 +0000 (18:14 +0800)]
vm_page: Add corresponding sysctl knob for loader tunable

The loader tunable 'vm.pgcache_zone_max_pcpu' does not have corresponding
sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T`
will also report it correctly.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42138

8 months agokmsan: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:49 +0000 (18:14 +0800)]
kmsan: Add corresponding sysctl knob for loader tunable

The loader tunable 'debug.kmsan.disabled' does not have corresponding
sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T`
will also report it correctly.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42138

8 months agokasan: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:48 +0000 (18:14 +0800)]
kasan: Add corresponding sysctl knob for loader tunable

The loader tunable 'debug.kasan.disabled' does not have corresponding
sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T`
will also report it correctly.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42138

8 months agoboottrace: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:48 +0000 (18:14 +0800)]
boottrace: Add corresponding sysctl knob for loader tunable

The loader tunable 'kern.boottrace.table_size' does not have
corresponding sysctl MIB entry. Add it so that it can be retrieved,
and `sysctl -T` will also report it correctly.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42138

8 months agoxilinx: reset: Remove debug printfs
Emmanuel Vadot [Thu, 12 Oct 2023 07:32:32 +0000 (09:32 +0200)]
xilinx: reset: Remove debug printfs

Sponsored by: Beckhoff Automation GmbH & Co. KG

8 months agovfs: convert recycles_count and recycles_free_count to mere u_long
Mateusz Guzik [Thu, 12 Oct 2023 06:57:59 +0000 (06:57 +0000)]
vfs: convert recycles_count and recycles_free_count to mere u_long

Only vnlru ever updates them.

This also removes recycles_count updates from hand-rolled debug vnode
recycling via sysctl.

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

8 months agovfs: count recycles by vnlru and by vn_alloc separately
Mateusz Guzik [Thu, 12 Oct 2023 06:47:45 +0000 (06:47 +0000)]
vfs: count recycles by vnlru and by vn_alloc separately

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

8 months agofreebsd-update: create deep BEs by default
Kyle Evans [Thu, 12 Oct 2023 02:51:07 +0000 (21:51 -0500)]
freebsd-update: create deep BEs by default

The -r flag to bectl needs to go away, and we need to just do the right
thing.  In the meantime, we can apply an -r in freebsd-update as a
minimal fix to stop creating partial backups in these (non-default) deep
BE setups.

PR: 267535

8 months agospec: define _bashcompletiondir if undefined
Brian Behlendorf [Wed, 11 Oct 2023 23:56:32 +0000 (16:56 -0700)]
spec: define _bashcompletiondir if undefined

Always define _bashcompletiondir in the spec file to a reasonable value
when it is undefined.  Required for `rpmbuild --rebuild <srpm>`.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15396

8 months agoDMU: Do not pre-read holes during write
Alexander Motin [Wed, 11 Oct 2023 23:37:21 +0000 (19:37 -0400)]
DMU: Do not pre-read holes during write

dmu_tx_check_ioerr() pre-reads blocks that are going to be dirtied
as part of transaction to both prefetch them and check for errors.
But it makes no sense to do it for holes, since there are no disk
reads to prefetch and there can be no errors.  On the other side
those blocks are anonymous, and they are freed immediately by the
dbuf_rele() without even being put into dbuf cache, so we just
burn CPU time on decompression and overheads and get absolutely
no result at the end.

Use of dbuf_hold_impl() with fail_sparse parameter allows to skip
the extra work, and on my tests with sequential 8KB writes to empty
ZVOL with 32KB blocks shows throughput increase from 1.7 to 2GB/s.

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

8 months agovfs: count calls to uma_reclaim in vnlru
Mateusz Guzik [Wed, 11 Oct 2023 22:48:03 +0000 (22:48 +0000)]
vfs: count calls to uma_reclaim in vnlru

8 months agox86: Rename {stop,start}_emulating to fpu_{enable,disable}
John Baldwin [Wed, 11 Oct 2023 21:32:06 +0000 (14:32 -0700)]
x86: Rename {stop,start}_emulating to fpu_{enable,disable}

While here, centralize the macros in <x86/fpu.h>.

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

8 months agoamd64: Remove a stale comment from cpu_setregs
John Baldwin [Wed, 11 Oct 2023 21:22:17 +0000 (14:22 -0700)]
amd64: Remove a stale comment from cpu_setregs

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

8 months agoriscv: Tidy panic messages for exceptions
John Baldwin [Wed, 11 Oct 2023 21:21:12 +0000 (14:21 -0700)]
riscv: Tidy panic messages for exceptions

- Remove trailing newlines

- Be consistent about the format used to print pointer values

- Print the trap value for access faults (it is the faulting address
  if non-zero) and illegal instructions (it is the first N bytes of
  the decoded instruction if non-zero)

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41786

8 months agotest: iterate both reader and writer threads starting at the actual pagesize
Richard Scheffenegger [Wed, 11 Oct 2023 21:11:37 +0000 (23:11 +0200)]
test: iterate both reader and writer threads starting at the actual pagesize

Reviewed By: pho
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42160

8 months agotcp: clear SACK state when scoreboard is forcefully freed
Richard Scheffenegger [Wed, 11 Oct 2023 20:38:34 +0000 (22:38 +0200)]
tcp: clear SACK state when scoreboard is forcefully freed

When a Retransmission Timeout happens during an on-going SACK loss recovery
episode, the internal SACK accounting was not cleared.

Reported by: pho
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42162

8 months agousb: add quirks for the Genesys GL3220 card reader
Mazin Fadl [Wed, 11 Oct 2023 03:22:12 +0000 (22:22 -0500)]
usb: add quirks for the Genesys GL3220 card reader

Without these, card hotplugging does not work on the GL3220.

PR: 263868
Fixes: 520b88860d7a79 ("usb(4): Automagically apply all quirks [...]")

8 months agousb: add necessary quirks for the NOREL Systems NS1081 SD reader
Mazin Fadl [Wed, 11 Oct 2023 03:12:22 +0000 (22:12 -0500)]
usb: add necessary quirks for the NOREL Systems NS1081 SD reader

Without these, the Norelsys NS1081 is completely defunct.

PR: 263868
Fixes: 520b88860d7a79 ("usb(4): Automagically apply all quirks [...]")

8 months agoping: Add missing ATF boilerplate.
Dag-Erling Smørgrav [Wed, 11 Oct 2023 19:45:06 +0000 (21:45 +0200)]
ping: Add missing ATF boilerplate.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42161

8 months agoping: Consistently use EX_NOHOST for DNS failures.
Dag-Erling Smørgrav [Wed, 11 Oct 2023 19:44:30 +0000 (21:44 +0200)]
ping: Consistently use EX_NOHOST for DNS failures.

Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed.
That is still the case for the legacy code in the new merged ping, but
not for IPv6 targets, nor when a DNS lookup is performed in order to
determine which version of the tool to invoke.

While here, also make sure that the error message is consistent.

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

8 months agopkgbase: Move uuidgen to runtime package
Emmanuel Vadot [Tue, 10 Oct 2023 16:56:20 +0000 (18:56 +0200)]
pkgbase: Move uuidgen to runtime package

This is useful to have a valid /etc/hostid and /etc/machine-id for
small mfsroot based setup and not needing to install FreeBSD-utilities

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42149

8 months agopkgbase: Move blacklist utilities to a new package
Emmanuel Vadot [Tue, 10 Oct 2023 14:41:52 +0000 (16:41 +0200)]
pkgbase: Move blacklist utilities to a new package

Unbloat a bit FreeBSD-utilities.
The only package that will depends on this new one is FreeBSD-ssh
which not anyone have in some setup.
And this will allow to have small pkgbase setup with ssh without
having to bring the bloated FreeBSD-utilities package
Name the package blocklist to reflect upstream futur changes.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42148

8 months agoping: Require root user for pytests
Jose Luis Duran [Wed, 11 Oct 2023 13:57:11 +0000 (13:57 +0000)]
ping: Require root user for pytests

atf_python may use vnet jails for creating an isolated test environment.
Mark these tests that require root user privileges.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863

8 months agoping: pr_iph() improvements
Jose Luis Duran [Thu, 13 Apr 2023 15:30:44 +0000 (15:30 +0000)]
ping: pr_iph() improvements

Very early on, the Src/Dst IP addresses were printed in hex notation
(%08x), which will always be 8-characters wide.  It was later changed to
use a dot-decimal notation.  Depending on the IP address length, the Src
and Dst headers may require a different padding.  Use the source and
destination IP lengths as padding for the headers.

Also, print an Opts (options) header, if there are options present.  It
has been abbreviated to Opts to match the length of the previous Data
header, removed in ef9e6dc7eebe9830511602904d3ef5218d964080.

Print the header info such that no trailing spaces are produced.  As
some git workflows may automatically trim them, and make the tests fail
(see 25b86f8559c2e7076daff56933217e95cd4398d4).

Before

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1  192.0.2.2␣

After

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks       Src       Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1 192.0.2.2

And with options:

Before

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1  192.0.2.2 01...

After

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks       Src       Dst Opts
     4  f  00 007c 0001   0 0000  40  01 d868 192.0.2.1 192.0.2.2 01...

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D39561

8 months agoping: Fix the spacing between the time stamp and cp/dp
Jose Luis Duran [Mon, 10 Apr 2023 16:58:42 +0000 (16:58 +0000)]
ping: Fix the spacing between the time stamp and cp/dp

When an echo reply packet is received, the data is compared with the
sent data.  When a wrong byte is detected the command displays a report
with the differences.

The first row (the first 8-bytes of data after the ICMP header) should
include the time stamp (if data is at least 8-bytes), this value is not
taken into consideration for the comparison.  The remaining rows
represent the data (padded pattern) received/sent, with each byte being
compared for differences.

Print the space before (not after), to add an extra space after cp:/dp:
for better readability when the first time stamp octet is not
zero-padded, and to remove trailing spaces in the output.

Before:
    cp:99  0  0  c  1  5  c  0␣
     ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd␣
     ...

After:
    cp: 99  0  0  c  1  5  c  0
      ab cd ab cd ab cd ab cd ab cd ab cd ab cd ab cd
      ...

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D39492

8 months agoping: Unify ping/ping6 statistics section
Jose Luis Duran [Mon, 21 Nov 2022 01:18:43 +0000 (22:18 -0300)]
ping: Unify ping/ping6 statistics section

This is a first step towards a unification/simplification of ping/ping6
(internally).  The end goal is to produce a standardized user-facing
output.

Before (ping6):

    PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
    16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms
    16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms

    --- 2001:db8::2 ping6 statistics ---
    round-trip min/avg/max/std-dev = 0.068/0.118/0.168/0.050 ms

After (ping6):

    PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
    16 bytes from ::1, icmp_seq=0 hlim=64 time=0.168 ms
    16 bytes from ::1, icmp_seq=1 hlim=64 time=0.068 ms

    --- 2001:db8::2 ping statistics ---
    round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms

This has the nice side-effect of adding units to SIGINFO's statistics,
as printing numbers without units may not be of much help.  Also
mentions the fact that these times are round-trip.

Before (ping/ping6 SIGINFO):

    2/2 packets received (100.0%) 0.068 min / 0.118 avg / 0.168 max

After (ping/ping6 SIGINFO):

    --- <ipv4/ipv6 address> ping statistics ---
    2 packets transmitted, 2 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.068/0.118/0.168/0.050 ms

In the case of a SIGINFO, the output will be printed to stderr, for both
ping and ping6.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D39126

8 months agoping: Specify the sigaction(2) name
Jose Luis Duran [Fri, 10 Feb 2023 14:01:22 +0000 (11:01 -0300)]
ping: Specify the sigaction(2) name

After a2a008880568eaeb87d8404b39627b83df851f34, specify the signal name.

Obtained from: Darwin
MFC after: 1 week
Reviewed by: asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D38484

8 months agoping: Remove an extra new line character
Jose Luis Duran [Thu, 9 Feb 2023 18:16:39 +0000 (15:16 -0300)]
ping: Remove an extra new line character

This matches the behavior when an RR truncated route is printed.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D39485

8 months agoping tests: Test IHL/quoted data/inner packet paths
Jose Luis Duran [Sat, 11 Feb 2023 14:17:46 +0000 (11:17 -0300)]
ping tests: Test IHL/quoted data/inner packet paths

Commit 46d7b45a267b3d78c5054b210ff7b6c55bfca42b introduced these code
paths.  Test and document them.

- Add inner packet too short test
- Add inner IHL too short test
- Add quoted data too short test
- Add IHL too short test
- Add max inner packet IHL without payload test

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D38528

8 months agoping: Avoid reporting NaNs
Jose Luis Duran [Fri, 6 Oct 2023 17:55:06 +0000 (17:55 +0000)]
ping: Avoid reporting NaNs

Avoid calculating the square root of negative zero, which can easily
happen on certain architectures when calculating the population standard
deviation with a sample size of one, e.g., 0.01 - (0.1 * 0.1) =
-0.000000.

Avoid returning a NaN by capping the minimum possible variance value to
zero (positive).

In the future, maybe skip reporting statistics at all for a single
sample.

Reported by: Jenkins
Reviewed by: asomers
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/863
Differential Revision: https://reviews.freebsd.org/D42114

8 months agobsdinstall auto: replace dialog with bsddialog
Alfonso S. Siciliano [Wed, 11 Oct 2023 16:18:46 +0000 (18:18 +0200)]
bsdinstall auto: replace dialog with bsddialog

bsdinstall/scripts/auto: Replace dialog(1) with bsddialog(1).

8 months agoMove (LENOVO, TBT3LAN) from if_ure til if_cdce where it works much better
Poul-Henning Kamp [Wed, 11 Oct 2023 15:54:55 +0000 (15:54 +0000)]
Move (LENOVO, TBT3LAN) from if_ure til if_cdce where it works much better

8 months agobsdinstall: restore --calendar
Alfonso S. Siciliano [Wed, 11 Oct 2023 13:48:53 +0000 (15:48 +0200)]
bsdinstall: restore --calendar

Restore --calendar to select a date because bsddialog(1) >= 0.4
provides a calendar dialog.

8 months agovfs: add max_vnlru_free to the vfs.vnode.vnlru tree
Mateusz Guzik [Wed, 11 Oct 2023 13:05:43 +0000 (13:05 +0000)]
vfs: add max_vnlru_free to the vfs.vnode.vnlru tree

While here rename the var internally.

8 months agodialog: correctly mark the libaries
Baptiste Daroussin [Wed, 11 Oct 2023 11:36:16 +0000 (13:36 +0200)]
dialog: correctly mark the libaries

Mark the libraries as such in order for make delete-old to not
remove them when the DIALOG option is off

8 months agovfs: further speed up continuous free vnode recycle
Mateusz Guzik [Wed, 11 Oct 2023 09:42:12 +0000 (09:42 +0000)]
vfs: further speed up continuous free vnode recycle

The primary bottleneck *was* vnode_list mtx, which got artificially
worsened due to the following work done with the lock held:
1. the global heavily modified numvnodes counter was being read,
   inducing massive cache line ping pong
2. should the value fit limits (which it normally did) there would be an
   avoidable write to vn_alloc_cyclecount, which is being read outside
   of the lock, once more inducing traffic

But if vn_alloc_cyclecount is 0, which it normally is even when facing
vnode shortage, there is no need to check numvnodes nor set it to 0 again.

Another problem was numvnodes adjustment (which made the locked read
much worse). While it fundamentally does not scale as it is not
distributed in any fashion, it was avoidably slow. When bumping over the
vnode limit, it would be modified with atomics 3 times: inc + dec to
backpedal in vn_alloc, then final inc in vn_alloc_hard.

One can let some slop persist over calls to vnlru_free instead.

In principle each thread in the system could get here and bump it, so a
limit is put in place to keep things sane.

Bench setup same as in prior commits: zfs, 20 separate directory trees
each with 1 million files in total and 20 find(1) processes stating them
in parallel (one per each tree).

Total run time (in seconds) goes down as follows:
vnode limit 8388608 400000
before ~20 ~35
after ~8 ~15

With this in place the primary bottleneck is now ZFS.

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

8 months agosyslogd: Prevent running tests in parallel
Olivier Cochard [Wed, 11 Oct 2023 10:17:40 +0000 (12:17 +0200)]
syslogd: Prevent running tests in parallel

They all use the same listening port.

Approved by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D41989

8 months agobsdinstall: Fix command line argument list parsing
Alfonso S. Siciliano [Wed, 11 Oct 2023 08:17:04 +0000 (10:17 +0200)]
bsdinstall: Fix command line argument list parsing

bsddialog(1) uses getopt_long(3) to parse command line argument list.
Add '--' to avoid errors caused by arguments (menu items) begin
with '-'.
The change is compatible with dialog(1) and Xdialog(1).

8 months agospkrtest.8: Add module info
Alfonso S. Siciliano [Wed, 11 Oct 2023 06:58:59 +0000 (08:58 +0200)]
spkrtest.8: Add module info

Add the module and driver info as usual.

Approved by: bcr, wosch
Differential Revision: https://reviews.freebsd.org/D37710

8 months agovfs: don't recycle transiently excess vnodes
Mateusz Guzik [Wed, 11 Oct 2023 06:39:48 +0000 (06:39 +0000)]
vfs: don't recycle transiently excess vnodes

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

8 months agoktrace.2: correct kern.ktrace.genio_size sysctl name
Ed Maste [Wed, 11 Oct 2023 01:18:36 +0000 (21:18 -0400)]
ktrace.2: correct kern.ktrace.genio_size sysctl name

The man page had `kern.ktrace.geniosize` but the sysctl node contains an
underscore.

PR: 274274
Reported by: Ivan Rozhuk
Sponsored by: The FreeBSD Foundation

8 months agoping: Simplify protocol selection.
Dag-Erling Smørgrav [Tue, 10 Oct 2023 22:47:46 +0000 (00:47 +0200)]
ping: Simplify protocol selection.

* Interrupt the option loop as soon as we have an indication of which
  protocol is intended.
* If we end up having to perform a DNS lookup, loop over the entire
  result looking for either IPv4 or IPv6 addresses.

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Reviewed by: rscheff, kevans, allanjude
Differential Revision: https://reviews.freebsd.org/D42137

8 months agozfs: enable block cloning by default
Martin Matuska [Tue, 10 Oct 2023 22:43:35 +0000 (00:43 +0200)]
zfs: enable block cloning by default

Discussed with: markj
Reviewed by: mav
Tested  by: mm (FreeBSD test suite + OpenZFS test suite)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D41991

8 months agonvme: Close a race in destroying qpair and timeouts
Warner Losh [Tue, 10 Oct 2023 17:13:25 +0000 (11:13 -0600)]
nvme: Close a race in destroying qpair and timeouts

While we should have cleared all the pending I/O prior to calling
nvme_qpair_destroy, which should ensure that if the callout_drain causes
a call to nvme_qpair_timeout(), it won't schedule any new
timeout. However, it doesn't hurt to set timeout_pending to false in
nvme_qpair_destroy() and have nvme_qpair_timeout() exit early if it sees
it w/o scheduling a timeout. Since we don't otherwise stop the timeout
until we're about to destroy the qpair, this ensures we fail safe. The
lock/unlock also ensures the callout_drain will either remove the callout,
or wait for it to run with the early bailout.

We can likely further improve this by using callout_stop() inside the
pending lock. I'll investigate that for future refinement.

Sponsored by: Netflix
Suggestions by: jhb
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D42065

8 months agonvme: Eliminate RECOVERY_FAILED state
Warner Losh [Tue, 10 Oct 2023 17:13:16 +0000 (11:13 -0600)]
nvme: Eliminate RECOVERY_FAILED state

While it seemed like a good idea to have this state, we can do
everything we wanted with the state by checking ctrlr->is_failed since
that's set before we start failing the qpairs. Add some comments about
racing when we're failing the controller, though in practice I'm not
sure that kind of race could even be lost.

Sponsored by: Netflix
Reviewed by: chuck, gallatin, jhb
Differential Revision: https://reviews.freebsd.org/D42051

8 months agonvme: Remove stale comment
Warner Losh [Tue, 10 Oct 2023 17:13:07 +0000 (11:13 -0600)]
nvme: Remove stale comment

After da8324a9258f, the pre/post hooks are gone. So remove a coment
about why we don't call them in this case.

Sponsored by: Netflix
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D42050

8 months agonvme: Really remove NVME_2X_RESET
Warner Losh [Tue, 10 Oct 2023 17:12:59 +0000 (11:12 -0600)]
nvme: Really remove NVME_2X_RESET

da8324a9258f removed one of the two instances of NVME_2X_RESET. It
failed to snag the other one, and remove it from the options file.
Remove from both of those here.

Sponsored by: Netflix
Reviewed by: chuck, gallatin, jhb
Differential Revision: https://reviews.freebsd.org/D42049

8 months agonvme: gc nvme_ctrlr_post_failed_request and related task stuff
Warner Losh [Tue, 10 Oct 2023 17:09:24 +0000 (11:09 -0600)]
nvme: gc nvme_ctrlr_post_failed_request and related task stuff

In 4b977e6dda92 we removed the call to nvme_ctrlr_post_failed_request
because we can now directly fail requests in this context since we're in
the reset task already. No need to queue it. I left it in place against
future need, but it's been two years and no panics have resulted. Since
the static analysis (code checking) and the dyanmic analysis (surviving
in the field for 2 years, including at $WORK where we know we've gone
through this path when we've failed drives) both signal that it's not
really needed, go ahead and GC it. If we discover at a later date a flaw
in this analysis, we can add it back easily enough by reverting this and
4b977e6dda92.

Sponsored by: Netflix
Reviewed by: chuck, gallatin, jhb
Differential Revision: https://reviews.freebsd.org/D42048

8 months agoZTS: Debug zfs_share_concurrent_shares failure
Brian Behlendorf [Tue, 10 Oct 2023 20:32:33 +0000 (13:32 -0700)]
ZTS: Debug zfs_share_concurrent_shares failure

Update zfs_share_concurrent_shares test case to wait a few seconds
and recheck that the filesystem isn't shared.  The intent here is
determine the nature of the error and if it may be a race.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15379

8 months agoCI: Move perl script to dist_noinst_DATA
Brian Behlendorf [Tue, 10 Oct 2023 20:31:15 +0000 (13:31 -0700)]
CI: Move perl script to dist_noinst_DATA

Everything listed in dist_noinst_SCRIPTS is assumed to be a shell
script, this generates a shellcheck SC1071 error since perl is not
supported.  Move update_authors.pl to dist_noinst_DATA with the
other perl scripts.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Rob N <robn@despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15392

8 months agovfs: prefix regular vnlru with a special case for free vnodes
Mateusz Guzik [Thu, 14 Sep 2023 19:08:40 +0000 (19:08 +0000)]
vfs: prefix regular vnlru with a special case for free vnodes

Works around severe performance problems in certain corner cases, see
the commentary added.

Modifying vnlru logic has proven rather error prone in the past and a
release is near, thus take the easy way out and fix it without having to
dig into the current machinery.