Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
Vol. 2B 5-7
VMX INSTRUCTION REFERENCE
VMCLEAR—Clear Virtual-Machine Control Structure
Description
This instruction applies to the VMCS whose VMCS region resides at the physical
address contained in the instruction operand. The instruction ensures that VMCS
data for that VMCS (some of these data may be currently maintained on the
processor) are copied to the VMCS region in memory. It also initializes parts of the
VMCS region (for example, it sets the launch state of that VMCS to clear). See
Chapter 20, “Virtual-Machine Control Structures,” in the Intel® 64 and IA-32 Archi-
tectures Software Developer’s Manual, Volume 3B.
The operand of this instruction is always 64 bits and is always in memory. If the
operand is the current-VMCS pointer, then that pointer is made invalid (set to
FFFFFFFF_FFFFFFFFH).
Note that the VMCLEAR instruction might not explicitly write any VMCS data to
memory; the data may be already resident in memory before the VMCLEAR is
executed.
Operation
IF (register operand) or (not in VMX operation) or (RFLAGS.VM = 1) or
(IA32_EFER.LMA = 1 and CS.L = 0)
THEN #UD;
ELSIF in VMX non-root operation
THEN VM exit;
ELSIF CPL
> 0
THEN #GP(0);
ELSE
addr ← contents of 64-bit in-memory operand;
IF addr is not 4KB-aligned OR
(processor supports Intel 64 architecture and
addr sets any bits beyond the physical-address width) OR
(processor does not support Intel 64 architecture, addr sets any bits in the range 63:32)
THEN VMfail(VMCLEAR with invalid physical address);
ELSIF addr = VMXON pointer
THEN VMfail(VMCLEAR with VMXON pointer);
ELSE
ensure that data for VMCS referenced by the operand is in memory;
initialize implementation-specific data in VMCS region;
launch state of VMCS referenced by the operand ← “clear”
Opcode Instruction Description
66 0F C7 /6 VMCLEAR m64 Copy VMCS data to VMCS region in memory.