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

Table Of Contents
Vol. 3 26-15
VIRTUAL-MACHINE MONITOR PROGRAMMING CONSIDERATIONS
26.8 MULTI-PROCESSOR CONSIDERATIONS
The most common VMM design will be the symmetric VMM. This type of VMM runs the
same VMM binary on all logical processors. Like a symmetric operating system, the
symmetric VMM is written to ensure all critical data is updated by only one processor
at a time, IO devices are accessed sequentially, and so forth. Asymmetric VMM
designs are possible. For example, an asymmetric VMM may run its scheduler on one
processor and run just enough of the VMM on other processors to allow the correct
execution of guest VMs. The remainder of this section focuses on the multi-processor
considerations for a symmetric VMM.
A symmetric VMM design does not preclude asymmetry in its operations. For
example, a symmetric VMM can support asymmetric allocation of logical processor
resources to guests. Multiple logical processors can be brought into a single guest
environment to support an MP-aware guest OS. Because an active VMCS can not
control more than one logical processor simultaneously, a symmetric VMM must
make copies of its VMCS to control the VM allocated to support an MP-aware guest
OS. Care must be taken when accessing data structures shared between these
VMCSs. See Section 26.8.4.
Although it may be easier to develop a VMM that assumes a fully-symmetric view of
hardware capabilities (with all processors supporting the same processor feature
sets, including the same revision of VMX), there are advantages in developing a VMM
that comprehends different levels of VMX capability (reported by VMX capability
MSRs). One possible advantage of such an approach could be that an existing soft-
ware installation (VMM and guest software stack) could continue to run without
requiring software upgrades to the VMM, when the software installation is upgraded
to run on hardware with enhancements in the processor’s VMX capabilities. Another
advantage could be that a single software installation image, consisting of a VMM and
guests, could be deployed to multiple hardware platforms with varying VMX capabil-
ities. In such cases, the VMM could fall back to a common subset of VMX features
supported by all VMX revisions, or choose to understand the asymmetry of the VMX
capabilities and assign VMs accordingly.
This section outlines some of the considerations to keep in mind when developing an
MP-aware VMM.
26.8.1 Initialization
Before enabling VMX, an MP-aware VMM must check to make sure that all processors
in the system are compatible and support features required. This can be done by:
Checking the CPUID on each logical processor to ensure VMX is supported and
that the overall feature set of each logical processor is compatible.
Checking VMCS revision identifiers on each logical processor.
Checking each of the “allowed-1” or “allowed-0” fields of the VMX capability
MSRs on each processor.