]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 months agoawk: Fix the tests
Warner Losh [Fri, 8 Mar 2024 05:40:43 +0000 (22:40 -0700)]
awk: Fix the tests

I'd forgotten that we have to adjust the stderr tests from
upstream. Remove the OK files. Also remove system-status.*.  These
restore the fixes I made in 517e52b6c21c which were lost when I imported
the last version of awk.

Also, force LANG to be C.UTF-8 when testing to ensure that stray lang
settings don't fail tests.

Sponsored by: Netflix

3 months agolibc/i386: don't attempt to export alloca
Brooks Davis [Thu, 7 Mar 2024 20:14:55 +0000 (20:14 +0000)]
libc/i386: don't attempt to export alloca

The assembly implementation was removed in 2006 (commit 3c03c7095e7e).

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

3 months agolibc/quad: narrow list of symbols exposed on i386
Brooks Davis [Thu, 7 Mar 2024 20:09:00 +0000 (20:09 +0000)]
libc/quad: narrow list of symbols exposed on i386

These symbols aren't present on i386 so don't try to expose them.

Given the structure of quad/Makefile.inc, it might make more sense to
have per-arch symbol maps here, but this is sufficent to build with
WITHOUT_UNDEFINED_VERSION on i386.

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

3 months agolibc/iconv: don't export nonexistant symbols
Brooks Davis [Thu, 7 Mar 2024 20:08:38 +0000 (20:08 +0000)]
libc/iconv: don't export nonexistant symbols

It's unclear to me that any of these symbols ever existed.  The ones
I've spot checked are only mentioned in the initial Citrus iconv import
(commit ad30f8e79bd1) and this code hasn't changed much over time.

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

3 months agoamend! if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed
Sumit Saxena [Thu, 7 Mar 2024 19:33:40 +0000 (19:33 +0000)]
amend! if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed

if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42956

3 months agoif_bnxt: Set 1G/10G baseT force speed as auto speeds
Chandrakanth Patil [Wed, 6 Mar 2024 13:23:04 +0000 (18:53 +0530)]
if_bnxt: Set 1G/10G baseT force speed as auto speeds

The firmware lacks support for manually setting 1G and 10G baseT speeds.
However, the driver can enable auto speed masks to achieve automatic configuration
at these speeds.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42960

3 months agoif_bnxt: 50G, 100G and 200G PAM4 support
Chandrakanth Patil [Wed, 6 Mar 2024 13:21:52 +0000 (18:51 +0530)]
if_bnxt: 50G, 100G and 200G PAM4 support

Add support for 50G, 100G and 200G PAM4 support

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42959

3 months agoif_bnxt: Pluggable Module Display Support
Sumit Saxena [Wed, 6 Mar 2024 13:21:21 +0000 (18:51 +0530)]
if_bnxt: Pluggable Module Display Support

This update enables the display of pluggable module information
to users via the ifconfig utility.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42958

3 months agoif_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller
Chandrakanth Patil [Wed, 6 Mar 2024 13:20:28 +0000 (18:50 +0530)]
if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller

The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42957

3 months agoif_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed
Chandrakanth Patil [Wed, 6 Mar 2024 13:18:41 +0000 (18:48 +0530)]
if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D429506

3 months agoif_bnxt: Update Firmware Header to Latest Version 1.10.2.136
Chandrakanth Patil [Wed, 6 Mar 2024 13:17:50 +0000 (18:47 +0530)]
if_bnxt: Update Firmware Header to Latest Version 1.10.2.136

Update Firmware Header to Latest Version 1.10.2.136.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42955

3 months agoif_bnxt: Update Maximum Configurable MTU from 9000 to 9600
Chandrakanth Patil [Wed, 6 Mar 2024 13:16:38 +0000 (18:46 +0530)]
if_bnxt: Update Maximum Configurable MTU from 9000 to 9600

Increasing the maximum configurable MTU from 9000 to 9600 to
align with the firmware's capability of handling an MTU up to 9600.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42954

3 months agoif_bnxt: Enabled support for 1G SX, CX, and LX forced speed settings
Chandrakanth Patil [Wed, 6 Mar 2024 13:15:32 +0000 (18:45 +0530)]
if_bnxt: Enabled support for 1G SX, CX, and LX forced speed settings

Enabled User Configuration of 1G Speed on Wh+ SFP28 Port with AOC
cable.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42953

3 months agoif_bnxt: Incorrect Labeling of Supported Medium in `ifconfig -m <inf>` Command
Chandrakanth Patil [Wed, 6 Mar 2024 13:14:27 +0000 (18:44 +0530)]
if_bnxt: Incorrect Labeling of Supported Medium in `ifconfig -m <inf>` Command

The 1G speed on DAC medium is incorrectly labeled as 1000baseT, it
should be 1000baseCX. Updated the label accordingly.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42952

3 months agonvme_sim: Add comment about the is_failed test
Warner Losh [Wed, 6 Mar 2024 21:30:01 +0000 (14:30 -0700)]
nvme_sim: Add comment about the is_failed test

We only see a request with a failed controller while we're in the
process of failing the controller. Add a comment to that effect.

Sponsored by: Netflix

3 months agoif_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug
Chandrakanth Patil [Wed, 6 Mar 2024 13:13:07 +0000 (18:43 +0530)]
if_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug

Currently, if a media type (e.g., DAC) is hot-plugged out and another type
(e.g., optical cable) is hot-plugged in, the new speed is not reflected in
ifconfig. This occurs when the driver fails to update speeds with unchanged
tx and rx flow control.

To fix, a phy_type check ensures update of phy speeds upon detecting the new
phy.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42951

3 months agonullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default
Seigo Tanimura [Mon, 4 Mar 2024 13:50:25 +0000 (22:50 +0900)]
nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default

Differential revision: https://reviews.freebsd.org/D44217
MFC after: 1 week

3 months agozfs: merge openzfs/zfs@8f2f6cd2a
Martin Matuska [Thu, 7 Mar 2024 09:49:48 +0000 (10:49 +0100)]
zfs: merge openzfs/zfs@8f2f6cd2a

Notable upstream pull request merges:
 #15887 -multiple Fast Dedup: Cleanup and documentation ahead of
                  integrating Fast Dedup
 #15907 5600dff0e Fixed parameter passing error when calling zfs_acl_chmod
 #15908 8f2f6cd2a ddt: reduce DDT_NAMELEN

Obtained from: OpenZFS
OpenZFS commit: 8f2f6cd2ac688916adb2caf979daf95365ccb48f

3 months agotarfs: Fix checksum on 32-bit platforms.
Dag-Erling Smørgrav [Thu, 7 Mar 2024 08:15:54 +0000 (09:15 +0100)]
tarfs: Fix checksum on 32-bit platforms.

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

3 months agobhyve/gdb: Avoid rebuilding target.xml for install targets
Mark Johnston [Thu, 7 Mar 2024 05:39:07 +0000 (00:39 -0500)]
bhyve/gdb: Avoid rebuilding target.xml for install targets

Otherwise it's impossible to install from a read-only objdir.

Fixes: f81cdf24ba54 ("bhyve: Add support for XML register definitions")
Reported by: olivier

3 months agodevd: Add directory information
Warner Losh [Thu, 7 Mar 2024 01:38:07 +0000 (18:38 -0700)]
devd: Add directory information

Devd searches /etc/devd and /usr/local/etc/devd by default (given the
default devd.conf file). Document that here.

Sponsored by: Netflix

3 months agodevd: Document the nvme devd events
Warner Losh [Thu, 7 Mar 2024 01:22:39 +0000 (18:22 -0700)]
devd: Document the nvme devd events

Nvme informs devd of smart and reset controller events. Document them.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44212

3 months agonvme: Add SMART WARNING for persistent memory region
Warner Losh [Thu, 7 Mar 2024 01:22:44 +0000 (18:22 -0700)]
nvme: Add SMART WARNING for persistent memory region

NVME 2.0 added persistent memory regions, and this bit reports critical
warnings / errors with those regions.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D44213

3 months agonvme: Log reset success or failure to devd
Warner Losh [Thu, 7 Mar 2024 01:22:34 +0000 (18:22 -0700)]
nvme: Log reset success or failure to devd

We're logging when we start a reset, but not when we complete it, nor
the result. Create now log a success or timed_out event for the reset.
Currently, the only detectable error we have from reset is 'failure to
become ready in time,' though the code looks like it might be more
generic. Log this and if we ever have other failure modes, change the
logging to devd when that happens.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44211

3 months agonvme: Change devctl events for the controller
Warner Losh [Thu, 7 Mar 2024 01:22:26 +0000 (18:22 -0700)]
nvme: Change devctl events for the controller

Change the devctl events slightly for the controller. SMART errors will
log the changed bits in the NVME SMART Critical Warning State as its
event.

Reset will now emit 'event=start'. Soon more.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D44210

3 months agonvme: split devctl out to its own function
Warner Losh [Thu, 7 Mar 2024 01:22:13 +0000 (18:22 -0700)]
nvme: split devctl out to its own function

Split the devctl aspect of things out to its own function in
nvme_ctrlr_devctl_log. In preparing to document this, and based on
actual use, we want something different for the SMART errors, so this
will facilitate that.

Sponsored by: Netflix
Reviewed by: chuck, mav
Differential Revision: https://reviews.freebsd.org/D44209

3 months agolibsys: don't expose __init_elf_aux_vector
Brooks Davis [Thu, 7 Mar 2024 01:02:25 +0000 (01:02 +0000)]
libsys: don't expose __init_elf_aux_vector

__init_elf_aux_vector is now complied statically so don't try to export
it from the dynamic library.

Fixes: 8271d9b99a3b libsys: remove usage of pthread_once and _once_stub

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

3 months agolibsys: don't try to expose yield
Brooks Davis [Thu, 7 Mar 2024 01:01:36 +0000 (01:01 +0000)]
libsys: don't try to expose yield

The undocumented yield system call has never been implemented via libc
or libsys (except accidentally for <15 minutes in 1998 between commits
abd529cebab9 and 0db2fac06ab7).  Avoid trying to export it now to avoid
failures when linking with --no-undefined-version.

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

3 months agosyscall(2): make i386 less of an outlier
Brooks Davis [Thu, 7 Mar 2024 00:59:07 +0000 (00:59 +0000)]
syscall(2): make i386 less of an outlier

Unlike other architectures, i386 only defined syscall() and not
_syscall() or __sys_syscall().  The syscall() function then invoked the
desired system call directly rather than invoking syscall(2).  Keep the
latter as it's marginally more efficent, but also create the
conventional _syscall() and __sys_syscall() stubs.

This avoids the need to special case syscall(2) in the symbol list
generation in libsys.

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

3 months agolibsys/aarch: Remove pointless MD syscall(2)
Brooks Davis [Thu, 7 Mar 2024 00:59:01 +0000 (00:59 +0000)]
libsys/aarch: Remove pointless MD syscall(2)

This file is functionally identical to the stub generated by
Makefile.sys once the MD version is removed.

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

3 months agolibsys/arm: Remove pointless MD syscall(2)
Brooks Davis [Thu, 7 Mar 2024 00:58:55 +0000 (00:58 +0000)]
libsys/arm: Remove pointless MD syscall(2)

This file is functionally identical to the stub generated by
Makefile.sys once the MD version is removed.

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

3 months agolibsys/riscv: Remove pointless MD syscall(2)
Brooks Davis [Thu, 7 Mar 2024 00:58:44 +0000 (00:58 +0000)]
libsys/riscv: Remove pointless MD syscall(2)

This file is functionally identical to the stub generated by
Makefile.sys once the MD version is removed.

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

3 months agolibsys/aarch64: end syscall stubs with newlines
Brooks Davis [Thu, 7 Mar 2024 00:58:29 +0000 (00:58 +0000)]
libsys/aarch64: end syscall stubs with newlines

Technically speaking, POSIX text files must end with a newline.

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

3 months agoheimdal: don't try to expose nonexistant symbols
Brooks Davis [Thu, 7 Mar 2024 00:55:11 +0000 (00:55 +0000)]
heimdal: don't try to expose nonexistant symbols

For one reason or another these symbols aren't present so don't try to
make them available for linkage.

In the case of libroken these seem to be compatability bits we don't
need a thus don't compile.  For others it seems to rot upstream, but
I've not investigated deeply.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D44246

3 months agoheimdal: don't export nonexistant _wind_ucs2read
Brooks Davis [Thu, 7 Mar 2024 00:54:55 +0000 (00:54 +0000)]
heimdal: don't export nonexistant _wind_ucs2read

This symbol table entry came in with the 1.5 import (commit
7c450da7b446), but the only other mention is a commented out entry in
lib/wind/libwind-exports.def.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D44245

3 months agoliblzma: don't export lzma_lz_decoder_uncompressed
Brooks Davis [Thu, 7 Mar 2024 00:54:22 +0000 (00:54 +0000)]
liblzma: don't export lzma_lz_decoder_uncompressed

It was removed in the 5.4.0 import.

Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D44247

3 months agobsearch_b: fix compilation with gcc
Brooks Davis [Wed, 6 Mar 2024 19:45:40 +0000 (19:45 +0000)]
bsearch_b: fix compilation with gcc

Reported by: rscheff
Differential Revision: https://reviews.freebsd.org/D44256

3 months agotimerfd_create: fix after cf742faa39a58a9b43b671c66097e6880459d4ae
Baptiste Daroussin [Wed, 6 Mar 2024 17:28:02 +0000 (18:28 +0100)]
timerfd_create: fix after cf742faa39a58a9b43b671c66097e6880459d4ae

Remove the include that crept in by accident
Clang complains about CLOCK_BOOTTIME being the same for now as
CLOCK_UPTIME, so remove CLOCK_BOOTTIME and leave a comment for
what to do when CLOCK_BOOTTIME will be different for real.

3 months agotimerfd_create: accept CLOCK_UPTIME/CLOCK_BOOTTIME
Baptiste Daroussin [Wed, 6 Mar 2024 14:11:32 +0000 (15:11 +0100)]
timerfd_create: accept CLOCK_UPTIME/CLOCK_BOOTTIME

This is a common use case when using timerfd_create to actually use
it with CLOCK_BOOTTIME on linux which is CLOCK_UPTIME for us.

Note that currently on freebsd CLOCK_BOOTTIME is CLOCK_UPTIME, but the
semantic is supposed to be different, this has to be fixed later.

Tested with the fnott notification software

Reviewed by: des, imp
Differential Revision: https://reviews.freebsd.org/D44253

3 months agotarfs: Factor out common test code.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:14:05 +0000 (17:14 +0100)]
tarfs: Factor out common test code.

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

3 months agotarfs: Fix checksum calculation.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:14:01 +0000 (17:14 +0100)]
tarfs: Fix checksum calculation.

The checksum code assumed that struct ustar_header filled an entire
block and calculcated the checksum based on the size of the structure.
The header is in fact only 500 bytes long while the checksum covers
the entire block (“logical record” in POSIX terms).  Add padding and
an assertion, and clean up the checksum code.

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

3 months agotarfs: Remove unnecessary hack and obsolete comment.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:13:57 +0000 (17:13 +0100)]
tarfs: Remove unnecessary hack and obsolete comment.

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

3 months agotarfs: Avoid overflow in exthdr calculation.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:13:54 +0000 (17:13 +0100)]
tarfs: Avoid overflow in exthdr calculation.

MFC after: 3 days
PR: 277420
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44202

3 months agotarfs: Improve validation of numeric fields.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:13:51 +0000 (17:13 +0100)]
tarfs: Improve validation of numeric fields.

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

3 months agotarfs: Fix two input validation issues.
Dag-Erling Smørgrav [Wed, 6 Mar 2024 16:13:42 +0000 (17:13 +0100)]
tarfs: Fix two input validation issues.

* Reject hard or soft links with an empty target path.  Currently, a
  debugging kernel will hit an assertion in tarfs_lookup_path() while
  a non-debugging kernel will happily create a link to the mount root.

* Use a temporary variable to store the result of the link target path,
  and copy it to tnp->other only once we have found it to be valid.
  Otherwise we error out after creating a reference to the target but
  before incrementing the target's reference count, which results in a
  use-after-free situation in the cleanup code.

* Correctly return ENOENT from tarfs_lookup_path() if the requested
  path was not found and create_dirs is false.  Luckily, existing
  callers did not rely solely on the return value.

MFC after: 3 days
PR: 277360
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44161

3 months agovmm.4: Add verbiage about need to load module from loader.conf
Michael Galassi [Wed, 6 Mar 2024 14:49:21 +0000 (06:49 -0800)]
vmm.4: Add verbiage about need to load module from loader.conf

PR: 277530
MFC after: 1 week
Co-authored-by: Mateusz Piotrowski <0mp@FreeBSD.org>

3 months agoif_bnxt: Correcting the firmware package version parsing logic
Sumit Saxena [Fri, 23 Feb 2024 08:20:26 +0000 (08:20 +0000)]
if_bnxt: Correcting the firmware package version parsing logic

The firmware package version currently appears as "Unknown" through
the sysctl interface. The parsing logic for extracting the firmware
package version from the package log has been modified to ensure
compatibility with all controllers.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42950

3 months agoRevert "md5.1: Fix an example"
Gordon Bergling [Wed, 6 Mar 2024 08:34:30 +0000 (09:34 +0100)]
Revert "md5.1: Fix an example"

This reverts commit 865baeaf1abeb14327ad6a4a1f8ce722e242ff73.

3 months agolibc posix_spawn(): explain why rtld can be used after fork
Konstantin Belousov [Wed, 6 Mar 2024 07:24:22 +0000 (09:24 +0200)]
libc posix_spawn(): explain why rtld can be used after fork

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 months agolibthr: remove explicit sys/cdefs.h includes
Konstantin Belousov [Wed, 6 Mar 2024 07:06:35 +0000 (09:06 +0200)]
libthr: remove explicit sys/cdefs.h includes

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 months agoposix_spawn.c: fix typo in comment
Konstantin Belousov [Wed, 6 Mar 2024 06:19:16 +0000 (08:19 +0200)]
posix_spawn.c: fix typo in comment

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 months agozfsd: Use vdev prop values for fault/degrade thresholds
Alan Somers [Tue, 5 Mar 2024 17:55:55 +0000 (10:55 -0700)]
zfsd: Use vdev prop values for fault/degrade thresholds

ZED uses vdev props for setting disk fault/degrade thresholds, this
patch enables zfsd to use the same vdev props for these same tasks.

OpenZFS on Linux is using vdev props for ZED disk fault/degrade
thresholds. Originally the thresholds supported were for io and checksum
events and recently this was updated to process slow io events as
well, see
https://github.com/openzfs/zfs/commit/cbe882298e4ddc3917dfaf239eca475fe06d62d4

This patch enables us to use the same vdev props in zfsd as ZED uses.
After this patch is merged both OSs will use the same vdev props to set
retirement thresholds.

It's probably important to note that the threshold defaults are
different between OS. I've kept the existing defaults inside zfsd and
DID NOT match them to what ZED does.

Differential Revision: https://reviews.freebsd.org/D44043
MFC after: 2 weeks
Relnotes: yes
Reviewed by: asomers, allanjude
Sponsored by: Axcient
Submitted by: Alek Pinchuk <apinchuk@axcient.com>

3 months agodiskinfo(8): introduce new option -l
Eugene Grosbein [Tue, 5 Mar 2024 17:23:41 +0000 (00:23 +0700)]
diskinfo(8): introduce new option -l

In modes -p or -s, add an option -l to start each line
with a device name separated with a tab. Update the manual page.
Add an example to list names with corresponding serial numbers:

diskinfo -ls /dev/da?

MFC after: 2 weeks

3 months agobsd-family-tree: add FreeBSD 13.3
Sergey A. Osokin [Tue, 5 Mar 2024 13:38:09 +0000 (08:38 -0500)]
bsd-family-tree: add FreeBSD 13.3

MFC after: 3 days

3 months ago.github: Switch to v4 of actions/checkout
John Baldwin [Tue, 5 Mar 2024 05:52:09 +0000 (21:52 -0800)]
.github: Switch to v4 of actions/checkout

GitHub is emitting a warning that v3 is deprecated due to using
Node.js 16.

3 months agoktrace: log genio events on failed write
Kyle Evans [Tue, 5 Mar 2024 04:14:07 +0000 (22:14 -0600)]
ktrace: log genio events on failed write

Visibility into the contents of the buffer when a write(2) has failed
can be immensely useful in debugging IPC issues -- pushing this to
discuss the idea, or maybe an alternative where we can set a flag like
KTRFAC_ERRIO to enable it.

When a genio event is potentially raised after an error, currently we'll
just free the uio and return.  However, such data can be useful when
debugging communication between processes to, e.g., understand what the
remote side should have grabbed before closing a pipe.  Tap out the
entire buffer on failure rather than simply discarding it.

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

3 months agokdump: decode pollfd struct arrays coming from poll(2)
Kyle Evans [Tue, 5 Mar 2024 04:14:06 +0000 (22:14 -0600)]
kdump: decode pollfd struct arrays coming from poll(2)

We'll handle these just as we do kevents, one per line with subsequent
lines indented sufficiently to distinguish them from the upcoming
return value.

Sample, with indentation stripped and revents changed to '...' in the
first one to keep the line length down:

CALL  poll(0x820610560,0x3,0)
STRU  struct pollfd[] = { { fd=0, events=0x1<POLLIN>, revents=0x11<...>
 { fd=1, events=0x4<POLLOUT>, revents=0x4<POLLOUT>}
 { fd=-1, events=0x4<POLLOUT>, revents=0} }
RET   poll 2

Reviewed by: bapt, jhb
Differential Revision: https://reviews.freebsd.org/D44160

3 months agolibsysdecode: add a decoder for pollfd events
Kyle Evans [Tue, 5 Mar 2024 04:14:06 +0000 (22:14 -0600)]
libsysdecode: add a decoder for pollfd events

We'll use this in another change to read pollfd arrays coming from a
successful poll(2) operation.

Reviewed by: bapt, jhb
Differential Revision: https://reviews.freebsd.org/D44159

3 months agokern: poll: tap out the pollfd array on successful return
Kyle Evans [Tue, 5 Mar 2024 04:14:06 +0000 (22:14 -0600)]
kern: poll: tap out the pollfd array on successful return

We do this in kern_poll() to include freebsd32 but exclude the linux
compat layer.  The ABI should be the same, but the POLL constants are
probably different or should be assumed so.

Reviewed by: bapt, jhb
Differential Revision: https://reviews.freebsd.org/D44158

3 months agopci_host_generic: Simplify generic_pcie_translate_resource
John Baldwin [Tue, 5 Mar 2024 04:53:21 +0000 (20:53 -0800)]
pci_host_generic: Simplify generic_pcie_translate_resource

Inline generic_pcie_translate_resource_common into its sole caller.
No functional change.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D44206

3 months agopci_host_generic: Pass a valid end address in generic_pcie_translate_resource
John Baldwin [Tue, 5 Mar 2024 04:52:54 +0000 (20:52 -0800)]
pci_host_generic: Pass a valid end address in generic_pcie_translate_resource

The generic_pcie_containing_range helper added in commit d79b6b8ec267
assumed that the passed in (start, end) range used to locate the
containing mapping range was a valid address range (with end >=
start).  The previous version of
generic_pcie_translate_resource_common only used the start address to
locate a mapping range, so the end address of 0 did not matter, but an
end of 0 now causes the first range to match and an incorrect
translation for resources using a later range.

PR: 277211
Reported by: dch, tuexen
Reviewed by: tuexen
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision: https://reviews.freebsd.org/D44205

3 months agoimgact_elf: Add const to the checknote parameter to __elfN(parse_notes)
John Baldwin [Tue, 5 Mar 2024 04:52:21 +0000 (20:52 -0800)]
imgact_elf: Add const to the checknote parameter to __elfN(parse_notes)

Reviewed by: imp, kib
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D44215

3 months agoimgact_elf: Add const to a few struct image_params pointers
Alex Richardson [Tue, 5 Mar 2024 04:51:49 +0000 (20:51 -0800)]
imgact_elf: Add const to a few struct image_params pointers

This makes it more obvious which functions modify fields in this struct.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D44214

3 months agotcp_rack.4: Remove a mentioned paper
Gordon Bergling [Tue, 5 Mar 2024 02:03:50 +0000 (03:03 +0100)]
tcp_rack.4: Remove a mentioned paper

The paper "T-RACKs: A Faster Recovery Mechanism for
TCP in Data Center Networks" has nothing to do with
our TCP RACK implementation, so remove it.

Reported by: tuexen
MFC after: 3 days

3 months agolibc: actually build bsearch_b
Brooks Davis [Tue, 5 Mar 2024 01:01:56 +0000 (01:01 +0000)]
libc: actually build bsearch_b

Fixes: 46cdc14062f7 Add support for some block functions ...

Reviewed by: theraven
Differential Revision: https://reviews.freebsd.org/D44189

3 months agolibc/locale: don't expose nonexistant __collate_load_error
Brooks Davis [Tue, 5 Mar 2024 01:00:50 +0000 (01:00 +0000)]
libc/locale: don't expose nonexistant __collate_load_error

The private symbol __collate_load_error was removed in 2015 in commit
2a6abeebef96.  While it had previously been accidently removed in 2011
(commit 3c87aa1d3dc1a) and restored in 2012 (commit bb4317bf3c99) I
think it's time to write it off after four major releases without it.

Fixes: 2a6abeebef96 The collate functions within libc have...

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D44182

3 months agoMerge commit f800c1f3b207 from llvm-project (by Arthur Eubanks):
Dimitry Andric [Mon, 4 Mar 2024 20:30:54 +0000 (21:30 +0100)]
Merge commit f800c1f3b207 from llvm-project (by Arthur Eubanks):

  [PEI] Don't zero out noreg operands

  A tail call may have $noreg operands.

  Fixes a crash.

  Reviewed By: xgupta

  Differential Revision: https://reviews.llvm.org/D156485

This should fix an assertion failure building qemu, specifically those
parts using -fzero-call-used-regs.

Reported by: Daniel Berrangé <dan-freebsd@berrange.com>
PR: 277474
MFC after: 3 days

3 months agoimgact_elf: Add const to the header_supported callback arguments
Alex Richardson [Mon, 4 Mar 2024 19:52:21 +0000 (11:52 -0800)]
imgact_elf: Add const to the header_supported callback arguments

This callback shouldn't be modifying any of the arguments.

Reviewed by: imp, kib, emaste, jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D44193

3 months agoAdd a missing space in a warning.
Hartmut Brandt [Mon, 4 Mar 2024 17:58:05 +0000 (18:58 +0100)]
Add a missing space in a warning.

3 months agoriscv: catch up with EARLY_PRINTF changes
Mitchell Horne [Mon, 4 Mar 2024 18:45:17 +0000 (14:45 -0400)]
riscv: catch up with EARLY_PRINTF changes

On this platform early console access is possible via SBI. Follow recent
changes to EARLY_PRINTF option and give it a named constant.

Update the commented option in GENERIC so that it compiles.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44100

3 months agohostapd: Work around lack of MLME support
Cy Schubert [Tue, 27 Feb 2024 03:34:09 +0000 (19:34 -0800)]
hostapd: Work around lack of MLME support

hostap MLME uses Linux data structures and definitions not available
in FreeBSD. The ability for hostapd to select the frequency (channel)
depends Linux MLME, though strictly it's not required. Work around the
Linux MLME requirement to configure device frequency.

The detailed description is: hostapd will only set the channel (frequency)
when Linux MLME is configured. Enabling NEED_AP_MLME will result in
numerous build errors due do Linux data structures and definitions not
available under FreeBSD. The code to set the frequency from the selected
channel is only within the NEED_AP_MLME code path because without MLME,
hostapd_get_hw_features() is an inline that always returns -1 whereas with
MLME hostapd_get_hw_features() will obtain hardware features from the
kernel. Until such time we simply set the frequency as configured.

PR: 276375
MFC after: 1 month

3 months agoLinuxKPI: Queue skbuffs at tail in __skb_queue_tail
Tom Coldrick [Sat, 2 Mar 2024 19:22:55 +0000 (14:22 -0500)]
LinuxKPI: Queue skbuffs at tail in __skb_queue_tail

Correct skb_queue_tail to queue the buffer at the tail of the skbuff.
The skbuff is a circular doubly-linked list, and we call with a pointer
to the head of the list.  Thus queueing before the head gives us a
queueing at the tail.

As a motivating factor, the current behaviour (queueing at the head) was
causing frequent kernel panics from my RTL8822BE wireless card, which
uses the rtw88 driver.  Interrupts can cause buffers to be added to the
rtwdev c2h_queue while the queue is being drained in rtw_c2h_work.
Queueing at the head would leave the nascent entry in the linked list
pointing to the old, now freed, memory for the buffer being processed.
When rtw_c2h_work is next called, we try reading this and so panic.

Reviewed by: emaste, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44192

3 months agoposix_spawn(3): document POSIX_SPAWN_DISABLE_ASLR_NP
Konstantin Belousov [Sun, 3 Mar 2024 22:19:22 +0000 (00:19 +0200)]
posix_spawn(3): document POSIX_SPAWN_DISABLE_ASLR_NP

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 months agoposix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NP
Konstantin Belousov [Sun, 3 Mar 2024 13:30:04 +0000 (15:30 +0200)]
posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NP

similar to Apple _POSIX_SPAWN_DISABLE_ASLR

Reviewed by: emaste, kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44195

3 months agoposix_spawnattr_setflags(3): validate argument
Konstantin Belousov [Sun, 3 Mar 2024 13:19:37 +0000 (15:19 +0200)]
posix_spawnattr_setflags(3): validate argument

Reviewed by: emaste, kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44195

3 months agolinux: require vnet(9) context in ifname_bsd_to_linux_name()
Gleb Smirnoff [Sun, 3 Mar 2024 20:56:58 +0000 (12:56 -0800)]
linux: require vnet(9) context in ifname_bsd_to_linux_name()

This function is used by netlink(9) only.  The netlink(9) taskqueue thread
runs in the vnet of the socket whose request the thread is processing
right now.  This is a correct vnet and resetting it to vnet0 is incorrect.
If the function is to be used by any other caller in addition to
netlink(9), it would be caller's responsiblity to provide correct vnet(9).

Reviewed by: melifaro, dchagin
Differential Revision: https://reviews.freebsd.org/D44191
PR: 277286

3 months agosys/mount.h: align values of MNTK_XXX flags
Konstantin Belousov [Sun, 3 Mar 2024 05:14:11 +0000 (07:14 +0200)]
sys/mount.h: align values of MNTK_XXX flags

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 months agogpioevents: Fix build with newer Clang
John F. Carr [Sat, 2 Mar 2024 15:38:04 +0000 (10:38 -0500)]
gpioevents: Fix build with newer Clang

PR: 277422

3 months agogetblkx(9): be more tolerant but also strict with the buffer size checks
Konstantin Belousov [Sat, 2 Mar 2024 04:58:57 +0000 (06:58 +0200)]
getblkx(9): be more tolerant but also strict with the buffer size checks

It is possible that on-disk filesystem format causes allocation of
buffers of size larger than maxbcachebuf.  Currently, getblkx() and
indirectly bufkva_alloc() panic in that situation.

It is more useful to return an error instead, allowing the system to
continue running.

PR: 277414
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 months agoread(2): Add write cross reference
Warner Losh [Sat, 2 Mar 2024 03:36:39 +0000 (20:36 -0700)]
read(2): Add write cross reference

Add a write cross reference in the SEE ALSO section.

Sponsored by: Netflix

3 months agoread.2: Use .Fn markup instead of .Xr for read/write calls
Christopher Davidson [Sat, 2 Mar 2024 03:32:37 +0000 (20:32 -0700)]
read.2: Use .Fn markup instead of .Xr for read/write calls

Udpate both write / read references from .Xr to .Fn to eliminate
self-reference cross reference.

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

3 months agoAdd an UNDEFINED_VERSION option
Brooks Davis [Fri, 1 Mar 2024 23:21:46 +0000 (23:21 +0000)]
Add an UNDEFINED_VERSION option

When enabled (current default) link with --undefined-version to allow
symbol maps to contain symbols not defined by libraries.  When disabled,
link with --no-undefined-version to disallow these bugs.

WITHOUT_UNDEFINED_VERSION is currently broken.  Once it is fixed it
should be made the default and this option should likely be removed.

Reviewed by: dim, emaste
Differential Revision: https://reviews.freebsd.org/D44169

3 months agonvme: Report only the unknown bits
Warner Losh [Fri, 1 Mar 2024 23:03:19 +0000 (16:03 -0700)]
nvme: Report only the unknown bits

When we get a smart error that's unknown, report only the unknown
(reserved) bits of the Critical Warning Bitfield.

Sponsored by: Netflix

3 months agohier.7: various improvements usr/src and /var
Alexander Ziaee [Wed, 28 Feb 2024 05:16:35 +0000 (00:16 -0500)]
hier.7: various improvements usr/src and /var

Forth batch of word smithing: /usr/src and /var: Improved wording and a
few missing files added.

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

3 months agohier.7: various improvements usr (no src)
Alexander Ziaee [Wed, 28 Feb 2024 05:16:35 +0000 (00:16 -0500)]
hier.7: various improvements usr (no src)

Third batch of word smithing: /usr but not /usr/src: Improved wording
and a few missing files added.

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

3 months agohier.7: various improvements m-s
Alexander Ziaee [Wed, 28 Feb 2024 05:16:35 +0000 (00:16 -0500)]
hier.7: various improvements m-s

Second batch of word smithing: /media, /mnt, /nonexistant, /rescue,
/sbin: Improved wording and a few missing files added

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

3 months agohier.7: various improvements
Alexander Ziaee [Wed, 28 Feb 2024 05:16:35 +0000 (00:16 -0500)]
hier.7: various improvements

First batch of word smithing: /boot, /dev and /etc. Improved wording and
a few missing files added, though /dev is by no means complete.

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

3 months agopci_host_generic: Enumerate resource ranges under bootverbose
John Baldwin [Fri, 1 Mar 2024 22:20:10 +0000 (14:20 -0800)]
pci_host_generic: Enumerate resource ranges under bootverbose

Previously ranges were only enumerated for the FDT attachment but not
ACPI.  This commit moves the enumeration to the shared attach routine
so it is done for both.  While here, don't list empty ranges but do
include the resource type for each range.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D44132

3 months agonvme: Firmware revisions in the firmware slot info logpage are ASCII strings
John Baldwin [Fri, 1 Mar 2024 22:18:43 +0000 (14:18 -0800)]
nvme: Firmware revisions in the firmware slot info logpage are ASCII strings

In particular, don't try to byteswap the values as 64-bit integers and
always print a non-empty version as a string.

Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44121

3 months agoHTPS has actually three states not two so the macro needs to account for that.
Randall Stewart [Fri, 1 Mar 2024 20:21:15 +0000 (15:21 -0500)]
HTPS has actually three states not two so the macro needs to account for that.

Ok lets fix up the tcp_in_hpts() so that it also says yes if you
are in the race state moving and you are scheduled to be put in.
This also requires changing the MPASS to be the old version non
inline function of tcp_in_hpts().

This change also adds a new inline macro so that a uint64_t timestamp can be
obtained by a transport (aka Rack will use this).

Reviewed by: glebius, tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D44157

3 months agoarm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name
Alfredo Mazzinghi [Fri, 1 Mar 2024 18:32:43 +0000 (10:32 -0800)]
arm64: Fix typo in pagetable_l0_ttbr0_bootstrap symbol name

Obtained from: CheriBSD

3 months agomqueuefs: fix statfs report to not signal file system full
Stefan Eßer [Fri, 1 Mar 2024 17:31:15 +0000 (18:31 +0100)]
mqueuefs: fix statfs report to not signal file system full

Synthetic file systems that do not actually allocate file system
blocks or inodes should report that they have space available and
that they provide 0 inodes, in order to prevent capacity monitoring
tools from warning about resource exhaustion.

This has been fixed in all other synthetic file systems in base in
commit 88a795e80c0, but this file was overlooked since its name does
not indicate that it also provides a file system.

MFC after: 1 month

3 months agoCirrus-CI: Add manual Clang 18 jobs
Ed Maste [Fri, 1 Mar 2024 13:21:54 +0000 (08:21 -0500)]
Cirrus-CI: Add manual Clang 18 jobs

Work is in progress to import Clang/LLVM 18 as the base system compiler.
llvm18-lite is not yet in the quarterly package set but but will be
available in the not too distant future, and is available for src forks
that switch to latest packages.  Add manual llvm18 jobs now so that they
can be used for testing.

Sponsored by: The FreeBSD Foundation

3 months agoCODEOWNERS: Add Stephane Rochoy
Warner Losh [Fri, 1 Mar 2024 16:15:46 +0000 (09:15 -0700)]
CODEOWNERS: Add Stephane Rochoy

Stephane Rochoy isn't quite the maintainer of these items, but has an
interest in them. As an experiment, see if this is a viable thing to do.

3 months agoldconfig: remove ignored -v (verbose) option
Stefan Eßer [Fri, 1 Mar 2024 15:29:31 +0000 (16:29 +0100)]
ldconfig: remove ignored -v (verbose) option

The -v option used to print useful information when operating on a.out
format libraries. After the removal of a.out support, it was accepted
but did not have any effect.

Remove the option and update the man-page.

While here mention the set of historic options that are accepted but
ignored: "-elf", "-s", and "-v".

The FILES section contained outdated information and did not mention
the way library directories of optional ports and packages are
included in the library search path recorded in the hints file.

The description of the "-B" option was incorrect (described a planned
change) for big-endian platforms (powerpc64). These do still default
to big-endian hints files, since the current version of the "pkg"
program expects the hints file to be in native byte-order.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D44139

3 months agopam_xdg: Close the dir after removal
Emmanuel Vadot [Fri, 1 Mar 2024 13:49:16 +0000 (14:49 +0100)]
pam_xdg: Close the dir after removal

CID: 1534878
Sponsored by: Beckhoff Automation GmbH & Co. KG

3 months agopf tests: IPv6 versions of the route-to/reply-to if-bound tests
Kristof Provost [Thu, 29 Feb 2024 14:10:56 +0000 (15:10 +0100)]
pf tests: IPv6 versions of the route-to/reply-to if-bound tests

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

3 months agopf: support if-bound with reply-to
Kristof Provost [Fri, 2 Feb 2024 20:56:55 +0000 (21:56 +0100)]
pf: support if-bound with reply-to

On reply-to we don't know what interface to bind to when we create
the state. Create any reply-to state as floating, but bind to the
appropriate interface once we're handling the reply.

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

3 months agoCirrus-CI: bump Clang versions to 16 and 17
Ed Maste [Thu, 29 Feb 2024 22:00:39 +0000 (17:00 -0500)]
Cirrus-CI: bump Clang versions to 16 and 17

Clang/LLVM 17 is currently the in-tree default compiler, so use it as
the default Cirrus-CI toolchain.  Clang/LLVM 18 is coming soon and needs
to be added here, but I ran into trouble with llvm18-lite package
availability so will look at that later.

Reviewed by: dim (earlier), Jose Luis Duran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44162

3 months agolib{c,sys}: expose _getlogin consistently
Brooks Davis [Thu, 29 Feb 2024 19:46:33 +0000 (19:46 +0000)]
lib{c,sys}: expose _getlogin consistently

Historically we exposed _getlogin as a private symbol on a per-arch basis
(except on aarch64 and riscv) for no obvious reason.  We now need to
expose it for libc's use so remove the special case from
makesyscalls.lua and expose it in the generated syscalls.map.

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