一、x86
In x86 architecture, Intel in this case, most interrupts will cause CPU VM exit, which means the control of CPU will return to host from guests.
So the processes are
CPU is used by guest OS in VMX non-root mode.
CPU is aware of an interrupt coming.
CPU's control returns to host running in VMX root mode. (VM exit)
The host (KVM) handles the interrupt.
Host executed VMLAUNCH instruction to let CPU transfer to VMX non-root mode again for running guest code.
Repeat 1.
二、ARM
1、外部中断设置路由到EL2;
2、EL2捕获到外部中断,将vcpu从Guest拉回到Host;(可配置中断直接路由到Guest,这样可以bypass hypervisor)
3、在Host重新开中断,中断路由到Host的中断向量表;
4、Host执行完对应的中断处理函数后,将vcpu重新拉回到Guest模式;