Trapping System Calls for Remote Host Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtual machine systems face performance bottlenecks due to costly context switches when handling system calls, particularly for I/O operations, as they require transfers between guest and host operating systems, leading to resource inefficiencies.
Innovation Solution
The system and method involve trapping system calls in a virtualized environment, allowing them to be executed directly on the host side, with shared memory spaces to reflect state changes, thereby bypassing the full virtualization stack for performance-critical calls, and determining whether to perform system calls using the guest or host process based on the call type.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If system calls are handled through the full virtualization stack (guest OS to host OS), then proper virtualization isolation and security are maintained, but execution speed deteriorates due to costly context switches
Solution Approach 1:
The patent segments system call handling into two paths: a fast path for specific system calls that are handled directly by the host kernel without full virtualization stack traversal, and a slow path for other system calls that maintain proper virtualization handling. This segmentation allows performance-critical operations to bypass context switches while maintaining isolation for operations that require it.
Solution Approach 2:
The patent introduces an intermediary mechanism (the fast system call handling path with shared memory spaces) that allows select system calls to be handled efficiently without direct guest-host context switches. The intermediary shared memory space acts as a buffer that reflects state changes without requiring full virtualization stack traversal.
2Speed
If context switches are reduced by handling system calls on the host side, then execution speed improves, but device complexity increases due to shared memory space management
Solution Approach 1:
The patent creates a copy of the guest process address space on the host side as a shared memory space. This copy allows the host process to handle system calls directly without requiring complex real-time mapping and translation of guest memory references. The shared memory space is updated to reflect state changes, providing a simplified view for fast path handling.
3Productivity
If system calls are trapped and routed to host process, then resource efficiency improves by avoiding full virtualization stack traversal, but ease of operation deteriorates due to complex trapping and routing logic
Solution Approach 1:
The patent implements dynamic routing logic that determines at runtime whether to handle a system call through the fast path or slow path based on the call type. This dynamic approach allows the system to optimize for performance when appropriate while maintaining proper virtualization handling for other cases, balancing resource efficiency with operational simplicity.
Data Source
AI summary
Disclosed are systems and methods for executing system calls in a virtualized environment. A method includes executing, on a host, a host process corresponding to a guest process executing within a virtual machine and having an associated guest-process virtual address space, the host process having an associated host-process virtual address space. The method also includes mapping the host-process virtual address space and the guest-process virtual address space to a host physical memory, trapping a system call invoked by the guest process, and performing the trapped system call using the host process, wherein state changes in the host-process virtual address space caused by the trapped system call are reflected in the guest-process virtual address space. The method further includes causing execution of the guest process to be resumed after performing the trapped system call.


