Hypervisor Context Switching Using TLB Tags

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Hypervisors face performance challenges in managing context switches across multiple hierarchical privilege levels, particularly in architectures like ARMv7 and ARMv8, due to varying resource and performance constraints, which affects the efficiency of virtual machine execution and resource optimization.

Innovation Solution

Assigning hypervisor components to specific privilege levels and employing techniques such as trampolines and redirection exception vectors to manage context switches, allowing for efficient execution control and optimization of operations across privilege levels, including the use of translation lookaside buffer tags to reduce unnecessary operations like TLB flushes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If context switches are performed between hypervisor components across multiple privilege levels, then execution control can be switched between components with different resource access rights, but the context switching process becomes time-consuming and reduces system performance

Engineering Contradiction:
Improveability to switch between hypervisor components across privilege levelsVSAvoidcontext switching time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-configuring privilege level assignments for hypervisor components and pre-setting up the context switching mechanism. The hypervisor kernel pre-assigns virtual machine monitors to specific privilege levels (EL1 or EL2) and pre-configures the exception vector tables, so that when a context switch is needed, the transition can occur more quickly without extensive setup overhead during the actual switch operation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses an intermediary approach by introducing a controlled transition mechanism through exception handling. When a context switch is required, the system uses a synchronous exception (hypercall) as an intermediary event to facilitate the privilege level transition. This intermediary exception mechanism provides a standardized, optimized path for switching between privilege levels, reducing the complexity and time of direct transitions.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If translation lookaside buffer entries are invalidated during context switches, then address space isolation between virtual machine monitors is maintained, but the TLB flush operation increases execution time

Engineering Contradiction:
Improveaddress space isolationVSAvoidTLB flush time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies local quality by differentiating the treatment of TLB entries based on the specific context switch scenario. Instead of universally flushing all TLB entries during every context switch, the system selectively invalidates only those TLB entries that are relevant to the transitioning virtual machine monitor. This selective approach maintains address space isolation where necessary while avoiding unnecessary flush operations for other address spaces.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent changes the parameter of TLB management by introducing virtual machine monitor-specific context identifiers that are associated with TLB entries. By changing how TLB entries are tagged and managed (using VM-specific context), the system can efficiently determine which entries need invalidation during a context switch, reducing the overall flush time while maintaining isolation.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If hypervisor components are assigned to different privilege levels, then resource access control and security are improved, but the complexity of managing context switches across privilege levels increases

Engineering Contradiction:
Improveresource access controlVSAvoidcontext switch management complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies universality by creating a unified context switching mechanism that works across multiple privilege levels (EL0, EL1, EL2). The exception handling framework and context switching logic are designed to be universal, handling transitions between any privilege levels through a standardized process. This universal approach reduces the need for separate management code for each privilege level transition, thereby reducing overall complexity despite the multi-level architecture.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent segments the hypervisor into distinct components operating at different privilege levels (hypervisor kernel at EL2, virtual machine monitors at EL1 or EL2). This segmentation allows each component to be managed independently with its own context and resource access rights, simplifying the overall management by breaking down the complex multi-level system into manageable, isolated segments with clear boundaries.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10162655B2Hypervisor context switching using TLB tags in processors having more than two hierarchical privilege levels
Publication Date: 2018.12.25 VMWARE INC
  • US10162655B2 patent drawing
  • US10162655B2 patent drawing
  • US10162655B2 patent drawing

AI summary

In a virtualized computer system operable in more than two hierarchical privilege levels, components of a hypervisor, which include a virtual machine kernel and virtual machine monitors (VMMs), are assigned to different privilege levels. The virtual machine kernel operates at a low privilege level to be able to exploit certain features provided by the low privilege level, and the VMMs operate at a high privilege level to support execution of virtual machines. Upon determining that a context switch from the virtual machine kernel to a VMM is to be performed, the computer system exits the low privilege level, and enters the high privilege level to execute a trampoline that supports context switches to VMMs, such as state changes, and then the VMM. The trampoline is deactivated after execution control is switched to the VMM.