gicv3_its: Fix ITT sizing.
The ITT being allocated did not match the size specified on the MAPD
command. This could cause hardware to read past the end of the ITT.
The old code used a fixed offset mapping scheme to assign eventIDs (the
eventID was derived from the LPI INTID). This scheme is wasteful and
doesn't scale well as the ITT is essentially an array of ITEs starting
with eventID 0. This change introduces per-deviceID namespaces for
eventIDs and allocates them starting with 0. A fixed number of eventIDs is
made available for each deviceID (MAXCPUS * 2). On a platform with an ITE
size of 8 bytes, this allows the ITT to fit in a single page.
The ITT is sized larger than the initial request as multiple requestors
could potentially share the same deviceID (this is the case for legacy PCI
devices behind a PCIe-to-PCI bridge).
The size parameter of the MAPD command now matches the allocated ITT.
Tested on QEMU KVM Virtual Machine and Ampere eMAG (Lenovo HR330A).
Explicitely check a pointer against NULL before computing a member address,
to avoid undefined behavior. Avoids the same NULL pointer check being
"optimised" later, leading to NULL pointer dereference.
It is expected that -fno-delete-null-pointer-checks would avoid this but
it does not.
For details see
https://mail-index.netbsd.org/tech-toolchain/2026/05/23/msg004818.html
and PR toolchain/60289
Needs pullup to netbsd-11.
callout(9): tweak
Don't change the name of the argument when explaining callout_pending.
Don't do manual "code hilighing".
Format the paper reference properly (and add missing information).
callout(9): Clarify previous language about clarity/efficiency.
And with that, I think I'm done touching up callout(9) for now.
PR kern/60288: callout(9) does not document callout_schedule()
callout(9): Prefer callout_setfunc/schedule more explicitly.
It is better on clarity grounds; the efficiency difference is really
quite minor.
Prompted by:
PR kern/60288: callout(9) does not document callout_schedule()
callout(9): Partially fix markup error in previous.
Tried to spell out that it will call func(arg) and forgot to fix it
before previous commit. Doesn't look right now but at least it is
not as thoroughly wrong as something that renders as Fa(func, arg).
(This is an invitation for our resident mdoc wizards to correct my
infelicities!)
PR kern/60288: callout(9) does not document callout_schedule()
callout(9): Clarify callout_schedule, _setfunc, and _reset.
Might be better to use .Bl -tag instead of paragraphs of prose too.
PR kern/60288: callout(9) does not document callout_schedule()
Map mode switch to "Command" for US keyboards.
This was necessary as mapping Command to mode swtich with wsconsctl discards
the Cmd1 setting and thus cannot be used to switch terminals.
mkimage: New `-C <config>' option.
Enables use for out-of-tree config files. We're not really
supporting this as a general-purpose tool but downstream users (like
me) may find this convenient to avoid local patches.
ld at virtio: Guard virtio_dequeue by virtio_vq_is_enqueued.
After triggering the DMA operation, or any previous virtio_dequeue,
virtio_vq_is_enqueued issues the necessary bus_dmamap_sync for
virtio_dequeue to observe any potential (new) result.
Normally this happens inside virtio(4) (in virtio_vq_intr) between
interrupt delivery and calling the virtqueue's done callback. But
polling mode I/O operations (and dump operations) don't take that
path, so it is necessary to call virtio_vq_is_enqueued explicitly.
PR kern/60182: ld at virtio sometimes hangs up
virtio(4): Add missing BUS_DMASYNC_PREREAD operations.
And one missing BUS_DMASYNC_POSTREAD operation.
With this change, loads from vq->vq_used->flags (which occur
immediately after a transfer is submitted to test whether we need to
kick the host device) is separated by a PREREAD/POSTREAD cycle from
loads from vq->vq_used->idx (which occur when we think a transfer may
have completed, e.g. upon receiving an interrupt, to test whether it
has, in fact, completed).
Additionally, with this change, consecutive loads from
*vq->vq_avail_event are separated by a PREREAD/POSTREAD cycle.
Should fix virtio(4) issues on m68k and other related architectures
like mips and armv<7:
PR kern/60144: virtio(4) cache coherence issue
[173 lines not shown]