nvmm(4): Fix race in clearing vcpu->comm->stop bit.
Don't touch vcpu after nvmm_vcpu_put when we no longer hold the lock,
and certainly not after nvmm_machine_put when the vcpu could even be
freed.
PR kern/60544: nvmm_vcpu_run: use after mutex release
nvmm(4) vmx: Don't read VMCS_EXIT_REASON if vmlaunch/vmresume failed.
It is not valid in that case; we might end up operating on the
_previous_ successful vmlaunch/vmresume's now-stale exit reason.
kern/60545: nvmm_x86_vmx: stale exit reason on launch/resume failure
proc_regio: Clarify control flow and sprinkle comments.
Use `if (error) goto out' instead of `if (error == 0) error = ...' to
make the error case non-linear and indented, and the success case a
straight line of logic.
No functional change intended.
PR port-amd64/60556: panic in process_read_fpregs_xmm
ptrace/procfs: Take lwp lock around process_read/write_(fp)regs(32).
And verify that the lwp is in LSSTOP state before trying to read.
Otherwise, we might catch an lwp while it's still running on the CPU,
with all FPU state active, making the result unstable and tripping
assertions on some architectures.
PR port-amd64/60556: panic in process_read_fpregs_xmm
grep(1): Nix xfail on new test for PR 60552 screw case.
I was planning to do this in the same commit that fixes it, to keep
the history of bugs and fixes tidy, but gutteridge@ beat me to
committing the fix.
PR bin/60552: /usr/bin/grep failure under AMD64
nfs: Avoid UB in integer shift amounts.
Just use ilog2 explicitly here, instead of writing out a loop with
shifts and increments to compute it more slowly and buggily. Note
the confusing fencepost adjustment. Clamp _PC_FILESIZEBITS at the
actual size of off_t since we can't go beyond that.
PR kern/60554: nfs: integer shift UB in pathconf(_PC_FILESIZEBITS)
Make console input on virt68k 8-bit clean.
On signed-char ports you can't feed a "char *" to the tty layer. A cursory
glance for more instances of this didn't find any but it's possible.
Simplify the interface between the timers and the clock infrastructure,
and allow the clock infrastructure to select clock roles without having
netbsd,hardclock or netbsd,statclock properties in /chosen (they're now
optional).
Add fdtbus_get_reg_shift() to get the "reg-shift" property and provide
a default value, rather than open-coding it everywhere it's used. It's
common enough in various device bindings, and ePAPR describes it as a
generic device property.
Deal with the absolutely pathological handling of the IDENTIFY command
on big-endian systems.
In wdc_datain_pio(), in the ATA_DRIVE_NOSTREAM case, if the bus.h
implementation does does not have __BUS_SPACE_HAS_STREAM_METHODS
and the system is _BIG_ENDIAN, individually swap each 16-bit value
rather than assuming the bus_space_read_*2() implementation will do
it.
This is necessary because IDENTIFY is treated differently than every
other command; all callers assume it will be returned in host-order,
when in reality it's an array of 256 16-bit little-endian integers (even
the string fields).
Ultimately, the correct fix is to stop special-casing IDENTIFY, but
that is a much larger change due to the confusing array of flags that
control I/O size and disposition, and requires much wider testing.
vflushbuf: Print `vflushbuf: dirty' warning only once per call.
And do it only under DEBUG, and rate-limit it globally.
This can happen when vflushbuf is competing with an onslaught of
concurrent I/O on a snapshot or block device (which is done without
holding the vnode lock, despite what the comment says). That
concurrent I/O might be happening indefinitely, so we are likely to
have to print a _lot_ of warnings, potentially overwhelming the
console, until the underlying problem is fixed by teaching vflushbuf
to wait only for the writes that began before have completed, not
also all writes that have begun since.
This stop-gap measure intended to be low-risk for pullup to release
branches.
PR kern/60531: looping "vflushbuf: dirty" message