Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
26-8 Vol. 3
VIRTUAL-MACHINE MONITOR PROGRAMMING CONSIDERATIONS
IA32_VMX_TRUE_PROCBASED_CTLS, IA32_VMX_TRUE_EXIT_CTLS, and
IA32_VMX_TRUE_ENTRY_CTLS.
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 G.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.