background image

31-6 Vol. 3C

VIRTUAL-MACHINE MONITOR PROGRAMMING CONSIDERATIONS

c. Set the VMX controls as follows:

i) If the relevant VMX capability MSR reports that a control has a single setting, use that setting.
ii) If (1) the relevant VMX capability MSR reports that a control can be set to 0 or 1; and (2) the control’s 

meaning is known to the VMM; then set the control based on functionality desired.

iii) If (1) the relevant VMX capability MSR reports that a control can be set to 0 or 1; (2) the control’s 

meaning is not known to the VMM; and (3) the control is not in the default1 class; then set the control 
to 0.

iv) If (1) the relevant VMX capability MSR reports that a control can be set to 0 or 1; (2) the control’s 

meaning is not known to the VMM; and (3) the control is in the default1 class; then set the control to 1.

A VMM using this algorithm will set to 1 all controls in default1 class whose meaning it does not know (either
in step (c)(i) or step (c)(iv)). It will operate correctly even on processors that allow some controls in the
default1 class to be 0. Unlike a VMM using Algorithm 1, a VMM using Algorithm 2 will be able to use the new
features enabled by the 0-setting of such controls.

3. The following algorithm uses the details given in Appendix A.2. This algorithm does not require software to 

know the identity of the controls in the default1 class:
a. Using RDMSR, read the VMX capability MSRs IA32_VMX_BASIC, IA32_VMX_PINBASED_CTLS, 

IA32_VMX_PROCBASED_CTLS, IA32_VMX_EXIT_CTLS, and IA32_VMX_ENTRY_CTLS.

b. If bit 55 of the IA32_VMX_BASIC MSR is 0, set the VMX controls as follows:

i) If the relevant VMX capability MSR reports that a control has a single setting, use that setting.
ii) If (1) the relevant VMX capability MSR reports that a control can be set to 0 or 1; and (2) the control’s 

meaning is known to the VMM; then set the control based on functionality desired.

iii) If (1) the relevant VMX capability MSR reports that a control can be set to 0 or 1; and (2) the control’s 

meaning is not known to the VMM; then set the control to 0.

c. If bit 55 of the IA32_VMX_BASIC MSR is 1, use RDMSR to read the VMX capability MSRs 

IA32_VMX_TRUE_PINBASED_CTLS, IA32_VMX_TRUE_PROCBASED_CTLS, IA32_VMX_TRUE_EXIT_CTLS, 
and IA32_VMX_TRUE_ENTRY_CTLS. Set the VMX controls as follows:
i) If the relevant VMX capability MSR just read reports that a control has a single setting, use that 

setting.

ii) If (1) the relevant VMX capability MSR just read reports that a control can be set to 0 or 1; and (2) the 

control’s meaning is known to the VMM; then set the control based on functionality desired.

iii) If (1) the relevant VMX capability MSR just read reports that a control can be set to 0 or 1; (2) the 

control’s meaning is not known to the VMM; and (3) the relevant VMX capability MSR as read in step (a) 
reports that a control can be set to 0; then set the control to 0.

iv) If (1) the relevant VMX capability MSR just read reports that a control can be set to 0 or 1; (2) the 

control’s meaning is not known to the VMM; and (3) the relevant VMX capability MSR as read in step (a) 
reports that a control must be 1; then set the control to 1.

A VMM using this algorithm will set to 1 all controls in the default1 class whose meaning it does not know (in
step (b)(i), step (c)(i), or step (c)(iv)). It will operate correctly even on processors that allow some controls
in the default1 class to be 0. Unlike a VMM using Algorithm 1, a VMM using Algorithm 3 will be able to use the
new features enabled by the 0-setting of such controls. Unlike a VMM using Algorithm 2, a VMM using
Algorithm 3 need not know the identities of the controls in the default1 class.

31.6 

PREPARATION AND LAUNCHING A VIRTUAL MACHINE

The following list describes the minimal steps required by the VMM to set up and launch a guest VM.

Create a VMCS region in non-pageable memory of size specified by the VMX capability MSR IA32_VMX_BASIC 
and aligned to 4-KBytes. Software should read the capability MSRs to determine width of the physical 
addresses that may be used for a VMCS region and ensure the entire VMCS region can be addressed by