Shadow Pagetable Management in SLAT-Free Virtual Machines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Systems without Second Level Address Translation (SLAT) face significant performance losses due to the costs of maintaining shadow pagetables and frequent transitions between guest and hypervisor modes for handling shadow pagefaults, leading to inefficient memory virtualization.
Innovation Solution
A method that reduces the setup costs of shadow pagetables and minimizes transitions by using a shared queue for recording pagetable modifications, allowing the guest kernel to manage consistency and notify the hypervisor through hypercalls, and employing preloading and non-shadow pagefault intercept elision to optimize pagefault handling.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If shadow pagetables are used for memory virtualization in systems without SLAT, then memory virtualization is enabled, but performance is degraded due to frequent VM exits and shadow pagefault handling
Solution Approach 1:
The guest operating system kernel is modified to self-manage shadow pagetable consistency by detecting its own pagetable modifications and notifying the hypervisor through hypercalls, eliminating the need for the hypervisor to intercept and handle every shadow pagefault, thus reducing VM exits and improving performance
2Reliability
If the hypervisor manages shadow pagetable consistency, then memory virtualization is maintained, but the overhead of frequent VM exits and shadow pagefault handling increases
Solution Approach 1:
The guest kernel proactively identifies and notifies the hypervisor about pagetable modifications before shadow pagefaults occur, allowing the hypervisor to pre-update shadow pagetables and avoid frequent VM exits caused by shadow pagefaults, thereby reducing time loss
3Ease of manufacture
If paravirtualization techniques are used for MMU virtualization, then setup complexity is reduced, but performance overhead remains due to shadow pagetable maintenance
Solution Approach 1:
The guest kernel autonomously tracks its own pagetable modifications and communicates them to the hypervisor, eliminating the need for complex hypervisor-side interception mechanisms while maintaining shadow pagetable consistency, thus improving performance without sacrificing setup simplicity
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method for memory virtualization in systems with virtualization support, wherein the system comprises at least the address spaces guest virtual, guest physical and host physical. The system further comprises: a guest pagetable for translating addresses of the address space guest virtual into addresses of the address space guest physical, and a shadow pagetable for translating addresses of the address space guest virtual into addresses of the address space host physical, wherein a guest operating system does not have access to the shadow pagetable, and a hypervisor. The hypervisor is configured for calculating address entries for the shadow pagetable from respectively valid address entries in the guest pagetable, and for entering said calculated address entries for the shadow pagetable into the shadow pagetable. The method is characterized by managing one or more shadow pagetables by the hypervisor while the guest context is executed by the guest operating system, wherein the number of the one or more shadow pagetable(s) is smaller than or equal to the number of guest contexts in the current working set.