tools/cam: Start to add the testing tools for CAM
Create a directory for testing tools arond CAM. These are snippets of
what will eventually be camio. At the moment, it was written using fbt
traces. This is OK, but fragile, so they need to be re-written with the
cam provider. cam_all_but_scsi.d is the first step. It shows how to do
this with the new cam dtrace provider.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54472
cam: When inq data isn't valid, pass NULL
When the device isn't there, we don't have valid inq data. Pass NULL in
this case. All the routines that receive this test against NULL already.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54470
cam: Start adding dtrace provider 'cam'
Start to provide robust tracing in cam now that clang has broken my
fbt-based dtrace scripts a couple of times.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54468
loader: Only warn when we have neither FDT nor ACPI
Sponsored by: Netflix
Reviewed by: adrian, andrew
Differential Revision: https://reviews.freebsd.org/D54510
loader.efi: Only use SPCR if enabled.
SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.
FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.
PR: 292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp at FreeBSD.org>
Closes: https://github.com/freebsd/freebsd-src/pull/1948
vm_object.h: tweak OBJ_ONEMAPPING comment even more
The formulation that pages are allowed to have at most one mapping is
not quite clear. Nothing prevents pages from having more than one
mapping, but the flag must be cleared then.
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D54570
linuxkpi: Add `rol32()`
`rol64()` and `rol32()` are used by <linux/siphash.h>. The former was
added previously, before <linux/siphash.h> was added. However the latter
was not, and it broke the build on armv7.
Reported by: adrian
Reviewed by: adrian, rpokala
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54588
linuxkpi: Replicate the chain of #include in the `cec*.h` headers
The i915 DRM driver depends on this namespace pollution to access
`debugfs_*` functions, after several explicit #include of
<linux/debugfs.h> were removed in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54494
linuxkpi: Add <linux/kmsg_dump.h>
This header declares register/unregister functions to allow a piece of
code to tell what function to call in case of a panic. Several panic
handlers may be registered.
The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54492
linuxkpi: Add WARN_RATELIMIT()
The i915 DRM driver started to use it in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54493
linuxkpi: Add <linux/font.h>
The header defines the minimum to allow the DRM generic code to build.
The only function used so far is `get_default_font()`, as part of a
DRM-specific panic handler. We do not use this panic handler on FreeBSD.
For now, it returns a NULL value. It should probably map to a vt(4)
font.
The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54491
linuxkpi: Define `raw_spinlock_t` in <linux/spinlock.h>
For now, it is synonymous to `spinlock_t`. The DRM generic code uses the
`struct raw_spinlock` and not `raw_spinlock_t`, that's why the
definition is a struct embedding a `struct mtx`, compared to
`spinlock_t` which is a simpler typedef.
The DRM generic code started to use it in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54489
iflib: Drop tx lock when freeing mbufs using simple_transmit
Freeing completed transmit mbufs can be time consuming (due to them
being cold in cache, and due to ext free routines taking locks),
especially when we batch tx completions. If we do this when holding
the tx ring mutex, this can cause lock contention on the tx ring mutex
when using iflib_simple_transmit.
To resolve this, this patch opportunistically copies completed mbuf
pointers into a new array (ifsd_m_defer) so they can be freed after
dropping the transmit mutex. The ifsd_m_defer array is
opportunistically used, and may be NULL. If its NULL, then we free
mbufs in the old way. The ifsd_m_defer array is atomically nulled
when a thread is using it, and atomically restored when the freeing
thread is done with it. The use of atomics here avoids
acquire/release of the tx lock to restore the array after freeing
mbufs.
Since we're no longer always freeing mbufs inline, peeking into them to see if a
[17 lines not shown]
lualoader: fix pruning of non-existent default kernel
Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work. Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).
There's room to improve the error messages here, but for now let's just
make it actually work correctly.
PR: 292232
Fixes: d04415c520b03 ("loader: lua: remove the default kernel [...]")
bhyve: improve console error reporting on arm64
Currently, on arm64, if bhyve fails to initialize the console,
it falls into assert(), which does not look particularly pretty
for users.
Replace the assert with proper error handling so bhyve prints
a meaningful error message and exits with status code 4 (error).
That matches the behavior on amd64.
Approved by: markj
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54504
netstat: fix a segfault with --libxo
Fix a segfault when printing the "protocol" field. The field-format and
encoding-format were expecting different numbers of arguments.
Also, fix the width of the tcp-state field in encoded output.
PR: 292228
Fixes: c2b08c13c20 netstat: add support for UDP-Lite endpoints
MFC after: 1 week
Sponsored by: ConnectWise
Reviewed by: tuexen, js, des
Differential Revision: https://reviews.freebsd.org/D54567