i'm studying how virtio works with qemu and kvm. And i have two questions.
so far, i understood virtio frond-end drivers (in guests) write IO requests in vring(virtqueue) and kick qemu. Then qemu is notified, translate requests in vring and invoke syscalls such as open, write, read, close, and so on.
Q1. how to share vring between virtio front-end drivers and qemu? I got some information that memory map is used from http://www.slideshare.net/zenixls2/052-virtio-introduction-17191942. But, I cannot find it in source codes. Please let me know where it is in source code.
Q2. how to kick qemu? I cannot understand how front-end drivers kick qemu? I think qemu's memory listeners recieve and handle the kick. But i cannot find it in source code.
VirtIO is a platform for IO virtualization, common to several hypervisors (and QEMU). The guest operating system needs specialized drivers to handle these devices.
In a nutshell, virtio is an abstraction layer over devices in a paravirtualized hypervisor. virtio was developed by Rusty Russell in support of his own virtualization solution called lguest .
VirtIO Drivers are paravirtualized drivers for kvm/Linux (see http://www.linux-kvm.org/page/Virtio). In short, they enable direct (paravirtualized) access to devices and peripherals for virtual machines using them, instead of slower, emulated, ones.
Fedora infrastructure hosts virtIO drivers and additional software agents for Windows virtual machines running on kernel-based virtual machines (KVM). virtIO is a virtualization standard for network and disk device drivers.
Front-end drivers kick QEMU by writing to an I/O port (in the PCI virtio device's I/O BARs; you can find the address with lspci).
To share memory between the guest and the virtio device, QEMU does "DMA" with address_space_map and address_space_unmap (or cpu_physical_memory_map and cpu_physical_memory_unmap instead depending on the QEMU version).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With