Expand description
Unified split-virtqueue over guest physical memory.
SplitQueue is the single queue abstraction every ArcBox VirtIO device and
worker uses to walk the available ring, parse descriptor chains, publish to
the used ring, and decide whether to interrupt the guest. It replaces the
previously-duplicated implementations (queue::VirtQueue local rings,
queue_guest::GuestMemoryVirtQueue raw pointers, the per-device inline GPA
walks, arcbox-vmm::virtqueue_util, and the net-TX inline used-ring write).
All addresses are guest physical addresses (GPAs); the backing
GuestMemWriter performs the single gpa_base translation, so devices
never subtract gpa_base themselves.
Three correctness properties live here exactly once:
- Cycle-safe chain walk — bounded by
size, so a malformed/maliciousnextcycle cannot spin the host thread. - Acquire on consume — the
Acquirefence is placed after readingavail.idxand before reading the ring/descriptors, pairing with the guest’sReleaseonavail.idx. - Spec-correct notification suppression — a full
SeqCstfence between publishingused.idxand readingused_eventcloses the StoreLoad race that otherwise lets the device read a staleused_event, suppress a needed IRQ, and leave the guest asleep in WFI forever.
Structs§
- Chain
Iter - Allocation-free walk of a descriptor chain (see
SplitQueue::chain_iter). - Desc
Chain - A popped descriptor chain: the head index (used as the used-ring id) and the descriptors walked from it.
- Split
Queue - A VirtIO split virtqueue backed by guest physical memory.
- Virtq
Desc - A single descriptor read from the descriptor table.
addris a GPA.