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

Table Of Contents
21-2 Vol. 3
VMX NON-ROOT OPERATION
Certain exceptions have priority over VM exits. These include invalid-opcode
exceptions, faults based on privilege level, and general-protection exceptions
that are based on checking I/O permission bits in the task-state segment (TSS).
For example, execution of RDMSR with CPL = 3 generates a general-protection
exception and not a VM exit.
1
Faults incurred while fetching instruction operands have priority over VM exits
that are conditioned based on the contents of those operands (see LMSW in
Section 21.1.3).
VM exits caused by execution of the INS and OUTS instructions (resulting either
because the “unconditional I/O exiting” VM-execution control is 1 or because the
“use I/O bitmaps control is 1) have priority over the following faults:
A general-protection fault due to the relevant segment (ES for INS; DS for
OUTS unless overridden by an instruction prefix) being unusable
A general-protection fault due to an offset beyond the limit of the relevant
segment
An alignment-check exception
Fault-like VM exits have priority over exceptions other than those mentioned
above. For example, RDMSR of a non-existent MSR with CPL = 0 generates a
VM exit and not a general-protection exception.
When Section 21.1.2 or Section 21.1.3 (below) identify an instruction execution that
may lead to a VM exit, it is assumed that the instruction does not incur a fault that
takes priority over a VM exit.
21.1.2 Instructions That Cause VM Exits Unconditionally
The following instructions cause VM exits when they are executed in VMX non-root
operation: CPUID, GETSEC,
2
INVD, and XSETBV.
3
This is also true of instructions
introduced with VMX, which include: INVEPT, INVVPID, VMCALL,
4
VMCLEAR,
VMLAUNCH, VMPTRLD, VMPTRST, VMREAD, VMRESUME, VMWRITE, VMXOFF, and
VMXON.
1. MOV DR is an exception to this rule; see Section 21.1.3.
2. An execution of GETSEC in VMX non-root operation causes a VM exit if CR4.SMXE[Bit 14] = 1
regardless of the value of CPL or RAX. An execution of GETSEC causes an invalid-opcode excep-
tion (#UD) if CR4.SMXE[Bit 14] = 0.
3. An execution of XSETBV in VMX non-root operation causes a VM exit if CR4.OSXSAVE[Bit 18] =
1 regardless of the value of CPL, RAX, RCX, or RDX. An execution of XSETBV causes an invalid-
opcode exception (#UD) if CR4.OSXSAVE[Bit 18] = 0.
4. Under the dual-monitor treatment of SMIs and SMM, executions of VMCALL cause SMM VM exits
in VMX root operation outside SMM. See Section 25.15.2.