GPA Overlay Pages
The hypervisor defines several special pages that "overlay" the guest operating system's guest physical address (GPA) space. The hypercall code page is an example of an overlay page. Overlay pages are addressed by guest physical addresses but are not included in the normal GPA map that the hypervisor maintains. Conceptually, overlay pages exist in a separate map that overlays the GPA map.
If a page within the GPA space is overlaid, any system physical address (SPA) page that is mapped to the GPA page is effectively obscured and generally unreachable by the virtual processor through processor memory accesses. Furthermore, access rights that are installed on the underlying GPA page are not honored when accessing an overlay page.
If an overlay page is disabled or is moved to a new location in the GPA space, the underlying GPA page is uncovered, and an existing mapping becomes accessible to the guest operating system.
If multiple overlay pages are programmed to appear on top of each other (for example, the guest programs the APIC to appear on top of the hypercall page), the hypervisor will choose an ordering (which is undefined), and only one of these overlays will be visible to code running within the partition. In such cases, if the top-most overlay is disabled or moved, another overlay page will become visible.
Parent partitions that include instruction-completion logic should use the HvTranslateVirtualAddress, HvReadGpa, and HvWriteGpa hypercall functions to emulate virtual processor memory accesses correctly in the presence of overlays.
HvTranslateVirtualAddress returns a flag that indicates whether the specified virtual address maps to an overlay page. HvReadGpa and HvWriteGpa perform the GPA access in the same way that the specified virtual processor would have. If an overlay page is present at the specified address, the access is directed to that overlay page. Otherwise, the access is directed to the underlying GPA page.
When the hypervisor performs a guest-page-table walk either in response to a virtual processor memory access or to a call to HvTranslateVirtualAddress, the hypervisor might find that a page table is located on a GPA location that is associated with an overlay page. In this case, the hypervisor can choose to do any one of the following:
-
Generate a guest page fault.
-
Reference the contents of the overlay page.
-
Reference the contents of the underlying GPA mapping.
Because this behavior can vary from one hypervisor implementation to the next, it is strongly recommended that guests avoid this situation.
Send comments about this topic to Microsoft
Build date: 11/16/2013