Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
5-22 Vol. 2B
VMX INSTRUCTION REFERENCE
VMWRITE—Write Field to Virtual-Machine Control Structure
Description
Writes to a specified field in the VMCS specified by a secondary source operand
(register only) using the contents of a primary source operand (register or memory).
The VMCS field is identified by the VMCS-field encoding contained in the register
secondary source operand. Outside IA-32e mode, the secondary source operand is
always 32 bits, regardless of the value of CS.D. In 64-bit mode, the secondary source
operand has 64 bits; however, if bits 63:32 of the secondary source operand are not
zero, VMWRITE will fail due to an attempt to access an unsupported VMCS compo-
nent (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 source operand occur after
determining, in the operation section below, that the VMCS pointer is valid but before
determining if the destination 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 destination operand does not correspond to any VMCS field
THEN VMfailValid(VMREAD/VMWRITE from/to unsupported VMCS component);
ELSIF VMCS field indexed by register destination operand is read-only)
THEN VMfailValid(VMWRITE to read-only VMCS component);
ELSE
VMCS field indexed by register destination operand ← SRC;
Opcode Instruction Description
0F 79 VMWRITE r64, r/m64 Writes.a specified VMCS field (in 64-bit mode)
0F 79 VMWRITE r32, r/m32 Writes.a specified VMCS field (outside 64-bit mode)