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

Table Of Contents
28-12 Vol. 3
HANDLING BOUNDARY CONDITIONS IN A VIRTUAL MACHINE MONITOR
28.4.2 Machine Check Considerations
The following sequence determine how machine checks are handled during VMXON,
VMXOFF, VM entries, and VM exits:
VMXOFF and VMXON:
If a machine check occurs during VMXOFF or VMXON and CR4.MCE = 1, a
machine-check exception (#MC) is generated. If CR4.MCE = 0, the processor
goes to shutdown state.
VM entry:
If a machine check occurs during VM entry, one of the following two treatments
must occur:
a. Normal delivery. If CR4.MCE = 1, delivery of a machine-check exception
(#MC) through the host IDT occurs. If CR4.MCE = 0, the processor goes to
shutdown state.
b. Load state from the host-state area of the working VMCS as if a VM exit had
occurred (see Section 22.7). The basic exit reason will be “VM-entry failure
due to machine check.
If the machine check occurs after any guest state has been loaded, option b
above must be used. If the machine check occurs while checking host state and
VMX controls (or while reporting a failure due to such checks), option a should be
preferred; however, an implementation may use b, since software will not be able
to tell whether any guest state has been loaded.
VM exit:
If a machine check occurs during VM exit, one of the following two treatments
must occur:
Normal delivery. If CR4.MCE = 1, delivery of a machine-check exception
(#MC) through the guest IDT. If CR4.MCE = 0, the processor goes to
shutdown state.
Fail the VM exit. If the VM exit is to VMX root operation, a VMX abort will
result; it will block events as done normally in VMX abort. The VMX abort
indicator will show a machine check has induced the abort operation.
If a machine check is induced by an action in VMX non-root operation before any
determination is made that the inducing action may cause a VM exit, that
machine check should be considered as happening during guest execution in VMX
non-root operation. This is the case even if the part of the action that caused the
machine check was VMX-specific (for example: the processors consulting an I/O
bitmap). A machine-check exception will occur. If bit 12H of the exception bitmap
is cleared to 0, a machine-check exception could be delivered to the guest
through gate 12H of its IDT; if the bit is set to 1, the machine-check exception will
cause a VM exit.