hastd: Add a stop control message
Add a stop control message which causes hastd to clean up and terminate.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D59344
syscalls: Avoid C++ reserved words
Both kern_renameat() and kern_dup() had arguments named `new`. Rename
their arguments to match their respecitve manual pages.
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59386
hastd: Add rudimentary tests
Test that we can start and stop hastd with an empty configuration.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D59345
hastd: Ensure nvpair padding is initialized
The proto-libnv implementation embedded in hastd pads names and values
out to the nearest multiple of eight bytes, but leaves the padding
uninitialized, leaking up to 14 bytes of recycled heap per pair in a
message.
While here, switch from bcopy() to memcpy().
MFC after: 3 days
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D59343
contrib/kyua: fix -Wshadow error
This fixes the build with gcc 14:
/usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:56:16: error: declaration of 'handler' shadows a member of 'engine::prepare::prepare_all' [-Werror=shadow]
56 | for (auto& handler : prepare::handlers()) {
| ^~~~~~~
In file included from /usr/src/contrib/kyua/engine/prepare/prepare_all.hpp:35,
from /usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:29:
/usr/src/contrib/kyua/engine/prepare/prepare.hpp:51:15: note: shadowed declaration is here
51 | class handler {
| ^
Fixes: edb230c4af499203d7a6894b3711fe6574b26040
Reviewed by: igoro, rlibby, ngie
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59346
tun.4: Canonicalize SYNOPSIS and AUTHORS
While here, s/PR#2411/NetBSD PR#2411/ in the comments for clarity.
I had to go to netbsd sources to get this information.
MFC after: 3 days
Event: Berlin Hackathon 202609
tws.4: Canonicalize SYNOPSIS + nits
+ wrap some long lines
+ escape some ? wildcards
+ no macros in width specifiers
+ mention the speed in HARDWARE (bumps date)
+ use the hyperlink macro for... the defunct LSI website...
+ write out a symbol heavy error message format string in mdoc
MFC after: 3 days
Event: Berlin Hackathon 202609
bhyve: Do not panic on invalid input in HDA emulation
The emulated HDA controller passed values taken from guest registers and
from guest memory straight into assert(), so a guest could abort bhyve
with values the emulation did not expect. Reject them instead.
In case the guest asked to start something and it failed, clear the
corresponding run/enable bit.
PR: 256379, 256381, 256382, 256383, 256384, 256385, 256386, 256498
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: bnovkov, jhb
Differential Revision: https://reviews.freebsd.org/D59082
(cherry picked from commit f4d953bea74091874f019e3a2c4902dd013ee739)
libc: Add WCHAR_WIDTH in <wchar.h> as well
Define __WCHAR_WIDTH in sys/_types.h and derive WCHAR_WIDTH from
that, the same way as WCHAR_MIN and WCHAR_MAX, in both <wchar.h>
and <stdint.h> as per C23 §7.31.1 and §7.22.3.4, respectively.
Reviewed by: fuz
Approved by: fuz (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D59385
powerpc/ddb: Dump more state in `show pcpu`
Add a new CPU-family `show pcpu` handler, cpu_db_show_mdpcpu() to dump
CPU-specific PCPU data. Only Book-E is populated for now, but AIM may
be populated later.
These new field prints: save areas, TLB miss nesting, the new critical
stack pointer. All of them have been very useful for debugging very
esoteric bugs, so make them easier to see from DDB, instead of having to
rummage through hex dumps.
powerpc/pmap(booke): Allocate 64-bit roots from DMAP
When a TLB miss exception occurs the exception handler must walk the
page table from the root. When the root is allocated from KVA the TLB
miss exception may take another exception if the root page(s) aren't in
the TLB.
The 64-bit page table is modeled after the AIM radix page table, with a
64kB root "page", so 16 pages. This makes regular use of UMA
allocations unable to refer back to the DMAP, which itself is mapped in
TLB1. Now we take another page from the radix pmap driver and grab
contiguous pages from the VM system, so that we can simply refer
directly to DMAP and avoid more nested TLB misses. We can still take a
nested miss, though, because the pmap itself may be in KVA, but this
reduces the nesting.
powerpc/pmap(booke): Rework TID reuse
If a pmap is freed and its memory is reused before its TID reference is
taken, then arbitrary memory will be clobbered. Avoid this by never
dereferencing the pmap pointer in the tidbusy array, and instead using
it as a compare sentinel.
powerpc/booke: Reorganize FRAME_LEAVE
There's a small window between when the SRR* registers are restore and
the exception returns, in which a TLB miss exception may be triggered.
Since there are not special SRR* registers for TLB miss exceptions, the
registers from the frame will be ovwritten, and the FRAME_LEAVE block
will effectively be re-entered on exit, leading to a very hard to
diagnose panic or wedge.
Minimize this chance by pushing the SRR* restore to the last possible
moments, caching them in a PCPU save area instead until the end. This
matches what the AIM side already does.
powerpc/booke: Use a dedicated critical exception stack
A critical exception, such as a watchdog, can trigger at any time,
including the middle of a standard exception prologue or epilogue, so
GPRs, including %r1 (the stack pointer) cannot be trusted at all.
Instead, use a private stack pointer for critical interrupts. Each CPU
now has its own critical exception stack, with the boot stack in the
bss.
powerpc/watchdog: Make e500 watchdog action tunable
There are 4 options for e500 watchdog timeout, which may be core- or
even SoC- specific. Add support to tune the behavior via a tunable
(machdep.watchdog_mode). The tunable value is an integer 0-3.