VMPTRLD

Load Pointer to Virtual-Machine Control Structure

Opcodes

Hex Mnemonic Encoding Long Mode Legacy Mode Description
0F C7 /6 VMPTRLD None None None Loads the current VMCS pointer from memory.

Description

Marks the current-VMCS pointer valid and loads it with the physical address in the instruction operand. The instruction fails if its operand is not properly aligned, sets unsupported physical-address bits, or is equal to the VMXON pointer. In addition, the instruction fails if the 32 bits in memory referenced by the operand do not match the VMCS revision identifier supported by this processor.1

The operand of this instruction is always 64 bits and is always in memory.

Pseudo Code

IF (register operand) or (not in VMX operation) or (CR0.PE = 0) or (RFLAGS.VM = 1) or (IA32_EFER.LMA = 1 and CS.L = 0)
	#UD;
ELSE
	IF in VMX non-root operation
		VMexit;
	ELSE
		IF CPL > 0
			#GP(0);
		ELSE
			addr = contents of 64-bit in-memory source operand;
			IF addr is not 4KB-aligned OR (processor supports Intel 64 architecture and addr sets any bits beyond the processor's physical-address width) OR processor does not support Intel 64 architecture and addr sets any bits in the range 63:32
				VMfail(VMPTRLD with invalid physical address);
			ELSE
				IF addr = VMXON pointer
					VMfail(VMPTRLD with VMXON pointer);
				ELSE
					rev = 32 bits located at physical address addr;
					IF rev != VMCS revision identifier supported by processor
						VMfail(VMPTRLD with incorrect VMCS revision identifier);
					ELSE
						current-VMCS pointer = addr;
						VMsucceed;
					FI;
				FI;
			FI;
		FI;
	FI;
FI;

Flags Affected

See the operation section and Section 5.2.

Exceptions

64-Bit Mode Exceptions

Exception Description
#UD If operand is a register. If not in VMX operation.
#SS(0) If the source operand is in the SS segment and the memory address is in a non-canonical form.
#PF(fault-code) If a page fault occurs in accessing the memory source operand.
#GP(0) If the current privilege level is not 0. If the source operand is in the CS, DS, ES, FS, or GS segments and the memory address is in a non-canonical form.

Compatibility Mode Exceptions

Exception Description
#UD The VMPTRLD instruction is not recognized in compatibility mode.

Virtual-8086 Mode Exceptions

Exception Description
#UD The VMPTRLD instruction is not recognized in virtual-8086 mode.

Real-Address Mode Exceptions

Exception Description
#UD A logical processor cannot be in real-address mode while in VMX operation and the VMPTRLD instruction is not recognized outside VMX operation.

Protected Mode Exceptions

Exception Description
#UD If operand is a register. If not in VMX operation.
#SS(0) If the memory source operand effective address is outside the SS segment limit. If the SS register contains an unusable segment.
#PF(fault-code) If a page fault occurs in accessing the memory source operand.
#GP(0) If the current privilege level is not 0. If the memory source operand effective address is outside the CS, DS, ES, FS, or GS segment limit. If the DS, ES, FS, or GS register contains an unusable segment. If the source operand is located in an execute-only code segment.