Reputation: 311
I want to understand:
How virtio driver increase performance compare to full virtualization or hw assisted virtualization (like virtio_net or virtio_blk )?
How these virtio drivers affect VMEXIT/VMENTER or context switch between guest & Hypervisor?
What is the basic idea or architecture of virtio ?
Thanks
Upvotes: 3
Views: 5780
Reputation: 6030
VIRTIO is a para-virtiualized interface. This means the guest has to be aware it's running in a virtualized environment so it can deploy it's VIRTIO drivers to talk to virtual hardware. The para-virtualized case is optimised to keep the number of guest->hyper-visor->host and back transitions to a minimum and therefore improve performance. The difference is compared to full virtualization where the guest may not know it's virtualized as it's presented with a number of emulated pieces of hardware which as far as it's concerned is real hardware. However for each access to the hardware there is a trap out of the guest to process each individual access. If a NIC card for example needs 20 registers set-up to send a packet that would be 20 transitions out of the guest and to the emulator.
Now there is another type of virtualization the relies on IOMMUs. These can be programmed to pass portions of their address space to given VMs. As a result the VM can access the hardware directly and the hyper-visor/host doesn't need to get involved in the emulation of real hardware. In this case it might be a virtual NIC which is actually a real NIC which has been sub-divided into a number of different virtual NICs, one for each VM.
There is a good write-up of the VIRTIO architecture at http://vmsplice.net/~stefan/virtio-devconf-2014.pdf
Upvotes: 4