]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 months agosqlite3: Vendor import of sqlite3 3.45.1
Cy Schubert [Tue, 12 Mar 2024 14:01:21 +0000 (08:01 -0600)]
sqlite3: Vendor import of sqlite3 3.45.1

Release notes at https://www.sqlite.org/releaselog/3_45_1.html.

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz
MFC after: 1 week

Merge commit '1e59a00476c9801952e7319719fcdb095a0cd007' into main

2 months agomkimg(1): process non-seekable output gracefully
Eugene Grosbein [Tue, 12 Mar 2024 15:55:42 +0000 (22:55 +0700)]
mkimg(1): process non-seekable output gracefully

mkimg may make severe load only to fail in the end
if output is non-seekable pipe, socket or FIFO
unless output format is raw disk image.

Check it out and fail early. Make it clear in the manual.

MFC after: 1 week

2 months agoRELNOTES: Add awk update from 2 weeks ago.
Warner Losh [Tue, 12 Mar 2024 15:24:39 +0000 (09:24 -0600)]
RELNOTES: Add awk update from 2 weeks ago.

Sponsored by: Netflix

2 months agomd5.1: Fix the GNU mode example when using a digest file
Gordon Bergling [Tue, 12 Mar 2024 14:44:48 +0000 (15:44 +0100)]
md5.1: Fix the GNU mode example when using a digest file

The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead.

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR: 276560
Reviewed by: mhorne, des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44098

2 months agosqlite3: Vendor import of sqlite3 3.45.1
Cy Schubert [Tue, 12 Mar 2024 13:54:12 +0000 (07:54 -0600)]
sqlite3: Vendor import of sqlite3 3.45.1

Release notes at https://www.sqlite.org/releaselog/3_45_1.html.

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz

2 months ago Update to bring the rack stack with all its fixes in.
Randall Stewart [Tue, 12 Mar 2024 11:55:02 +0000 (07:55 -0400)]
 Update to bring the rack stack with all its fixes in.

This brings the rack stack up to the current level used at NF. Many fixes
and improvements have been added. I also add in a fix to BBR to deal with
the changes that have been in hpts for a while i.e. only one call no matter
if mbuf queue or tcp_output.

It basically does little except BBlogs and is a placemark for future work on
doing path capacity measurements.

With a bit of a struggle with git I finally got rack_pcm.c into place (apologies
for not noticing this error). The LINT kernel is running on my box now .. sigh.

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

2 months agomrsas: don't reference the removed physical disk of RAID1 during IO submission
Sumit Saxena [Tue, 12 Mar 2024 06:51:09 +0000 (06:51 +0000)]
mrsas: don't reference the removed physical disk of RAID1 during IO submission

When a physical disk(PD) [belonging to a RAID1 Virtual disk(VD)] is
removed, driver may still use the reference to the removed PD while submitting
IO to the controller. Controller firmware faults upon receipt of such IO.
This patch fixes this issue by not using any reference to the removed PD.

Reviewed by: imp
Approved by: imp
Sponsored by: Broadcom Inc
Differential Revision: https://reviews.freebsd.org/D44282

2 months agolibc: Move tzset.3 to stdtime
Warner Losh [Tue, 12 Mar 2024 04:19:15 +0000 (22:19 -0600)]
libc: Move tzset.3 to stdtime

This really belongs in stddime, since it documents interfaces
implemented in stdtime.

Suggested by: brooks
Sponsored by: Netflix

2 months agotimezone: Move to the XSI/POSIX definition for timezone.
Warner Losh [Tue, 12 Mar 2024 04:19:05 +0000 (22:19 -0600)]
timezone: Move to the XSI/POSIX definition for timezone.

The old timezone(3) function has long since been obsolete and has a
fatally flawed interface. Retain this function for compatibility
purposes, but shift to providing the offset from UTC in the timezone
variable, whether or not the timezone observes summer time in the
'daylight' variable. Document the tzname variable that's already been
set. Also make _tztab() static. It's not used in libc (or anywhere in
the tree) and it's not exported as a public dynamic symbol.

Sponsored by: Netflix
Reviewed by: brooks, kib
Differential Revision: https://reviews.freebsd.org/D44281

2 months agovmm: fix standalone module build
Gleb Smirnoff [Tue, 12 Mar 2024 00:59:03 +0000 (17:59 -0700)]
vmm: fix standalone module build

2 months agokboot: kbootfdt: fix error handling
Warner Losh [Mon, 11 Mar 2024 20:15:44 +0000 (14:15 -0600)]
kboot: kbootfdt: fix error handling

If we are able to open /sys/firmware/fdt, but aren't able to read it,
fall back to /proc/device-tree. Remove comment that's not really true,
it turns out.

Sponsored by: Netflix

2 months agokboot: Use is_linux_error to check mmap return error
Warner Losh [Mon, 11 Mar 2024 20:15:39 +0000 (14:15 -0600)]
kboot: Use is_linux_error to check mmap return error

Rather than checking against the (incorrect) -511, use the
is_linux_error() function to check to see if host_mmap failed.

Sponsored by: Netflix

2 months agokboot: Print UEFI memory map
Warner Losh [Mon, 11 Mar 2024 20:15:34 +0000 (14:15 -0600)]
kboot: Print UEFI memory map

If we can read the UEFI memory map, go ahead and print the memory map.
While the kernel prints this with bootverbose, having it at this stage
is useful for debugging other problems.

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

2 months agokboot: hostfs -- check for llseek failure correctly
Warner Losh [Mon, 11 Mar 2024 20:15:24 +0000 (14:15 -0600)]
kboot: hostfs -- check for llseek failure correctly

The host_* syscalls are all raw Linux system calls, not the POSIX
wrappers that glibc / musl create. So we have to ranage change the
return value of host_llseek correctly to use the negative value hack
that all Linux system calls use.

This fixes a false positive error detection when we do something like
lseek(fd, 0xf1234567, ...); This returns 0xf1234567, which is a negative
value which used to trigger the error path.  Instead, we check using the
is_linux_error() and store the return value in a long. Translate that
errno to a host errno and set the global errno to that and return
-1. lseek can't otherwise return a negative number, since it's the
offset after seeking into the file, which by definition is positive.

This kept the 'read the UEFI memory map out of physical memory' from
working on aarch64 (whose boot loader falls back to reading it since
there are restrictive kernel options that can also prevent it), since
the physical address the memory map was at on my platform was like
0xfa008018.

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

2 months agokboot: Avoid UB in signed shift
Warner Losh [Mon, 11 Mar 2024 20:15:10 +0000 (14:15 -0600)]
kboot: Avoid UB in signed shift

offset is signed. Copy it to the unsigned res before shifting. This
avoids any possible undefined behavior for right shifting signed
numbers. No functional change intended (and the code generated is the
nearly same for aarch64).

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

2 months agokboot: Create function for error checking.
Warner Losh [Mon, 11 Mar 2024 20:15:03 +0000 (14:15 -0600)]
kboot: Create function for error checking.

Linux has the convention of returning -ERRNO to flag errors from its
system calls. Sometimes other negative values are returned that are
success...  However, only values -1 to -4096 (inclusive) are really
errors. The rest are either truncated values that only look negative (so
use long instead of int), or are things like addresses or legal unsigned
file offsets or similar that are successful returns. Filter out the
latter.

Sponsored by: Netflix

2 months agoRevert "Update to bring the rack stack with all its fixes in."
Brooks Davis [Mon, 11 Mar 2024 20:15:20 +0000 (20:15 +0000)]
Revert "Update to bring the rack stack with all its fixes in."

This commit was incomplete and breaks LINT kernels.  The tree has been
broken for 8+ hours.

This reverts commit f6d489f402c320f1a6eaa473491a0b8c3878113e.

2 months agonetlink: fix route protocol constant values to match Linux
Marek Zarychta [Mon, 11 Mar 2024 15:50:46 +0000 (08:50 -0700)]
netlink: fix route protocol constant values to match Linux

Although these particular constants aren't supported, the incorrect
values break bird 2.15 operation.

PR: 277618
Reported by: Ondrej Zajicek <santiago@crfreenet.org>

2 months agotests/unix_seqpacket: mk_pair_of_sockets() requires a valid argument
Gleb Smirnoff [Mon, 11 Mar 2024 14:50:29 +0000 (07:50 -0700)]
tests/unix_seqpacket: mk_pair_of_sockets() requires a valid argument

All callers do it right.  Don't be overprotective against a stupid
caller and thus don't look like a code that leaks a resource.

Reported by: Coverity Scan
CID: 1539210

2 months agoAdd 'contrib/libdiff/' from commit '9eb461aa4b61ab47855b2cee9e5b626a76888b5e'
Dag-Erling Smørgrav [Mon, 11 Mar 2024 13:44:36 +0000 (14:44 +0100)]
Add 'contrib/libdiff/' from commit '9eb461aa4b61ab47855b2cee9e5b626a76888b5e'

git-subtree-dir: contrib/libdiff
git-subtree-mainline: f6d489f402c320f1a6eaa473491a0b8c3878113e
git-subtree-split: 9eb461aa4b61ab47855b2cee9e5b626a76888b5e

Reviewed by: imp
Sponsored by: Klara, Inc.

2 months agoUpdate to bring the rack stack with all its fixes in.
Randall Stewart [Mon, 11 Mar 2024 11:36:54 +0000 (07:36 -0400)]
Update to bring the rack stack with all its fixes in.

This brings the rack stack up to the current level used at NF. Many fixes
and improvements have been added. I also add in a fix to BBR to deal with
the changes that have been in hpts for a while i.e. only one call no matter
if mbuf queue or tcp_output.

Note there is a new file that I can't figure out how to get in rack_pcm.c

It basically does little except BBlogs and is a placemark for future work on
doing path capacity measurements.

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

2 months agoAdd space before 20240211 entry in ObsoleteFiles.inc
Dimitry Andric [Sun, 10 Mar 2024 11:36:28 +0000 (12:36 +0100)]
Add space before 20240211 entry in ObsoleteFiles.inc

2 months agounionfs: accommodate underlying FS calls that may re-lock
Jason A. Harmening [Tue, 2 Jan 2024 21:22:24 +0000 (15:22 -0600)]
unionfs: accommodate underlying FS calls that may re-lock

Since non-doomed unionfs vnodes always share their primary lock with
either the lower or upper vnode, any forwarded call to the base FS
which transiently drops that upper or lower vnode lock may result in
the unionfs vnode becoming completely unlocked during that transient
window.  The unionfs vnode may then become doomed by a concurrent
forced unmount, which can lead to either or both of the following:

--Complete loss of the unionfs lock: in the process of being
  doomed, the unionfs vnode switches back to the default vnode lock,
  so even if the base FS VOP reacquires the upper/lower vnode lock,
  that no longer translates into the unionfs vnode being relocked.
  This will then violate that caller's locking assumptions as well
  as various assertions that are enabled with DEBUG_VFS_LOCKS.

--Complete less of reference on the upper/lower vnode: the caller
  normally holds a reference on the unionfs vnode, while the unionfs
  vnode in turn holds references on the upper/lower vnodes.  But in
  the course of being doomed, the unionfs vnode will drop the latter
  set of references, which can effectively lead to the base FS VOP
  executing with no references at all on its vnode, violating the
  assumption that vnodes can't be recycled during these calls and
  (if lucky) violating various assertions in the base FS.

Fix this by adding two new functions, unionfs_forward_vop_start_pair()
and unionfs_forward_vop_finish_pair(), which are intended to bookend
any forwarded VOP which may transiently unlock the relevant vnode(s).
These functions are currently only applied to VOPs that modify file
state (and require vnode reference and lock state to be identical at
call entry and exit), as the common reason for transiently dropping
locks is to update filesystem metadata.

Reviewed by: olce
Tested by: pho
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44076

2 months agouipc_bindat(): Explicitly specify exclusive locking for the new vnode
Jason A. Harmening [Sat, 3 Feb 2024 17:07:16 +0000 (11:07 -0600)]
uipc_bindat(): Explicitly specify exclusive locking for the new vnode

When calling VOP_CREATE(), uipc_bindat() reuses the componentname
object from the preceding lookup operation, which is likely to specify
LK_SHARED.  Furthermore, the VOP_CREATE() interface technically only
requires the newly-created vnode to be returned with a shared lock.
However, the socket layer requires the new vnode to be locked exclusive
and asserts to that effect.

In most cases, this is not a practical concern because most if not
all base-layer filesystems (certainly FFS, ZFS, and msdosfs at least)
always return the vnode locked exclusive regardless of the lock flags.
However, it is an issue for unionfs which uses cn_lkflags to determine
how the new unionfs wrapper vnode should be locked.  While it would
be easy enough to work around this issue within unionfs itself, it
seems better for the socket layer to be explicit about its locking
requirements when issuing VOP_CREATE().

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

2 months agovn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL
Jason A. Harmening [Fri, 23 Feb 2024 17:31:08 +0000 (11:31 -0600)]
vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL

It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the assertion
that exactly one of LK_SHARED or LK_EXCLUSIVE must be set.  On the
other hand, we still want to catch cases in which completely bogus
or corrupt flags are passed even if the corresponding vnode is NULL.
Therefore, specifically allow empty flags for lkflags1/lkflags2 iff
the respective vp1/vp2 param is NULL.

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

2 months agomount_nullfs(8): fix typo
Konstantin Belousov [Sat, 9 Mar 2024 21:18:11 +0000 (23:18 +0200)]
mount_nullfs(8): fix typo

Reported by: mckusick

2 months agoktrace: Fix the build when options KTRACE is not configured
Mark Johnston [Sat, 9 Mar 2024 05:11:01 +0000 (00:11 -0500)]
ktrace: Fix the build when options KTRACE is not configured

MFC after: 1 week
Reported by: John Nielsen <lists@jnielsen.net>

2 months agoktrace: Add __ktrace_used
Mark Johnston [Sat, 9 Mar 2024 05:08:43 +0000 (00:08 -0500)]
ktrace: Add __ktrace_used

This suppresses warnings about write-only variables when the KTRACE
option is disabled, akin __diagused and __witness_used.

MFC after: 1 week

2 months agocrunchgen: slap a dependency on the generated makefile for .lo
Kyle Evans [Sat, 9 Mar 2024 02:01:17 +0000 (20:01 -0600)]
crunchgen: slap a dependency on the generated makefile for .lo

crunchgen generates a foo.lo for each binary it will end up crunching
into the final product.  While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed.  Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.

This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.

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

2 months agolib{c,sys}: fix incremental builds
Brooks Davis [Fri, 8 Mar 2024 19:14:24 +0000 (19:14 +0000)]
lib{c,sys}: fix incremental builds

I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
idential generated version.  We need to clean out the .ddepend files to
ensure the generated version is actually generated.

The guard here is technically too strict, but should be fine in practice
and I've verified both the breakage and fix on an armv7 build.

Reported by: imp
Fixes: e6ffc7669a56 Remove pointless MD syscall(2)
Fixes: 0ee0ae237324 Remove pointless MD syscall(2)
Fixes: 7b3836c28188 Remove pointless MD syscall(2)

2 months agonullfs_mount(): fix whitespace
Konstantin Belousov [Fri, 8 Mar 2024 18:51:04 +0000 (20:51 +0200)]
nullfs_mount(): fix whitespace

2 months agomount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes
Konstantin Belousov [Fri, 8 Mar 2024 18:26:48 +0000 (20:26 +0200)]
mount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 months agonullfs: add -o cache
Konstantin Belousov [Fri, 8 Mar 2024 18:26:02 +0000 (20:26 +0200)]
nullfs: add -o cache

to allow overwrite global default if needed.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 months agonullfs_mount(): remove unneeded cast
Konstantin Belousov [Fri, 8 Mar 2024 18:37:43 +0000 (20:37 +0200)]
nullfs_mount(): remove unneeded cast

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 months agosimple_mfd: don't attach children twice
Mitchell Horne [Fri, 8 Mar 2024 14:09:17 +0000 (10:09 -0400)]
simple_mfd: don't attach children twice

Trying to probe+attach the child device at the point it is added comes
before the syscon handle is set up (if relevant). It will therefore be
unavailable to the attach method which is expecting it, and the first
attempt to attach the device will fail.

Just rely on the call to bus_generic_attach() at the end of the function
to perform probe+attach of dev's children.

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

2 months agoclkdom_dump(): improve output text
Mitchell Horne [Fri, 8 Mar 2024 14:09:08 +0000 (10:09 -0400)]
clkdom_dump(): improve output text

If the call to clknode_get_freq() returns an error (unlikely), report
this, rather than printing the error code as the clock frequency.

If the clock has no parent (e.g. a fixed reference clock), print "none"
rather than "(NULL)(-1)". This is a more human-legible presentation of the
same information.

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

2 months agoclk_fixed: quiet by default
Mitchell Horne [Fri, 8 Mar 2024 14:08:49 +0000 (10:08 -0400)]
clk_fixed: quiet by default

We may attach several of these devices, but there is no meaningful
information added to dmesg. For example:

  ofwbus0: <Open Firmware Device Tree>
  clk_fixed0: <Fixed clock> on ofwbus0
  clk_fixed1: <Fixed clock> on ofwbus0
  clk_fixed2: <Fixed clock> on ofwbus0
  clk_fixed3: <Fixed clock> on ofwbus0
  clk_fixed4: <Fixed clock> on ofwbus0
  clk_fixed5: <Fixed clock> on ofwbus0
  clk_fixed6: <Fixed clock> on ofwbus0
  clk_fixed7: <Fixed clock> on ofwbus0
  clk_fixed8: <Fixed clock> on ofwbus0
  clk_fixed9: <Fixed clock> on ofwbus0
  clk_fixed10: <Fixed clock> on ofwbus0
  clk_fixed11: <Fixed clock> on ofwbus0

To reduce this noise, quiet the devices for by default. For verbose
boot, the message will be emitted.

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

2 months agoclk_fixed: call clkdom_dump() for verbose boot
Mitchell Horne [Fri, 8 Mar 2024 14:08:22 +0000 (10:08 -0400)]
clk_fixed: call clkdom_dump() for verbose boot

This is standard practice for clock drivers that register clocks
dynamically. Nothing else uses the CLK_DEBUG macro.

The result is that the name and frequency of the fixed clock is printed
for a verbose boot, which may aid in debugging.

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

2 months agoHyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()
Wei Hu [Fri, 8 Mar 2024 10:00:25 +0000 (10:00 +0000)]
Hyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()

The msi address contains apic id. The code in vmbus_pcib_map_msi()
treats it as cpu id, which could cause mis-configuration of msix
IRQs, leading to missing interrupts for SRIOV devices. This happens
when apic id is not the same as cpu id on certain large VM sizes
with multiple numa domains in Azure. Fix this issue by correctly
mapping apic ids to cpu ids.

On vPCI version before 1.4, it only supports up to 64 vcpus
for msi/msix interrupt. This change also adds a check and returns
error if the vcpu_id is greater than 63.

Reported by: NetApp
Tested by: whu
MFC after: 1 week

2 months agoTCP LRO: add dtrace probe points
Michael Tuexen [Fri, 8 Mar 2024 09:21:09 +0000 (10:21 +0100)]
TCP LRO: add dtrace probe points

Add the IP, UDP, and TCP receive static probes to the code path,
which avoids if_input.

Reviewed by: rrs, markj
MFC after: 1 week`
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D43727

2 months agoTCP LRO: disable mbuf queuing when packet filter hooks are in place
Michael Tuexen [Fri, 8 Mar 2024 09:03:43 +0000 (10:03 +0100)]
TCP LRO: disable mbuf queuing when packet filter hooks are in place

When doing mbuf queueing, the packet filter hooks in ether_demux(),
ip_input(), and ip6_input() are by-passed. This means that the packet
filters don't process incoming packets, which might result in
connection failures. For example bypassing the TCP sequence number
validation will result in dropping valid packets.
Please note that this patch is only disabling mbuf queueing, not LRO.

Reported by: Herbert J. Skuhra
Reviewed by: glebius, rrs, rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D43769

2 months agoObsoleteFiles.inc: add the awk tests I just remvoed
Warner Losh [Fri, 8 Mar 2024 06:03:41 +0000 (23:03 -0700)]
ObsoleteFiles.inc: add the awk tests I just remvoed

These files were bogusly added when I imported awk 2nd edition.

Sponsored by: Netflix

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 agoVendor import of diff from OpenBSD's Game of Trees
Dag-Erling Smørgrav [Thu, 7 Mar 2024 11:32:03 +0000 (12:32 +0100)]
Vendor import of diff from OpenBSD's Game of Trees

Repository: ssh://anonymous@got.gameoftrees.org/diff.git
Commit hash: b5a9c15f4d68c06ec3bf839529b3ed2def0a6af6
Commit date: 2023-09-15

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