Trapless Shadow Page Tables via Hardware Acceleration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional shadow page tables in virtualized host systems incur significant overhead due to the need for the hypervisor to trap and synchronize VM-initiated modifications, leading to context switching overhead and increased pressure on the translation lookaside buffer (TLB).
Innovation Solution
The implementation of a hardware device, referred to as an SPT accelerator, intercepts memory write operations from virtual machines and autonomously translates guest virtual address to host physical address mappings, eliminating the need for hypervisor traps and synchronizing guest OS page tables with shadow page tables in real-time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If conventional shadow page tables are used with hypervisor traps to synchronize guest OS page tables, then address translation accuracy is improved, but context switching overhead increases and system performance deteriorates
Solution Approach 1:
The patent introduces a translation lookaside buffer (TLB) as an intermediary caching mechanism between the guest OS page tables and the shadow page tables. The TLB caches recently accessed address translations, allowing the system to retrieve translations quickly without triggering hypervisor traps for every memory access, thereby reducing context switching overhead while maintaining translation accuracy.
Solution Approach 2:
The patent performs preliminary synchronization of shadow page tables with guest OS page tables only when necessary (e.g., on page table modifications), rather than synchronizing on every memory access. This preliminary action approach reduces the frequency of hypervisor traps and context switches, improving system performance while maintaining address translation accuracy when needed.
2Reliability
If shadow page tables are updated on every guest OS page table modification to maintain coherency, then address translation reliability is improved, but processing overhead and system performance worsen
Solution Approach 1:
The patent implements a feedback mechanism where the hypervisor is notified only when guest OS page table modifications occur (through traps on page table write operations). The shadow page tables are then updated selectively based on this feedback, ensuring reliability only when necessary rather than on every memory access, thus maintaining coherency while improving system performance.
Solution Approach 2:
The guest OS is modified to self-service by setting specific bits (e.g., access rights bits) in page table entries that indicate when modifications have occurred. These self-indicated modifications trigger selective synchronization with shadow page tables, reducing the need for continuous hypervisor intervention and improving overall system productivity while maintaining translation reliability.
3Loss of time
If nested page tables are used to eliminate hypervisor traps, then context switching overhead is reduced, but the number of page walks and memory accesses increases
Solution Approach 1:
The patent segments the address translation process into two distinct parts: guest OS page tables for virtual-to-physical address mapping and shadow page tables for virtual-to-host-physical address mapping. This segmentation allows the MMU to use shadow page tables directly without nested page walks, reducing memory access overhead while maintaining the benefits of eliminating frequent hypervisor traps through selective synchronization.
Data Source
AI summary
Techniques for implementing trapless shadow page tables in a virtualized host system are provided. In one embodiment, an SPT accelerator device of the host system can intercept a memory write operation originating from a virtual machine (VM) and directed to a guest OS page table of the VM, where the guest OS page table is stored in a device memory of the SPT accelerator device. The SPT accelerator device can further extract a guest virtual address (GVA)-to-guest physical address (GPA) mapping in the memory write instruction and can translate the GVA-to-GPA mapping into a GVA-to-host physical address (HPA) mapping. The SPT accelerator device can then write the GVA-to-HPA mapping to a shadow page table of the host system.


