]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 months agotarfs.5: Document the importance of zstd framing
Mark Johnston [Thu, 4 Apr 2024 14:54:25 +0000 (10:54 -0400)]
tarfs.5: Document the importance of zstd framing

Reviewed by: des, kib
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44628

2 months agotarfs: Inherit mnt_iosize_max from the lower vnode
Mark Johnston [Thu, 4 Apr 2024 14:54:06 +0000 (10:54 -0400)]
tarfs: Inherit mnt_iosize_max from the lower vnode

There is no obvious reason to use a value smaller than that.

Reviewed by: des, kib
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44627

2 months agoln: Improve link(1) variant of ln(1).
Dag-Erling Smørgrav [Thu, 4 Apr 2024 14:14:50 +0000 (16:14 +0200)]
ln: Improve link(1) variant of ln(1).

* Give link(1) its own usage message.
* Use getprogname(3) instead of rolling our own.
* Verify that the target file does not already exist.
* Add tests specific to link(1).

MFC after: 3 days
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44635

2 months agotmpfs: Improve file time tests.
Dag-Erling Smørgrav [Thu, 4 Apr 2024 13:40:47 +0000 (15:40 +0200)]
tmpfs: Improve file time tests.

* The empty test case no longer fails because 89f1dcb3eb46 causes empty
  files to bypass the bug.
* The bug still exists, so add a test case which exercises it.
* While here, tighten up some of the checks.

A similar patch has been submitted upstream.

PR: 274615
X-MFC-With: 89f1dcb3eb46
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44609

2 months agotcpdump: cope with incorrect packet lengths
Kristof Provost [Mon, 1 Apr 2024 09:42:14 +0000 (11:42 +0200)]
tcpdump: cope with incorrect packet lengths

It's possible for the capture buffer to be smaller than indicated by the
header length. However, pfsync_print() only took the header length into
account. As a result we could read outside of the buffer.

Check that we have at least the expected amount of data before we start
parsing.

PR: 278034
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44580

2 months agoinclude: Ensure security/audit/audit.h gets staged properly.
Stephen J. Kiernan [Thu, 4 Apr 2024 00:22:29 +0000 (20:22 -0400)]
include: Ensure security/audit/audit.h gets staged properly.

There is a conflict between bsm/audit.h and security/audit/audit.h due
to the way that staging is being set up using .PATH to point to the
full directory and the leaf files being specified in the list. Due to
this, the bsm/audit.h was getting staged as both bsm/audit.h and
security/audit/audit.h since the sys/bsm directory is listed first in
the .PATH list.

Use sys/security in the .PATH instead of sys/security/audit and specify
the audit header files as audit/<name>.h. This ensures that we get the
correct audit.h stanged for security/audit/audit.h.

Reviewed by: sjg
Obtained from: Juniper Networks, Inc.

2 months agouserboot: allow for overriding the version file location
Stephen J. Kiernan [Wed, 3 Apr 2024 21:22:01 +0000 (17:22 -0400)]
userboot: allow for overriding the version file location

Use ?= when assigning VERSION_FILE

Reviewed by: imp
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44624

2 months agotcp: address a warning
Michael Tuexen [Wed, 3 Apr 2024 22:14:59 +0000 (00:14 +0200)]
tcp: address a warning

t_state is an unsigned variable, so no need for testing that it is
non-negative.

Reported by: Coverity Scan
CID: 1390885
Reviewed by: glebius
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44619

2 months agokernel: Add options for MAC_DEBUG and MAC_VERIEXEC_DEBUG
Stephen J. Kiernan [Wed, 3 Apr 2024 20:05:25 +0000 (16:05 -0400)]
kernel: Add options for MAC_DEBUG and MAC_VERIEXEC_DEBUG

2 months agosdt: Use designated initializers for various definitions
Mark Johnston [Wed, 3 Apr 2024 18:41:29 +0000 (14:41 -0400)]
sdt: Use designated initializers for various definitions

No functional change intended.

MFC after: 1 week

2 months agoefitable(8): Complete libxo transition
Yan-Hao Wang [Wed, 3 Apr 2024 18:32:00 +0000 (02:32 +0800)]
efitable(8): Complete libxo transition

Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41411

2 months agosavecore(8): Complete libxo transition
Yan-Hao Wang [Wed, 3 Apr 2024 18:28:30 +0000 (02:28 +0800)]
savecore(8): Complete libxo transition

Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41392

2 months agoddb: Fix format string errors in db_pprint.c
Mark Johnston [Wed, 3 Apr 2024 18:12:45 +0000 (14:12 -0400)]
ddb: Fix format string errors in db_pprint.c

Reported by: bapt
Fixes: aada453dcbaa ("ddb: Properly pretty-print non-labeled enum values")

2 months agobhnd_erom.9: remove self-reference
Christopher Davidson [Wed, 3 Apr 2024 16:51:48 +0000 (13:51 -0300)]
bhnd_erom.9: remove self-reference

Change .Xr to .Fn, which quiets a mandoc warning.

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1135

2 months agodevice_add_child.9: remove self-reference
Christopher Davidson [Wed, 3 Apr 2024 16:48:40 +0000 (13:48 -0300)]
device_add_child.9: remove self-reference

Change .Xr to .Nm, which quiets a mandoc warning

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1135

2 months agocfumass.4: remove self-reference
Christopher Davidson [Wed, 3 Apr 2024 16:47:14 +0000 (13:47 -0300)]
cfumass.4: remove self-reference

Change .Xr to .Nm, which quiets a mandoc warning.

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1135

2 months agomount_mfs.8: remove self-reference
Christopher Davidson [Wed, 3 Apr 2024 16:43:51 +0000 (13:43 -0300)]
mount_mfs.8: remove self-reference

Change .Xr instances to .Nm, which quiets several mandoc warnings.

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1135

2 months agoopen.2: remove self-reference
Christopher Davidson [Wed, 3 Apr 2024 16:38:41 +0000 (13:38 -0300)]
open.2: remove self-reference

Change .Xr reference to .Fn, which quiets a mandoc warning.

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1135

2 months agotcp: fix conversion of rttvar
Michael Tuexen [Wed, 3 Apr 2024 16:39:31 +0000 (18:39 +0200)]
tcp: fix conversion of rttvar

A wrong variable and wrong scaling factors were used.

Reported by: Coverity Scan
CID: 1508689
Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44612

2 months agotcp: fix comment
Michael Tuexen [Wed, 3 Apr 2024 16:21:19 +0000 (18:21 +0200)]
tcp: fix comment

Make the comment consistent with the code.

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

2 months agoarm64: correctly handle a failed BTI check in pmap_enter_l2()
Alan Cox [Wed, 3 Apr 2024 05:21:08 +0000 (00:21 -0500)]
arm64: correctly handle a failed BTI check in pmap_enter_l2()

If pmap_enter_l2() does not create a mapping because the BTI check
fails, then we should release the reference on the page table page
acquired from pmap_alloc_l2().  Otherwise, the page table page will
never be reclaimed.

2 months agoddb: Don't throw away qualifier when pretty-printing unnamed pointers
Bojan Novković [Wed, 3 Apr 2024 15:55:13 +0000 (17:55 +0200)]
ddb: Don't throw away qualifier when pretty-printing unnamed pointers

Reported by: jrtc27
Fixes: c21bc6f ("ddb: Add CTF-based pretty printing")
Approved by: markj (mentor)

2 months agoddb: Properly pretty-print non-labeled enum values
Bojan Novković [Wed, 3 Apr 2024 15:47:00 +0000 (17:47 +0200)]
ddb: Properly pretty-print non-labeled enum values

The ddb pretty-printer currently does not print out enum values that
are not labeled (e.g. X | Y).
The enum printer was reworked to print non-labeled values.

Reported by: jrtc27
Fixes: c21bc6f ("ddb: Add CTF-based pretty printing")
Approved by: markj (mentor)

2 months agonextboot: Write nextboot.conf safely
Mark Johnston [Wed, 3 Apr 2024 15:29:25 +0000 (11:29 -0400)]
nextboot: Write nextboot.conf safely

As in the old nextboot.sh script:
- First write everything to a tempfile instead of /boot/nextboot.conf.
- fsync() the tempfile before renaming it to nextboot.conf.

Fixes: fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44572

2 months agotarfs: Fix 32-bit build.
Dag-Erling Smørgrav [Wed, 3 Apr 2024 14:24:05 +0000 (16:24 +0200)]
tarfs: Fix 32-bit build.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D44613

2 months agotarfs: Ignore global extended headers.
Dag-Erling Smørgrav [Wed, 3 Apr 2024 09:55:06 +0000 (11:55 +0200)]
tarfs: Ignore global extended headers.

Previously, we would error out if we encountered a global extended
header, because we don't know what it means.  This doesn't really
matter though, and traditionally, tar implementations have either
ignored them or treated them as plain files, so just ignore them.
This allows tarfs to mount tar files created by `git archive`.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44600

2 months agotarfs: Support paths that spill into exthdrs.
Dag-Erling Smørgrav [Wed, 3 Apr 2024 09:55:01 +0000 (11:55 +0200)]
tarfs: Support paths that spill into exthdrs.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44599

2 months agoSYSCTL_ADD_CONST_STRING(9): HISTORY
David E. O'Brien [Wed, 3 Apr 2024 06:25:39 +0000 (23:25 -0700)]
SYSCTL_ADD_CONST_STRING(9): HISTORY

Add information of where one may use this API.

2 months agoAdd SYSCTL_ADD_CONST_STRING(9)
David E. O'Brien [Tue, 2 Apr 2024 21:21:35 +0000 (14:21 -0700)]
Add SYSCTL_ADD_CONST_STRING(9)

Catch up with 10a1e981d (2019-03-19) so that one can do
'man SYSCTL_ADD_CONST_STRING' and not get
"No manual entry for SYSCTL_ADD_CONST_STRING".

Reviewed by: sjg

2 months agoReinstate returning EOVERFLOW from stats_v1_blob_clone()
Lawrence Stewart [Tue, 2 Apr 2024 06:34:25 +0000 (17:34 +1100)]
Reinstate returning EOVERFLOW from stats_v1_blob_clone()

a0993376ec5f (from D43179) subtly changed stats_v1_blob_clone() to stop returning EOVERFLOW in the case where the user buffer is not large enough to receive the entire statsblob. This results in any consumers which are implemented to retry on receiving EOVERFLOW to instead give up after receiving an empty statsblob header.

Fix by latching any errors recorded prior to copyout.

Reviewed by: markj
Obtained from: Netflix, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44585
Fixes: a0993376ec5f ("stats: Check for errors from copyout()")

2 months agoOptionalObsoleteFiles: add missed cuda wrappers include files
Olivier Cochard [Tue, 2 Apr 2024 20:43:05 +0000 (22:43 +0200)]
OptionalObsoleteFiles: add missed cuda wrappers include files

Files introduced since clang 17.0.2.

Approved by: dim
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44597

2 months agoacpidump(8) Fix typo in error message
SHENG-YI HONG [Tue, 2 Apr 2024 17:24:46 +0000 (01:24 +0800)]
acpidump(8) Fix typo in error message

acpidump(8) uses iasl(8) to parse acpi information.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44596

2 months agosound: Move sndstat_prepare_pcm() to pcm/sndstat.c and remove sndstat_entry->handler
Christos Margiolis [Tue, 2 Apr 2024 16:56:39 +0000 (18:56 +0200)]
sound: Move sndstat_prepare_pcm() to pcm/sndstat.c and remove sndstat_entry->handler

Since all sndstat_entry->handler fields point to sndstat_prepare_pcm(),
we can just call the function directly, without assigning it to a
function pointer and calling it indirectly.

While here, move sndstat_prepare_pcm() to pcm/sndstat.c, as it is more
suitable there.

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D44571

2 months agofreebsd-update: Fix typo in comment
a-biardi [Tue, 2 Apr 2024 12:28:52 +0000 (13:28 +0100)]
freebsd-update: Fix typo in comment

s/patchname expansion/pathname expansion/

Signed-off-by: a.biardi@tiscali.it
Pull-request: https://github.com/freebsd/freebsd-src/pull/1152

2 months agoLinuxKPI: add PCI_VENDOR_ID_ITTIM
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:40:42 +0000 (09:40 +0000)]
LinuxKPI: add PCI_VENDOR_ID_ITTIM

Add PCI_VENDOR_ID_ITTIM as needed by mt76.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 months agoFix the logic which determines if the destination Q variable can represent the source...
Lawrence Stewart [Tue, 2 Apr 2024 05:07:04 +0000 (16:07 +1100)]
Fix the logic which determines if the destination Q variable can represent the source Q variable's value with full accuracy.

The new logic is mostly self explanatory except for the value fit checks.

If b has fewer integer bits than a, 0 == (Q_GIABSVAL(a) & (~Q_TC(a, 0) << Q_NIBITS(b))) is checking that a's integer value does not have high-order bits set above what b is capable of storing.

If b has fewer fractional bits than a, 0 == (Q_GFABSVAL(a) & ~(~Q_TC(a, 0) << (Q_NFBITS(a) - Q_NFBITS(b))))) is checking that a's fractional value does not have low-order bits set below what b is capable of storing.

Obtained from: Netflix, Inc.
MFC afer: 1 week

2 months agofwget: Add needed firmware for Radeon 780M GPU
Philipp Ost [Tue, 2 Apr 2024 05:38:00 +0000 (07:38 +0200)]
fwget: Add needed firmware for Radeon 780M GPU

PR: 278115

2 months agoptrace tests: Fix a signed/unsigned integer comparison
Mark Johnston [Mon, 1 Apr 2024 23:10:36 +0000 (19:10 -0400)]
ptrace tests: Fix a signed/unsigned integer comparison

Reported by: Jenkins
Fixes: 43b4da44118e ("ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee")

2 months agotcp hpts: improve consistency
Michael Tuexen [Mon, 1 Apr 2024 19:51:59 +0000 (21:51 +0200)]
tcp hpts: improve consistency

The target_slot argument of max_slots_available() can be NULL.
Therefore, check for this in all places.
Right now, all callers provide non-NULL pointer.

Reported by: Coverity Scan
CID: 1527732
Reviewed by: rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44527

2 months agocp: Improved conformance when copying directories.
Dag-Erling Smørgrav [Mon, 1 Apr 2024 17:28:58 +0000 (19:28 +0200)]
cp: Improved conformance when copying directories.

* When copying a directory, if the destination exists and is not a
  directory, we would previously emit an error message and exit.  The
  correct behavior according to POSIX is to emit an error message and
  continue without descending further into the source directory.

* When copying a directory, if the destination does not exist and we
  fail to create it, we would previously emit an error message and
  exit.  The correct behavior according to POSIX is to emit an error
  message and continue.  Whether to descend further into the source
  directory is explicitly left unspecified; GNU cp does not, which
  seems to me to be the safer and less surprising option, so let's not
  either.

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

2 months agocp: Correct the list of non-portable flags.
Dag-Erling Smørgrav [Mon, 1 Apr 2024 17:28:53 +0000 (19:28 +0200)]
cp: Correct the list of non-portable flags.

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

2 months agowg: Use ENETUNREACH when transmitting to a non-existent peer
Mark Johnston [Mon, 1 Apr 2024 17:20:55 +0000 (13:20 -0400)]
wg: Use ENETUNREACH when transmitting to a non-existent peer

The old errno value used is specifically for Capsicum and shouldn't be
co-opted in this way.  It has special handling in the generic syscall
layer (see syscallret()).  OpenBSD returns ENETUNREACH in this case;
let's do the same thing.

Reviewed by: kevans, imp
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44582

2 months agousr.bin: Make lorder conditional on MK_TOOLCHAIN.
Dag-Erling Smørgrav [Mon, 1 Apr 2024 13:18:35 +0000 (15:18 +0200)]
usr.bin: Make lorder conditional on MK_TOOLCHAIN.

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

2 months agoif_bridge: use IF_MINMTU
Eugene Grosbein [Mon, 1 Apr 2024 03:31:51 +0000 (10:31 +0700)]
if_bridge: use IF_MINMTU

Replace incorrect constant 576 with IF_MINMTU to check for minumum MTU.
This unbreaks bridging tap interfaces with small mtu.

MFC after: 1 week

2 months agosnd_hdspe(4): Only buffer_copy() audio data once.
Florian Walpen [Sun, 31 Mar 2024 19:14:16 +0000 (20:14 +0100)]
snd_hdspe(4): Only buffer_copy() audio data once.

Instead of blindly copying two periods of audio data to and from DMA
buffers, keep track of the writing position and derive the actual
part of audio data that needs to be copied.
This approximately halves the number of samples copied in total.

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

2 months agomountd.c: Add warning messages for administrative controls
Rick Macklem [Sun, 31 Mar 2024 19:00:08 +0000 (12:00 -0700)]
mountd.c: Add warning messages for administrative controls

When "administrative controls" (which are exports of subdirectories
within a NFS server's local file system) are used, they export the
entire local server file system. (The subdirectory only applies to
the Mount protocol used for NFSv3 mounts.)

To minimize the risk that this causes confusion w.r.t. what is exported
to NFS client(s), this patch generates warning messages for these.
Only one message is generated for each server local file system.
The messages can be silenced via a new "-A" command line option.

The mountd.8 man page will be patched via a separate commit.

Reviewed by: emaste, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44502

2 months agobsd-family-tree: remove EoL whitespace
Maxim Konovalov [Sun, 31 Mar 2024 18:36:03 +0000 (18:36 +0000)]
bsd-family-tree: remove EoL whitespace

2 months agobsd-family-tree: add NetBSD 10.0
Maxim Konovalov [Sun, 31 Mar 2024 18:35:02 +0000 (18:35 +0000)]
bsd-family-tree: add NetBSD 10.0

2 months agokern linker: Don't invoke dtors without having invoked ctors
Mark Johnston [Sun, 31 Mar 2024 18:14:02 +0000 (14:14 -0400)]
kern linker: Don't invoke dtors without having invoked ctors

I have a kernel module which fails to load because of an unrecognized
relocation type.  link_elf_load_file() fails before the module's ctors
are invoked and it calls linker_file_unload(), which causes the module's
dtors to be executed, resulting in a kernel panic.

Add a flag to the linker file to ensure that dtors are not invoked if
unloading due to an error prior to ctors being invoked.

At the moment I only implemented this for link_elf_obj.c since
link_elf.c doesn't invoke dtors, but I refactored link_elf.c to make
them more similar.

Fixes: 9e575fadf491 ("link_elf_obj: Invoke fini callbacks")
Reviewed by: zlei, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44559

2 months agoptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee
Mark Johnston [Sun, 31 Mar 2024 18:11:47 +0000 (14:11 -0400)]
ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee

This exercises the bug fix in commit 9241ebc796c1
("thread_single(9): decline external requests for traced or debugger-stopped procs").

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

2 months agotar: make error reporting more robust and use correct errno
Ed Maste [Sun, 31 Mar 2024 14:37:38 +0000 (10:37 -0400)]
tar: make error reporting more robust and use correct errno

Apply upstream pull request 2101.

2 months agosound: Implement asynchronous device detach
Christos Margiolis [Sun, 31 Mar 2024 14:13:43 +0000 (22:13 +0800)]
sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application closes the device's file descriptor, or the channel
automatically times out after hw.snd.timeout seconds. In the case of a
detach however, the timeout approach is still not ideal, since we want
all resources to be released immediatelly, without waiting for N seconds
until we can use the bus again.

The timeout mechanism works by calling chn_sleep() in chn_read() and
chn_write() (see pcm/channel.c) in order to send the thread to sleep,
using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag
while waiting for cv_timedwait_sig() to return, we can test this flag in
pcm_unregister() (called during detach) and wakeup the sleeping
thread(s) to immediately kill the channel(s) being consumed.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months
PR: 194727, 278055, 202275, 220949, 272286
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D43545

2 months agosound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)
Christos Margiolis [Sun, 31 Mar 2024 05:20:17 +0000 (13:20 +0800)]
sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)

Currently the snd_clone framework creates device nodes on-demand for
every channel, through the dsp_clone() callback, and is responsible for
routing audio to the appropriate channel(s). This patch gets rid of the
whole snd_clone framework (including any related sysctls) and instead
uses DEVFS_CDEVPRIV(9) to handle device opening, channel allocation and
audio routing. This results in a significant reduction in code size as
well as complexity.

Behavior that is preserved:

- hw.snd.basename_clone.
- Exclusive access of an audio device (i.e VCHANs disabled).
- Multiple processes can read from/write to the device.
- A device can only be opened as many times as the maximum allowed
  channel number (see SND_MAXHWCHAN in pcm/sound.h).
- OSSv4 compatibility aliases are preserved.

Behavior changes:

Only one /dev/dspX device node is created (on attach) for each audio
device, as opposed to the current /dev/dspX.Y devices created by
snd_clone. According to the sound(4) man page, devices are not meant to
be opened through /dev/dspX.Y anyway, so it is best if we do not create
device nodes for them in the first place. As a result of this, modify
dsp_oss_audioinfo() to print /dev/dspX in the "ai->devnode", instead of
/dev/dspX.Y.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D44411

2 months agozfs: merge openzfs/zfs@39be46f43
Martin Matuska [Sat, 30 Mar 2024 21:14:52 +0000 (22:14 +0100)]
zfs: merge openzfs/zfs@39be46f43

Notable upstream pull request merges:
 #15509 b1e46f869 Add ashift validation when adding devices to a pool
 #15927 45e23abed Update resume token at object receive
 #15941 bf8f72359 BRT: Skip duplicate BRT prefetches
 #15950 8cd8ccca5 BRT: Skip getting length in brt_entry_lookup()
 #15951 80cc51629 ZAP: Massively switch to _by_dnode() interfaces
 #15954 2c01cae8b BRT: Change brt_pending_tree sorting order
 #15955 4616b96a6 BRT: Relax brt_pending_apply() locking
 #15959 5c4a4f82c zio: update ZIO type x stage documentation
 #15962 493fcce9b Provide macros for setting and getting blkptr birth times
 #15963 90ff73235 freebsd: fix missing headers in distribution tarball
 #15967 f68bde723 BRT: Make BRT block sizes configurable
 #15976 c28f94f32 ZAP: Some cleanups/micro-optimizations
 #15995 cfb96c772 vdev_disk: clean up spa/bdev mode conversion
 #16006 c0aab8b8f zvols: prevent overflow of minor device numbers
 #16007 a89d209bb BRT: Fix holes cloning
 #16008 c9d8f6c59 Fix option string, adding -e and fixing order

Obtained from: OpenZFS
OpenZFS commit: 39be46f43f96fb7420386d03751b01f5cb376d6b

2 months agoarm64: enable superpage mappings by pmap_mapdev{,_attr}()
Alan Cox [Sat, 30 Mar 2024 20:35:32 +0000 (15:35 -0500)]
arm64: enable superpage mappings by pmap_mapdev{,_attr}()

In order for pmap_kenter{,_device}() to create superpage mappings,
either 64 KB or 2 MB, pmap_mapdev{,_attr}() must request appropriately
aligned virtual addresses.

Reviewed by: markj
Tested by: gallatin
Differential Revision: https://reviews.freebsd.org/D42737

2 months agoarm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]
Eliot Solomon [Sun, 24 Mar 2024 19:01:47 +0000 (14:01 -0500)]
arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]

The ATTR_CONTIGUOUS bit within an L3 page table entry designates that
L3 page as being part of an aligned, physically contiguous collection
of L3 pages.  For example, 16 aligned, physically contiguous 4 KB pages
can form a 64 KB superpage, occupying a single TLB entry.  While this
change only creates ATTR_CONTIGUOUS mappings in a few places,
specifically, the direct map and pmap_kenter{,_device}(), it adds all
of the necessary code for handling them once they exist, including
demotion, protection, and removal.  Consequently, new ATTR_CONTIGUOUS
usage can be added (and tested) incrementally.

Modify the implementation of sysctl vm.pmap.kernel_maps so that it
correctly reports the number of ATTR_CONTIGUOUS mappings on machines
configured to use a 16 KB base page size, where an ATTR_CONTIGUOUS
mapping consists of 128 base pages.

Additionally, this change adds support for creating L2 superpage
mappings to pmap_kenter{,_device}().

Reviewed by: markj
Tested by: gallatin
Differential Revision: https://reviews.freebsd.org/D42737

2 months agothread_single(9): decline external requests for traced or debugger-stopped procs
Konstantin Belousov [Wed, 27 Mar 2024 12:29:25 +0000 (14:29 +0200)]
thread_single(9): decline external requests for traced or debugger-stopped procs

Debugger has the powers to cause unbound delay in single-threading,
which then blocks the threaded taskqueue.  The reproducer is
`truss -f timeout 2 sleep 10`.

Reported by: mjg
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44523

2 months agopkgbase: Remove FreeBSD-ipfilter package
Emmanuel Vadot [Sat, 30 Mar 2024 08:36:35 +0000 (09:36 +0100)]
pkgbase: Remove FreeBSD-ipfilter package

Put the periodic script for ipfilter in the FreeBSD-ipf package with
all the utilities.

PR: 278042
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 months agodts: Fix arm dts path for marvell too
Bjoern A. Zeeb [Sat, 30 Mar 2024 02:31:32 +0000 (02:31 +0000)]
dts: Fix arm dts path for marvell too

Linux 6.5 moved to a vendor-based subdirectory for arm DTS, change
our Makefiles accordingly.

This makes universe also compile arm.armv7 ARMADA38X sucessfully.

2 months agoLinux 5.18+ compat: Detect filemap_range_has_page
Robert Evans [Sat, 30 Mar 2024 00:11:52 +0000 (20:11 -0400)]
Linux 5.18+ compat: Detect filemap_range_has_page

In v5.18 `filemap_range_has_page` moved to `pagemap.h`

`pagemap.h` has been around since 3.10 so just include both

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #16034

2 months agovf_i2c: update I2C controller logic
Pierre-Luc Drouin [Fri, 22 Mar 2024 22:13:04 +0000 (22:13 +0000)]
vf_i2c: update I2C controller logic

Update the I2C controller logic to be more consistent with the
newer version of the controller reference manual.
This makes it work better on modern LS/LX platforms and avoids
unnecessary delays.  Also fixes a lock leak.

MFC after: 7 days
Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI)
Differential Revision: https://reviews.freebsd.org/D44021

2 months agovf_i2c: split up and add ACPI attachments in addition to FDT
Pierre-Luc Drouin [Fri, 22 Mar 2024 22:12:07 +0000 (22:12 +0000)]
vf_i2c: split up and add ACPI attachments in addition to FDT

Move the code from the arm specific to the iicbus controller directory.
Split up between general logic and bus attachment code.
Add support for ACPI attachment in addition to FDT.

MFC after: 7 days
Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI)
Based on: D24917 by Val Packett (initial early version)
Differential Revision: https://reviews.freebsd.org/D44020

2 months agoFix buffer underflow if sysfs file is empty
Robert Evans [Fri, 29 Mar 2024 21:59:23 +0000 (17:59 -0400)]
Fix buffer underflow if sysfs file is empty

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Jason Lee <jasonlee@lanl.gov>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #16028
Closes #16035

2 months agovdev_disk: clean up spa/bdev mode conversion
Rob N [Fri, 29 Mar 2024 21:51:33 +0000 (08:51 +1100)]
vdev_disk: clean up spa/bdev mode conversion

43e8f6e37 introduced a subtle API misuse, in that it passed the output
from vdev_bdev_mode() back into itself. Fortunately, the
SPA_MODE_(READ|WRITE) bit values exactly map to the FMODE_(READ|WRITE) &
BLK_OPEN_(READ|WRITE) bit values, so it didn't result in a bug, but it
was hard to read and understand, so I cleaned it up.

In doing so, I noticed that the only call to vdev_bdev_mode() without
the "exclusive" flag set was in that misuse, and actually, we never do a
non-exclusive blkdev_get_by_path(). So I've just made exclusive be
always-on.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #15995

2 months agozvols: prevent overflow of minor device numbers
Fabian-Gruenbichler [Fri, 29 Mar 2024 21:37:40 +0000 (22:37 +0100)]
zvols: prevent overflow of minor device numbers

currently, the linux kernel allows 2^20 minor devices per major device
number.  ZFS reserves blocks of 2^4 minors per zvol: 1 for the zvol
itself, the other 15 for the first partitions of that zvol. as a result,
only 2^16 such blocks are available for use.

there are no checks in place to avoid overflowing into the major device
number when more than 2^16 zvols are allocated (with volmode=dev or
default). instead of ignoring this limit, which comes with all sorts of
weird knock-on effects, detect this situation and simply fail allocating
the zvol block device early on.

without this safeguard, the kernel will reject the attempt to create an
already existing block device, but ZFS doesn't handle this error and
gets confused about which zvol occupies which minor slot, potentially
resulting in kernel NULL derefs and other issues later on.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Closes #16006

2 months agolinux: make linux_netlink_p->msg_from_linux be able to fail
Gleb Smirnoff [Fri, 29 Mar 2024 20:35:51 +0000 (13:35 -0700)]
linux: make linux_netlink_p->msg_from_linux be able to fail

The KPI for this function was misleading.  From the NetLink perspective it
looked like a function that: a) allocates new hdr, b) can fail.  Neither
was true.  Let the function return a error code instead of returning the
same hdr it was passed to.  In case if future Linux NetLink compatibility
support calls for reallocating header, pass hdr as pointer to pointer.

With KPI that returns a error, propagate domain conversion errors all the
way up to NetLink module.  This fixes panic when unknown domain is
converted to 0xff and this invalid value is passed into NetLink
processing.

PR: 274536
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D44392

2 months agolinux: use sa_family_t for address family conversions
Gleb Smirnoff [Fri, 29 Mar 2024 20:35:37 +0000 (13:35 -0700)]
linux: use sa_family_t for address family conversions

Express "conversion failed" with maximum possible value.  This allows to
reduce number of size/signedness conversion in the code that utilizes the
functions.

PR: 274536
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D44375

2 months agoif_tuntap: simplify storage of per-vnet cloners
Gleb Smirnoff [Fri, 29 Mar 2024 19:35:41 +0000 (12:35 -0700)]
if_tuntap: simplify storage of per-vnet cloners

There is no need for a separate structure neither for a linked list.
Provide each VNET with an array of pointers to if_clone that has the same
size as the driver list.

Reviewed by: zlei, kevans, kp
Differential Revision: https://reviews.freebsd.org/D44307

2 months agokern_ctf.c: Don't print out warning messages unconditionally
Bojan Novković [Fri, 29 Mar 2024 19:17:19 +0000 (20:17 +0100)]
kern_ctf.c: Don't print out warning messages unconditionally

The kernel CTF loading routines print various warnings when attempting
to load CTF data from an ELF file. After the changes in c21bc6f3c242
those warnings are unnecessarily printed for each kernel module
that was compiled without CTF data.

The kernel linker already uses the bootverbose flag to conditionally
print CTF loading errors. This patch alters kern_ctf.c
routines to do the same.

Reported by: Alexander@leidinger.net
Approved by: markj (mentor)
Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing")
2 months agobuild: Do not pass -fno-sanitize-memory-param-retval to subr_coverage.c
Mark Johnston [Sat, 23 Dec 2023 00:24:48 +0000 (19:24 -0500)]
build: Do not pass -fno-sanitize-memory-param-retval to subr_coverage.c

In the absence of -fsanitize=kernel-memory, the presence of this flag
results in a -Wunused-command-line-argument warning.

MFC after: 1 week

2 months agoinpcb: fully retire inp_ppcb pointer
Gleb Smirnoff [Fri, 29 Mar 2024 19:16:59 +0000 (12:16 -0700)]
inpcb: fully retire inp_ppcb pointer

Before a protocol specific control block started to embed inpcb in self
(see 0aa120d52f3ce68b3792440c483fe96511ec) this pointer used to point
at it.

Retain kf_sock_inpcb field in the struct kinfo_file in <sys/user.h>.  The
exp-run detected a minimal use of the field in ports:
  * sysutils/lsof - patched upstream
  * net-mgmt/netdata  - patch accepted upstream
  * emulators/qemu-user-static - upstream master branch seems not using
    the field anymore
We can keep the field around for some time, but eventually it may be
reused for something else.

PR: 277659 (exp-run)
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D44491

2 months agoAdd ashift validation when adding devices to a pool
George Wilson [Fri, 29 Mar 2024 19:15:56 +0000 (15:15 -0400)]
Add ashift validation when adding devices to a pool

Currently, zpool add allows users to add top-level vdevs that have
different ashifts but doing so prevents users from being able to
perform a top-level vdev removal. Often times consumers may not realize
that they have mismatched ashifts until the top-level removal fails.

This feature adds ashift validation to the zpool add command and will
fail the operation if the sector size of the specified vdev does not
match the existing pool. This behavior can be disabled by using the -f
flag. In addition, new flags have been added to provide fine-grained
control to disable specific checks. These flags
are:

--allow-in-use
--allow-ashift-mismatch
--allow-replicaton-mismatch

The force flag will disable all of these checks.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Mark Maybee <mmaybee@delphix.com>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #15509

2 months agoLinuxKPI: remove dummy header files with implementation
Bjoern A. Zeeb [Fri, 29 Mar 2024 19:07:58 +0000 (19:07 +0000)]
LinuxKPI: remove dummy header files with implementation

All three files now have an implementation so we no longer need the
"dummy" versions.

Sponsored by: The FreeBSD Foundation

2 months agopcm.4: Showcase default device change using mixer(8)
Christos Margiolis [Fri, 29 Mar 2024 15:59:55 +0000 (23:59 +0800)]
pcm.4: Showcase default device change using mixer(8)

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44556

2 months agosound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants
Christos Margiolis [Fri, 29 Mar 2024 15:32:38 +0000 (23:32 +0800)]
sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44554

2 months agosound: Fix SND_DIAGNOSTIC ifdef comment
Christos Margiolis [Fri, 29 Mar 2024 15:32:13 +0000 (23:32 +0800)]
sound: Fix SND_DIAGNOSTIC ifdef comment

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44555

2 months agosound: Get rid of pcm/sndstat.h and turn macros into regular code
Christos Margiolis [Fri, 29 Mar 2024 15:29:43 +0000 (23:29 +0800)]
sound: Get rid of pcm/sndstat.h and turn macros into regular code

There is no reason to have macros for this. Putting the code in
sndstat_prepare_pcm() directly makes it easier to work with it.

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44545

2 months agosound: Drain buffer selinfo in sndbuf_free()
Christos Margiolis [Fri, 29 Mar 2024 15:29:23 +0000 (23:29 +0800)]
sound: Drain buffer selinfo in sndbuf_free()

Prevent a use-after-free in kern_poll() by making sure the buffer's
selinfo is drained. This is required for a subsequent patch that
implements asynchronous audio device detach.

Reported by: KASAN
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44544

2 months agorelease.sh: Don't install git if already present
Colin Percival [Fri, 29 Mar 2024 07:10:50 +0000 (00:10 -0700)]
release.sh: Don't install git if already present

Prior to this commit, we install git from ports if there is a ports
tree available and git is not installed, and we install git from pkg
otherwise -- including the case where git is already installed.

Rework the logic to not (re)install git at all if it is already
installed.

MFC after: 3 days

2 months agovtnet: set VNET context in RX handler
Gleb Smirnoff [Thu, 28 Mar 2024 21:12:39 +0000 (14:12 -0700)]
vtnet: set VNET context in RX handler

The context is required for NIC-level pfil(9) filtering.

2 months agopfilctl: fix 'pfilctl hooks' when nothing is connected
Gleb Smirnoff [Thu, 28 Mar 2024 21:10:15 +0000 (14:10 -0700)]
pfilctl: fix 'pfilctl hooks' when nothing is connected

The 'hooks' command actually worked accidentially until now.  It used
PFILIOC_LISTHEADS to determine current number of hooks.  This worked when
at least one head had a hook connected to it.

2 months agoFix style nits in kern_linker.c
Bojan Novković [Thu, 28 Mar 2024 19:36:30 +0000 (20:36 +0100)]
Fix style nits in kern_linker.c

Reported by: jrtc27
Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing")
Approved by: markj (mentor)

2 months agoddb: Drop obsolete -FreeBSD identifier from license
Bojan Novković [Thu, 28 Mar 2024 19:32:52 +0000 (20:32 +0100)]
ddb: Drop obsolete -FreeBSD identifier from license

Reported by: jrtc27
Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing")
Approved by: markj (mentor)

2 months agokerneldump: Add flag to indicate kernel core was successfully dumped
Stephen J. Kiernan [Wed, 27 Mar 2024 22:55:21 +0000 (18:55 -0400)]
kerneldump: Add flag to indicate kernel core was successfully dumped

This allows for shutdown_final EVENTHANDLERs to know that a core dump
successfully occurred. Embedded systems may want to record this fact
or act on it.

Obtained from: Juniper Networks, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44542

2 months agostand/efi: Changes to efichar to allow it to be used in the kernel
Stephen J. Kiernan [Wed, 27 Mar 2024 22:37:48 +0000 (18:37 -0400)]
stand/efi: Changes to efichar to allow it to be used in the kernel

Replace malloc/free with EFICHAR_MALLOC and EFICHAR_FREEE macros.

Obtained from: Juniper Networks, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44541

2 months agopf: fix reply-to after rdr and dummynet
Kristof Provost [Wed, 27 Mar 2024 14:47:21 +0000 (15:47 +0100)]
pf: fix reply-to after rdr and dummynet

If we redirect a packet to localhost and it gets dummynet'd it may be
re-injected later (e.g. when delayed) which means it will be passed
through ip_input() again. ip_input() will then reject the packet because
it's directed to the loopback address, but did not arrive on a loopback
interface.

Fix this by having pf set the rcvif to V_iflo if we redirect to
loopback.

See also: https://redmine.pfsense.org/issues/15363
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 months agocp: Fix grammar in comment.
Dag-Erling Smørgrav [Thu, 28 Mar 2024 14:06:37 +0000 (15:06 +0100)]
cp: Fix grammar in comment.

This reverts commit 416fdc2d71656e2f0b4a16828fb0c736ae32b74a.

2 months agoOptimize HPTS so that little work is done until we have a hpts thread that is over...
Randall Stewart [Thu, 28 Mar 2024 12:12:37 +0000 (08:12 -0400)]
Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold

HPTS inserts a softclock for system call return that optimizes performance. However when
no HPTS threads need the help (i.e. when they have less than 100 or so connections) then
there should be little work done i.e. check the counter and return instead of running through
all the threads getting locks etc.ptimize HPTS so that little work is done until we have a hpts
thread that is over the connection threshold.

Reported by:    eduardo
Reviewed by:    gallatin, glebius, tuexen
Tested by:      gallatin
Differential Revision: https://reviews.freebsd.org/D44420

2 months agox86: handle MXCSR from XSAVEOPT when x87 state was optimized
Konstantin Belousov [Wed, 27 Mar 2024 11:01:44 +0000 (13:01 +0200)]
x86: handle MXCSR from XSAVEOPT when x87 state was optimized

PR: 275322
Reported by: Cheyenne Wills <cheyenne.wills@gmail.com>
Reviewed by: emaste, jhb, olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44522

2 months agoarm: Remove TI from NOTES
Emmanuel Vadot [Thu, 28 Mar 2024 06:27:10 +0000 (07:27 +0100)]
arm: Remove TI from NOTES

TI support was removed so remove it from NOTES too.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 months agoinclude: Allow SDESTDIR to be overridden
Stephen J. Kiernan [Wed, 27 Mar 2024 22:13:00 +0000 (18:13 -0400)]
include: Allow SDESTDIR to be overridden

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44540

2 months agolibmagic: Use HOST_CC when compiling hostprog used by build
Stephen J. Kiernan [Wed, 27 Mar 2024 22:02:32 +0000 (18:02 -0400)]
libmagic: Use HOST_CC when compiling hostprog used by build

The "mkmagic" program should be built with the host compiler.

Only use BTOOLSPATH if not building for host

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44539

2 months agocsh: Use HOST_CC when compiling hostprog used by csh build
Stephen J. Kiernan [Wed, 27 Mar 2024 21:31:40 +0000 (17:31 -0400)]
csh: Use HOST_CC when compiling hostprog used by csh build

The "gethost" program should be built with the host compiler.

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44537

2 months agosys.mk: Define HOST_CC as CC by default.
Stephen J. Kiernan [Wed, 27 Mar 2024 21:25:28 +0000 (17:25 -0400)]
sys.mk: Define HOST_CC as CC by default.

This allows for setting a different compiler for building hostprogs
when cross compiling.

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44536

2 months agoZTS: fix flakiness in cp_files_002_pos
Robert Evans [Wed, 27 Mar 2024 21:59:16 +0000 (17:59 -0400)]
ZTS: fix flakiness in cp_files_002_pos

Fix RANDOM to not return zero.

Overwriting with `dd ... count=0` does not test anything.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #16029

2 months agoBRT: Check pool clone stats in more tests
Alexander Motin [Tue, 19 Mar 2024 17:08:05 +0000 (13:08 -0400)]
BRT: Check pool clone stats in more tests

This should allow to catch some leaks, if those happen.

While there fix some cosmetic issues.

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

2 months agoBRT: Fix tests to work on non-empty pools
Alexander Motin [Tue, 19 Mar 2024 16:25:14 +0000 (12:25 -0400)]
BRT: Fix tests to work on non-empty pools

It should not normally happen, but if it does, better to not fail
everything for no good reason, or it may be hard to debug.

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

2 months agoBRT: Fix holes cloning.
Alexander Motin [Mon, 18 Mar 2024 18:19:53 +0000 (14:19 -0400)]
BRT: Fix holes cloning.

 - When reading L0 block pointers handle buffers without ones and
without dirty records as a holes.  Those appear when dnode size
was increased, but the end was never written, so there are no new
indirection levels to store the pointers.  It makes no sense to
return EAGAIN here, since sync won't create new indirection levels
until there will be actual writes.
 - When cloning blocks set destination hole logical birth time
to the current TXG.  Otherwise if we are cloning over existing
data, newly created holes may not be properly replicated later.
Use BP_SET_BIRTH() when possible to not replicate its logic.

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

2 months agobsdinstall: draw attention to new network config options
Mike Karels [Wed, 27 Mar 2024 20:10:43 +0000 (15:10 -0500)]
bsdinstall: draw attention to new network config options

The network configuration options have changed in bsdinstall, with
an Auto option to proceed directly to DHCP and IPv6 autoconfig (which
is the default) as well as Manual (the old mode).  For users like me
that were used to hitting return automatically to select an interface,
but want manual configuration, attempt to call out the difference:
Change the menu caption to say "Please select a network interface
and configuration mode:" and not just an interface.

Reviewed by: jrtc27

2 months agoarm64: Delete stale comment
Jessica Clarke [Wed, 27 Mar 2024 19:43:38 +0000 (15:43 -0400)]
arm64: Delete stale comment

Fixes: 078a69abcbb8 ("Use a uint64_t to store the arm64 mpidr")