Cross-Domain Inlining in System Virtual Machines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing system virtual machines are limited in optimizing program calls across protection domain boundaries, leading to inefficiencies due to the need for costly and overhead-intensive protection domain transitions, especially for system calls and hypercalls that cross privilege and address space boundaries.
Innovation Solution
A system and method for inlining and optimizing program calls across protection domain boundaries by generating an intermediate representation graph that spans the boundary, enhancing region nodes with protection domain information, and converting this into native ISA instructions that include privilege and address space details, allowing for optimized code generation and execution without altering the hardware's privilege level.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If inlining is performed for function calls, then code optimization and performance are improved, but inlining is limited to function calls within the same protection domain boundary
Solution Approach 1:
The patent segments the protection domain boundary by introducing a new instruction type (CALL_PROTECT) that explicitly handles protection domain transitions. This allows the inlining optimization to be applied to code sequences that span multiple protection domains by breaking down the cross-domain call into manageable segments: pre-processing in the caller domain, the actual call instruction, and post-processing in the callee domain.
Solution Approach 2:
The patent introduces an intermediary mechanism (the CALL_PROTECT instruction and associated validation logic) that mediates between the caller and callee across protection domain boundaries. This intermediary validates the call, checks protection domain compatibility, and facilitates the transition, enabling inlining optimization while maintaining security boundaries.
2Reliability
If system calls and hypercalls are executed with traditional protection domain transitions, then security and isolation are maintained, but performance degradation occurs due to pipeline flushes and context reconfiguration
Solution Approach 1:
The patent applies preliminary action by performing validation and preparation work before the actual protection domain transition. The CALL_PROTECT instruction validates the call parameters and checks protection domain compatibility in advance, so that when the transition occurs, it can be executed more efficiently without unnecessary pipeline flushes or context reconfigurations.
Solution Approach 2:
The patent changes the parameters of the call instruction by introducing a new instruction type (CALL_PROTECT) with additional parameters for specifying protection domain information. This allows the system to encode protection domain transition information directly in the instruction, enabling more efficient handling compared to traditional indirect system call mechanisms.
3Reliability
If protection domain transitions are performed with full context reconfiguration, then security is ensured, but execution speed decreases due to pipeline flushes and register modifications
Solution Approach 1:
The patent applies local quality by making protection domain transitions local and targeted rather than global and comprehensive. Instead of flushing the entire pipeline and reconfiguring all context registers for every protection domain transition, the system performs minimal, localized validation and context changes only where necessary, maintaining security while reducing performance impact.
Data Source
AI summary
A system and method are provided for inlining across protection domain boundaries with a system virtual machine. A protection domain comprises a unique combination of a privilege level and a memory address space. The system virtual machine interprets or dynamically compiles not only application code executing under guest operating systems, but also the guest operating systems. For a program call that crosses a protection domain boundary, the virtual machine assembles an intermediate representation (IR) graph that spans the boundary. Region nodes corresponding to code on both sides of the call are enhanced with information identifying the applicable protection domains. The IR is optimized and used to generate instructions in a native ISA (Instruction Set Architecture) of the virtual machine. Individual instructions reveal the protection domain in which they are to operate, and instructions corresponding to different domains may be interleaved.


