Hypervisor Data Types for Address Spaces and Memory Pages
The hypervisor architecture defines the following independent address spaces:
- System physical addresses (SPAs)
SPAs define the physical address space of the underlying hardware as seen by the CPUs. There is only one system physical address space per computer.
- Guest physical addresses (GPAs)
GPAs define the guest operating system's view of physical memory. GPAs can be mapped to underlying SPAs. There is one guest physical address space per partition.
- Guest virtual addresses (GVAs)
GVAs are used within the guest operating system when it enables address translation and provides a valid guest page table.
The size of all three of these address spaces can be up to 264 bytes. The following types are therefore defined:
typedef UINT64 HV_SPA; typedef UINT64 HV_GPA; typedef UINT64 HV_GVA;
Many hypervisor interfaces act on pages of memory instead of on single bytes. The minimum page size is architecture-dependent. For x64 operating systems, the minimum page size is defined as 4 KB. The following types are defined for hypervisor pages of memory:
#define X64_PAGE_SIZE 0x1000 #define HV_X64_MAX_PAGE_NUMBER (MAXUINT64/X64_PAGE_SIZE) #define HV_PAGE_SIZE X64_PAGE_SIZE #define HV_LARGE_PAGE_SIZE X64_LARGE_PAGE_SIZE #define HV_PAGE_MASK (HV_PAGE_SIZE - 1) typedef UINT64 HV_SPA_PAGE_NUMBER; typedef UINT64 HV_GPA_PAGE_NUMBER; typedef UINT64 HV_GVA_PAGE_NUMBER; typedef HV_GPA_PAGE_NUMBER *PHV_GPA_PAGE_NUMBER;
To convert an HV_SPA to an HV_SPA_PAGE_NUMBER, divide by HV_PAGE_SIZE.
Build date: 11/16/2013