0

I am having trouble understanding how para-virtualized devices offer increased performance compared to typical emulated devices. For example, in the context of KVM, virtio uses a virtio_ring which is used as a shared memory region between the VMM and guest but still requires VM exits to "kick" and notify the VMM that it has data to send (to the NIC, for example). I suppose there could be less page faults than typical MMIO emulated devices, but does that alone really offer that much of an improvement? Any further clarification would be greatly appreciated. Also, please correct any misconceptions I may have regarding KVM, virtio and para-virtualized devices in general.

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
ballsmahoney
  • 141
  • 1
  • 6
  • 2
    As far as I know, there are two main advantages to paravirtualized devices: 1) Software can write to multiple device control registers at once, instead of requiring a VM exit for each register write. 2) Software can pass information to the VMM in predetermined registers so the VMM doesn't need to read and decode the guest instruction to handle the VM exit. – prl Nov 20 '21 at 02:20
  • 1
    For example, when handling an interrupt, software may need to update the tail pointer of a queue and clear the interrupt status flag. A paravirtualized device may use a single VM exit to do both steps. – prl Nov 20 '21 at 02:21
  • When you say "VMM doesn't need to read and decode the guest instruction", do you mean it just processes the VM's request for it based on what was written to the register? How does the VMM know it needs to do this without being notified by the VM (and thus not incurring a VM exit)? Is a VMM thread always polling, or does a specific register alert the VMM there is a I/O request? – ballsmahoney Nov 20 '21 at 14:37

0 Answers0