Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z

5-18 Vol. 2B
VMX INSTRUCTION REFERENCE
VMREAD—Read Field from Virtual-Machine Control Structure
Description
Reads a specified field from the VMCS and stores it into a specified destination
operand (register or memory).
The specific VMCS field is identified by the VMCS-field encoding contained in the
register source operand. Outside IA-32e mode, the source operand has 32 bits,
regardless of the value of CS.D. In 64-bit mode, the source operand has 64 bits;
however, if bits 63:32 of the source operand are not zero, VMREAD will fail due to an
attempt to access an unsupported VMCS component (see operation section).
The effective size of the primary source operand, which may be a register or in
memory, is always 32 bits outside IA-32e mode (the setting of CS.D is ignored with
respect to operand size) and 64 bits in 64-bit mode. If the VMCS field specified by the
secondary source operand is shorter than this effective operand size, the high bits of
the primary source operand are ignored. If the VMCS field is longer, then the high bits
of the field are cleared to 0.
Note that any faults resulting from accessing a memory destination operand can
occur only after determining, in the operation section below, that the VMCS pointer is
valid and that the specified VMCS field is supported.
Operation
IF (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 VMexit;
ELSIF CPL
> 0
THEN #GP(0);
ELSIF current-VMCS pointer is not valid
THEN VMfailInvalid;
ELSIF register source operand does not correspond to any VMCS field
THEN VMfailValid(VMREAD/VMWRITE from/to unsupported VMCS component);
ELSE
DEST contents of VMCS field indexed by register source operand;
VMsucceed;
FI;
Opcode Instruction Description
0F 78 VMREAD r/m64, r64 Reads a specified VMCS field (in 64-bit mode).
0F 78 VMREAD r/m32, r32 Reads a specified VMCS field (outside 64-bit mode).