The vCPU Loop

KVM_RUN
guest runsnative speed
VM exit
fc handles it
enter device touch exit reason again
loop : exit = ioctl(vcpu, KVM_RUN) if exit == MMIO : device.handle() if exit == IO : port.handle()
  • MMIO : virtio device registers
  • IO : serial + i8042 ports (x86)
  • the rest : KVM keeps it