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

Table Of Contents
Vol. 3 27-3
VIRTUALIZATION OF SYSTEM RESOURCES
27.3 MEMORY VIRTUALIZATION
VMMs must control physical memory to ensure VM isolation and to remap guest
physical addresses in host physical address space for virtualization. Memory virtual-
ization allows the VMM to enforce control of physical memory and yet support guest
OSs’ expectation to manage memory address translation.
27.3.1 Processor Operating Modes & Memory Virtualization
Memory virtualization is required to support guest execution in various processor
operating modes. This includes: protected mode with paging, protected mode with
no paging, real-mode and any other transient execution modes. VMX allows guest
operation in protected-mode with paging enabled and in virtual-8086 mode (with
paging enabled) to support guest real-mode execution. Guest execution in transient
operating modes (such as in real mode with one or more segment limits greater than
64-KByte) must be emulated by the VMM.
Since VMX operation requires processor execution in protected mode with paging
(through CR0 and CR4 fixed bits), the VMM may utilize paging structures to support
memory virtualization. To support guest real-mode execution, the VMM may estab-
lish a simple flat page table for guest linear to host physical address mapping.
Memory virtualization algorithms may also need to capture other guest operating
conditions (such as guest performing A20M# address masking) to map the resulting
20-bit effective guest physical addresses.
27.3.2 Guest & Host Physical Address Spaces
Memory virtualization provides guest software with contiguous guest physical
address space starting zero and extending to the maximum address supported by
the guest virtual processor’s physical address width. The VMM utilizes guest physical
to host physical address mapping to locate all or portions of the guest physical
address space in host memory. The VMM is responsible for the policies and algo-
rithms for this mapping which may take into account the host system physical
memory map and the virtualized physical memory map exposed to a guest by the
VMM. The memory virtualization algorithm needs to accommodate various guest
memory uses (such as: accessing DRAM, accessing memory-mapped registers of
virtual devices or core logic functions and so forth). For example:
To support guest DRAM access, the VMM needs to map DRAM-backed guest
physical addresses to host-DRAM regions. The VMM also requires the guest to
host memory mapping to be at page granularity.
Virtual devices (I/O devices or platform core logic) emulated by the VMM may
claim specific regions in the guest physical address space to locate memory-
mapped registers. Guest access to these virtual registers may be configured to
cause page-fault induced VM-exits by marking these regions as always not