virtio-mmio
The memory mapped virtio device behavior is based on the PCI device specification. Therefore most operations including device initialization, queues configuration and buffer transfers are nearly identical. Existing differences are described in the following sections.
还记得 virtio-pci 的 layout 吗:
- Common configuration
- Notifications
- ISR Status
- Device-specific configuration (optional)
- PCI configuration access
MMIO virtio devices provide a set of memory mapped control registers followed by a device-specific configuration space,所以大概是这样的:
- Memory mapped control registers
- Device-specific configuration space
Memory mapped control registers 里面包含了很多类似的东西,比如 PCI 里的 Common configuration 包含了 features bits,而 register 里有 DeviceFeatures/DeviceFeaturesSel/DriverFeatures/DriverFeaturesSel
这些 registers。
Device-specific configuration space starts at the offset 0x100 and is accessed with byte alignment. Its meaning and size depend on the device and the driver.