Acknowledge interrupt on exit. The “acknowledge interrupt on exit” VM-exit
control in the controlling VMCS controls processor behavior for external interrupt
acknowledgement. If the control is 1, the processor acknowledges the interrupt
controller to acquire the interrupt vector upon VM exit, and stores the vector in
the VM-exit interruption-information field. If the control is 0, the external
interrupt is not acknowledged during VM exit. Since RFLAGS.IF is automatically
cleared on VM exits due to external interrupts, VMM re-enabling of interrupts
(setting RFLAGS.IF = 1) initiates the external interrupt acknowledgement and
vectoring of the external interrupt through the monitor/host IDT.
kvm设置对应的字段为0,Xen设置为1。
在代码中,kvm处理如下:
kvm_x86_ops->run(vcpu);
local_irq_enable();
调用 local_irq_enable();打开中断,触发hostos进行处理。