Description
Introduction
This RFC introduces VIRTIO[1] support in Zephyr RTOS along with the roadmap of future improvements.
Problem description
VIRTIO is a communication protocol designed for paravirtualized devices interfacing. Adding support for VIRTIO in Zephyr allows Zephyr to use a wider array of devices in a virtualized environment. VIRTIO does virtualization in a more efficient way compared to emulating physical devices by leveraging the fact that VIRTIO employs mechanisms, such as laying structures efficiently in memory, to speed up the virtualization process.
Proposed change
Introduction of VIRTIO drivers, and drivers for virtualized VIRTIO-based devices.
Detailed RFC
Proposed change (Detailed)
- Define VIRTIO API that will allow operation on VIRTIO devices, such as:
- Device initialization
- Feature flags/bits negotiation
- Accessing virtqueues
- Accessing device-specific data
- Implement drivers for VIRTIO-based devices methods using the VIRTIO API for transfer methods that are as of date supported in Zephyr: PCI and MMIO
- Implement drivers for specific VIRTIO-based devices, such as a filesystem device, a network device etc.
Roadmap
- Define VIRTIO API: drivers: add API for VIRTIO devices and add VIRTIO PCI driver #83892
- Implement virtqueues: drivers: add API for VIRTIO devices and add VIRTIO PCI driver #83892
- Implement driver for VIRTIO PCI: drivers: add API for VIRTIO devices and add VIRTIO PCI driver #83892
- Implement driver for VIRTIO MMIO: drivers: virtio: add VIRTIO MMIO transport driver #89460
- Implement non-mandatory VIRTIO optimizations like
VIRTIO_F_INDIRECT_DESC
- Add support for legacy (pre v1.0 version of specification) devices
- Write drivers for VIRTIO devices, like:
- Filesystem device: virtio: add virtiofs #86768
- Network device
- Block device
- Entropy source: drivers: entropy: add driver for VirtIO Entropy device #89439
- Console
Dependencies/Limitations
Some of the VIRTIO device classes may not yet have suitable existing Zephyr APIs. Those APIs would have to be introduced along with them. The full list of device types can be found in chapter 5 of the VIRTIO specification.
Concerns and Unresolved Questions
Not all non-mandatory VIRTIO features are as of date supported in QEMU
References
Metadata
Metadata
Assignees
Type
Projects
Status
Status