VM Guest OS Code Optimization via Shadow Pages
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing Virtual Machine technologies face significant overhead in processing privileged but unsafe instructions, particularly with JMP instructions, leading to inefficient execution and performance loss due to the need for context switching and emulation.
Innovation Solution
The implementation of 'fast stubs' and 'shadow pages' that intercept and analyze JMP instructions, allowing safe instructions to be executed natively within the Virtual Machine context without context switching, while unsafe instructions are handled by the Virtual Machine Monitor, reducing the overhead associated with context switching.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If full binary translation or step-by-step interpretation is used to handle privileged but unsafe instructions in VM, then safety and control are improved, but execution overhead increases significantly
Solution Approach 1:
The patent segments the handling of privileged instructions by introducing shadow pages that mirror specific code pages. Only instructions on shadow pages are subject to full translation and safety checks, while other instructions execute natively. This segmentation allows the system to maintain safety for critical instructions while avoiding overhead for non-critical ones.
Solution Approach 2:
The patent applies local quality by making the treatment of instructions location-dependent. Instructions executed from shadow pages receive enhanced safety checking and binary translation, while instructions from non-shadow pages execute directly without overhead. This localized approach to safety ensures critical areas are protected without compromising overall performance.
2Reliability
If context switching to VMM is performed for every privileged instruction, then control and safety are improved, but processing time increases from 200 to 4000 clock cycles
Solution Approach 1:
The patent performs preliminary action by pre-identifying and marking privileged but unsafe instructions during code analysis before execution. These instructions are placed on shadow pages in advance, so the VM can execute them with appropriate safety checks without requiring runtime context switching to the VMM. This preliminary preparation eliminates the need for time-consuming context switches during actual execution.
3Reliability
If all JMP instructions are treated as privileged and require VMM intervention, then safety is improved, but execution efficiency deteriorates due to exception handling overhead
Solution Approach 1:
The patent segments JMP instructions into two categories: those on shadow pages that require safety checking and those on non-shadow pages that can execute natively. This segmentation allows the system to apply safety checks only where necessary while maintaining high execution efficiency for the majority of JMP instructions that do not pose safety risks.
Solution Approach 2:
The patent applies local quality by making the safety checking mechanism location-dependent. JMP instructions executed from shadow pages receive enhanced safety verification, while JMP instructions from non-shadow pages execute directly without intervention. This localized safety approach maintains control where needed while preserving execution efficiency elsewhere.
Data Source
AI summary
A system, method and computer program product for increasing efficiency of Guest OS code in a Virtual Machine, including installing a driver (Guest Tool) in the Virtual Machine; upon detection of an event in the Virtual Machine that could require a context switch to a Virtual Machine Monitor (VMM), intercepting the event; analyzing the event for whether the event can be handled in the VM and without a context switch; for those events that can be handled natively in the VM, replacing selected instructions with other instructions that accomplish the same task but do not require a context switch; for those events that cannot be handled natively in the VM, transferring control to the VMM; handling the event in the VMM; and returning control to the VM.


