Commit Graph

289992 Commits

Author SHA1 Message Date
Warner Losh
7c6af20969 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
2024-03-06 18:38:59 -07:00
Warner Losh
6a3877a0e2 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
2024-03-06 18:38:59 -07:00
Warner Losh
2a2682ee53 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
2024-03-06 18:38:59 -07:00
Warner Losh
5cdedf676d 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
2024-03-06 18:38:59 -07:00
Warner Losh
4f817fcf6a 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
2024-03-06 18:38:59 -07:00
Warner Losh
fc3afe9395 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
2024-03-06 18:38:59 -07:00
Brooks Davis
83392afeeb 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:	8271d9b99a libsys: remove usage of pthread_once and _once_stub

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44237
2024-03-07 01:02:25 +00:00
Brooks Davis
cc4ffc9786 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
abd529ceba and 0db2fac06a).  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
2024-03-07 01:01:36 +00:00
Brooks Davis
39a15d7470 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
2024-03-07 00:59:07 +00:00
Brooks Davis
7b3836c281 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
2024-03-07 00:59:01 +00:00
Brooks Davis
0ee0ae2373 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
2024-03-07 00:58:55 +00:00
Brooks Davis
e6ffc7669a 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
2024-03-07 00:58:44 +00:00
Brooks Davis
269593dc4a 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
2024-03-07 00:58:29 +00:00
Brooks Davis
cec2adb0d3 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
2024-03-07 00:55:11 +00:00
Brooks Davis
de4386d174 heimdal: don't export nonexistant _wind_ucs2read
This symbol table entry came in with the 1.5 import (commit
7c450da7b4), 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
2024-03-07 00:54:55 +00:00
Brooks Davis
023fa553bf 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
2024-03-07 00:54:22 +00:00
Brooks Davis
8c94ed9927 bsearch_b: fix compilation with gcc
Reported by:	rscheff
Differential Revision:	https://reviews.freebsd.org/D44256
2024-03-06 19:46:12 +00:00
Baptiste Daroussin
0ecf0b26a7 timerfd_create: fix after cf742faa39
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.
2024-03-06 18:28:02 +01:00
Baptiste Daroussin
cf742faa39 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
2024-03-06 18:13:33 +01:00
Dag-Erling Smørgrav
32b8aac6f9 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
2024-03-06 17:14:05 +01:00
Dag-Erling Smørgrav
0118b0c8e5 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
2024-03-06 17:14:01 +01:00
Dag-Erling Smørgrav
e212f0c066 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
2024-03-06 17:13:57 +01:00
Dag-Erling Smørgrav
c291b7914e 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
2024-03-06 17:13:54 +01:00
Dag-Erling Smørgrav
8427d94ce0 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
2024-03-06 17:13:51 +01:00
Dag-Erling Smørgrav
38b3683592 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
2024-03-06 17:13:42 +01:00
Michael Galassi
d0168b32bc 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>
2024-03-06 16:50:24 +01:00
Sumit Saxena
e436cb7966 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
2024-03-06 12:17:29 +00:00
Gordon Bergling
a44658281a Revert "md5.1: Fix an example"
This reverts commit 865baeaf1a.
2024-03-06 09:34:30 +01:00
Konstantin Belousov
2ce23b1f76 libc posix_spawn(): explain why rtld can be used after fork
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-06 09:25:14 +02:00
Konstantin Belousov
f8bbbce458 libthr: remove explicit sys/cdefs.h includes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-06 09:25:13 +02:00
Konstantin Belousov
ebaf907114 posix_spawn.c: fix typo in comment
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-06 09:25:02 +02:00
Alan Somers
89f4f91dbf 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
cbe882298e

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>
2024-03-05 12:11:53 -07:00
Eugene Grosbein
e333110d1d 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
2024-03-06 00:29:04 +07:00
Sergey A. Osokin
885590b4f1 bsd-family-tree: add FreeBSD 13.3
MFC after:	3 days
2024-03-05 08:38:09 -05:00
John Baldwin
e6dccf0050 .github: Switch to v4 of actions/checkout
GitHub is emitting a warning that v3 is deprecated due to using
Node.js 16.
2024-03-04 21:52:09 -08:00
Kyle Evans
47ad4f2d45 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
2024-03-04 23:44:09 -06:00
Kyle Evans
02c57f7b48 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
2024-03-04 23:44:09 -06:00
Kyle Evans
bd23e71f91 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
2024-03-04 23:44:09 -06:00
Kyle Evans
b5d2165b90 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
2024-03-04 23:44:08 -06:00
John Baldwin
291079d0eb 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
2024-03-04 20:53:21 -08:00
John Baldwin
332dbd3a2f pci_host_generic: Pass a valid end address in generic_pcie_translate_resource
The generic_pcie_containing_range helper added in commit d79b6b8ec2
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:		d79b6b8ec2 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision:	https://reviews.freebsd.org/D44205
2024-03-04 20:52:54 -08:00
John Baldwin
364d1b2f8c 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
2024-03-04 20:52:21 -08:00
Alex Richardson
169641f7dd 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
2024-03-04 20:51:49 -08:00
Gordon Bergling
7701b99355 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
2024-03-05 03:03:50 +01:00
Brooks Davis
7e8e73fed5 libc: actually build bsearch_b
Fixes:		46cdc14062 Add support for some block functions ...

Reviewed by:	theraven
Differential Revision:	https://reviews.freebsd.org/D44189
2024-03-05 01:01:56 +00:00
Brooks Davis
ec911a4f10 libc/locale: don't expose nonexistant __collate_load_error
The private symbol __collate_load_error was removed in 2015 in commit
2a6abeebef.  While it had previously been accidently removed in 2011
(commit 3c87aa1d3dc1a) and restored in 2012 (commit bb4317bf3c) I
think it's time to write it off after four major releases without it.

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

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44182
2024-03-05 01:00:50 +00:00
Dimitry Andric
a39b3aa463 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
2024-03-04 21:31:04 +01:00
Alex Richardson
327ada0b0e 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
2024-03-04 11:52:21 -08:00
Hartmut Brandt
83550d02fe Add a missing space in a warning. 2024-03-04 20:08:25 +01:00
Mitchell Horne
da48ddbf7c 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
2024-03-04 14:45:17 -04:00