squib-virtio 0.2.0

virtio-MMIO transport and per-device drivers for squib
Documentation

virtio-MMIO transport and per-device drivers for squib.

This crate ports the virtio-MMIO state machine and per-device frontends described in 14-virtio-and-devices.md. The transport speaks the virtio v1.2 MMIO register layout and adapts it to squib-native abstractions:

  • [squib_bus::BusDevice] for the MMIO-routed register surface.
  • [squib_core::GuestMemory] for descriptor / payload reads and writes.
  • [squib_gic::Gic::pulse_spi] for edge-rising IRQ delivery (D24).

The crate intentionally avoids vmm-sys-util, kvm-ioctls, and the upstream Linux-flavoured EventFd plumbing — squib-vmm uses Tokio channels for cross-thread queue notifications and the GIC's pulse_spi is synchronous through Arc<dyn Gic>. See I-CRATE-3 in 61-crates-and-features.md § 7.

Module layout

Module Role
[device] Per-device-type trait surface ([device::VirtioDevice])
[device_id] Standard virtio device IDs (block=2, net=1, vsock=19, ...)
[device_status] Status bits driving the driver-init state machine
[feature_bits] Common feature bits (VIRTIO_F_VERSION_1, ...)
[interrupt] [interrupt::IrqLine] — wraps Gic + IntId for the device side
[queue] Virtqueue: descriptors, avail/used rings, [queue::DescriptorChain]
[slot] MMIO-slot allocator (32-slot ceiling, base 0x0F00_0000 + slot * 0x1000)
[transport] virtio-MMIO BusDevice: register layout + driver-init state machine
[devices] Per-device frontends: block, net, vsock, balloon, rng, console, pmem, mem, boot-timer