Shadow Pagetable Management in SLAT-Free Virtual Machines

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvememory virtualization capabilityVSAvoidsystem performance
Core Design Contradiction:
ReliabilityVSProductivity

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

Inventive Principle:
Principle #25Self-service

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

Engineering Contradiction:
Improvepagetable consistencyVSAvoidtime for VM exits and pagefault handling
Core Design Contradiction:
ReliabilityVSLoss of time

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

Inventive Principle:
Principle #10Preliminary action

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

Engineering Contradiction:
Improvevirtualization setup easeVSAvoidmemory management performance
Core Design Contradiction:
Ease of manufactureVSProductivity

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

Inventive Principle:
Principle #25Self-service

Data Source

PatentEP2955634B1Paravirtualization-based interface for memory management in virtual machines
Publication Date: 2021.03.03 DEUTSCHE TELEKOM AG
  • EP2955634B1 patent drawingFigure 1
  • EP2955634B1 patent drawingFigure 2
  • EP2955634B1 patent drawingFigure 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.