The Virtual Machine Monitor (VMM) manages and allocates physical memory for each virtual machine. The guest OS sees a virtualized Guest Physical Address (GPA) space. The OS memory management module maps Guest Virtual Addresses (GVAs) to GPAs. The target address in instructions is also a GPA. In a non-virtualized environment, such an address would be the actual physical address. However, in a virtualized scenario, this address cannot be used directly. Instead, the VMM must first translate the GPA into a Host Physical Address (HPA), which is then executed by the physical processor.
The introduction of the GPA space requires memory virtualization to address two main issues:
Maintaining the mapping relationship between GPAs and HPAs.
Translating GPAs into HPAs whenever a virtual machine accesses a GPA based on the established mapping.
See Figure 1 for an illustration.Figure 1. GVA->GPA->HPA
Hardware-assisted memory virtualization uses Extended Page Tables (EPT) technology to translate GVAs into HPAs at the hardware level.