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

Table Of Contents
Vol. 3 28-11
HANDLING BOUNDARY CONDITIONS IN A VIRTUAL MACHINE MONITOR
5. Update the virtual interrupt controller state. When the above checks have
passed, before generating the virtual interrupt to the guest, the VMM updates the
virtual interrupt controller state (Local-APIC, IO-APIC and/or PIC) to reflect
assertion of the virtual interrupt. This involves updating the various interrupt
capture registers, and priority registers as done by the respective hardware
interrupt controllers. Updating the virtual interrupt controller state is required for
proper interrupt event processing by guest software.
6. Inject the virtual interrupt on VM entry. To inject an external virtual interrupt to a
guest VM, the VMM sets up the VM-entry interruption-information field in the
guest controlling-VMCS before entry to guest using VMRESUME. Upon VM entry,
the processor will use this vector to access the gate in guest’s IDT and the value
of RFLAGS and EIP in guest-state area of controlling-VMCS is pushed on the
guest stack. If the guest RFLAGS.IF is clear, the STI-masking bit is set, or the
MOV- SS/POP-SS-masking bit is set, the VM entry will fail and the processor will
load state from the host-state area of the working VMCS as if a VM exit had
occurred (see Section 22.7).
28.4 ERROR HANDLING BY VMM
Error conditions may occur during VM entries and VM exits and a few other situa-
tions. This section describes how VMM should handle these error conditions,
including triple faults and machine check exceptions.
28.4.1 VM-Exit Failures
All VM exits load processor state from the host-state area of the VMCS that was the
controlling VMCS before the VM exit. This state is checked for consistency while being
loaded. Because the host-state is checked on VM entry, these checks will generally
succeed. Failure is possible only if host software is incorrect or if VMCS data in the
VMCS region in memory has been written by guest software (or by I/O DMA) since
the last VM entry. VM exits may fail for the following reasons:
There was a failure on storing guest MSRs.
There was failure in loading a PDPTR.
The controlling VMCS has been corrupted (through writes to the corresponding
VMCS region) in such a way that the implementation cannot complete the VM
exit.
There was a failure on loading host MSRs.
A machine check occurred.
If one of these problems occurs on a VM exit, a VMX abort results.