Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
Vol. 3 28-3
HANDLING BOUNDARY CONDITIONS IN A VIRTUAL MACHINE MONITOR
Interrupt-window Exiting. The interrupt-window exiting control bit in the
VM-execution controls (Section 20.6.2) causes VM exits when guest RFLAGS.IF is
1 and no other conditions block external interrupts. If the control is 1, a VM exit
occurs at the beginning of any instruction at which RFLAGS.IF = 1 and on which
the interruptibility state of the guest would allow delivery of an interrupt. For
example: when the guest executes an STI instruction, RFLAGS = 1, and if at the
completion of next instruction the interruptibility state masking due to STI is
removed; a VM exit occurs if interrupt-window exiting control is 1. The interrupt-
window exiting feature allows a VMM to queue a virtual interrupt to the guest
when the guest is not in an interruptible state. The VMM can set the interrupt-
window exiting control for the guest and depend on a VM exit to know when the
guest becomes interruptible (and, therefore, when it can inject a virtual
interrupt). The VMM can detect such VM exits by checking for the basic exit
reason ‘interrupt-window’ (value = 7). Without interrupt-window exiting support,
the VMM will need to poll and check the interruptibility state of the guest to
deliver virtual interrupts.
NMI-window Exiting. If the “virtual NMIs” VM-execution is set, the processor
tracks virtual-NMI blocking. The NMI-window exiting control bit in VM-execution
controls (Section 20.6.2) causes VM exits when there is no virtual-NMI blocking.
For example, after execution of the IRET instruction, a VM exit occurs if NMI-
window exiting control is 1. The NMI-window exiting feature allows a VMM to
queue a virtual NMI to a guest when the guest is not ready to receive NMIs. The
VMM can set the NMI-window exiting control for the guest and depend on a
VM exit to know when the guest becomes ready for NMIs (and, therefore, when it
can inject a virtual NMI). The VMM can detect such VM exits by checking for the
basic exit reason ‘NMI window’ (value = 8). Without NMI-window exiting support,
the VMM will need to poll and check the interruptibility state of the guest to
deliver virtual NMIs.
VM-Exit Information. The VM-exit information fields provide details on
VM exits due to exceptions and interrupts. This information is provided through
the exit-qualification, VM-exit-interruption-information, instruction-length and
interruption-error-code fields. Also, for VM exits that occur in the course of
vectoring through the guest-IDT, information about the event that was being
vectored through the guest-IDT is provided in the IDT-vectoring-information and
IDT-vectoring-error-code fields. These information fields allow the VMM to
identify the exception cause and to handle it properly.
28.3 EXTERNAL INTERRUPT VIRTUALIZATION
VMX operation allows both host and guest control of external interrupts. While guest
control of external interrupts might be suitable for partitioned usages (different CPU
cores/threads and I/O devices partitioned to independent virtual machines), most
VMMs built upon VMX are expected to utilize host control of external interrupts. The
rest of this section describes a general host-controlled interrupt virtualization archi-
tecture for standard PC platforms through the use of VMX supported features.