background image

23-2 Vol. 3C

INTRODUCTION TO VIRTUAL MACHINE EXTENSIONS

23.4 

LIFE CYCLE OF VMM SOFTWARE

Figure 23-1 illustrates the life cycle of a VMM and its guest software as well as the interactions between them. The 
following items summarize that life cycle:

Software enters VMX operation by executing a VMXON instruction.

Using VM entries, a VMM can then enter guests into virtual machines (one at a time). The VMM effects a 
VM entry using instructions VMLAUNCH and VMRESUME; it regains control using VM exits. 

VM exits transfer control to an entry point specified by the VMM. The VMM can take action appropriate to the 
cause of the VM exit and can then return to the virtual machine using a VM entry.

Eventually, the VMM may decide to shut itself down and leave VMX operation. It does so by executing the 
VMXOFF instruction.

23.5 

VIRTUAL-MACHINE CONTROL STRUCTURE

VMX non-root operation and VMX transitions are controlled by a data structure called a virtual-machine control 
structure (VMCS).
Access to the VMCS is managed through a component of processor state called the VMCS pointer (one per logical 
processor). The value of the VMCS pointer is the 64-bit address of the VMCS. The VMCS pointer is read and written 
using the instructions VMPTRST and VMPTRLD. The VMM configures a VMCS using the VMREAD, VMWRITE, and 
VMCLEAR instructions.
A VMM could use a different VMCS for each virtual machine that it supports. For a virtual machine with multiple 
logical processors (virtual processors), the VMM could use a different VMCS for each virtual processor.

23.6 

DISCOVERING SUPPORT FOR VMX

Before system software enters into VMX operation, it must discover the presence of VMX support in the processor. 
System software can determine whether a processor supports VMX operation using CPUID. If 
CPUID.1:ECX.VMX[bit 5] = 1, then VMX operation is supported. See Chapter 3, “Instruction Set Reference, A-L” of 
Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 2A.
The VMX architecture is designed to be extensible so that future processors in VMX operation can support addi-
tional features not present in first-generation implementations of the VMX architecture. The availability of exten-
sible VMX features is reported to software using a set of VMX capability MSRs (see Appendix A, “VMX Capability 
Reporting Facility”).

Figure 23-1.  Interaction of a Virtual-Machine Monitor and Guests

VM Monitor

Guest 0

Guest 1

VM Exit

VM Exit

VM Entry

VMXOFF

VMXON