Virtual Interrupt Handling via Pre-configured OS Kernel
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing interrupt handling process in interrupt virtualization technologies is complex and inefficient due to the need for multiple switches between the operating system kernel and the VMM, as well as between the VCPU thread and the VMM thread.
Innovation Solution
An operating system-based virtual interrupt handling method and apparatus that pre-configures interrupt configuration information, allowing the interrupt handling process to be simplified by directly controlling a second virtual central processing unit to execute an interrupt handler based on the first virtual central processing unit and the target configuration information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If interrupt handling is performed through VMM with multiple switches between operating system kernel and VMM, then virtual machine interrupt virtualization is achieved, but interrupt handling efficiency deteriorates due to complex switching processes
Solution Approach 1:
The patent pre-configures interrupt configuration information in the operating system kernel before virtual machine execution. This includes setting up interrupt affinity relationships between virtual CPUs and physical CPUs, and configuring interrupt routing tables. When an interrupt occurs, the pre-configured information allows direct handling without requiring VMM intervention, thus resolving the contradiction by preparing necessary configurations in advance to enable efficient interrupt handling while maintaining virtualization capabilities
Solution Approach 2:
The patent extracts the interrupt handling functionality from the VMM layer and implements it directly in the operating system kernel. By separating the interrupt configuration and handling operations from the VMM, the system eliminates the need for multiple context switches between kernel and VMM. The VMM retains only the essential virtualization management functions, while interrupt handling is handled independently by the kernel using pre-configured information, thereby improving efficiency without sacrificing virtualization adaptability
2Reliability
If multiple switches between VCPU thread and VMM thread are implemented, then virtual interrupt injection is achieved, but interrupt handling process complexity increases
Solution Approach 1:
The patent introduces an intermediary mechanism in the form of pre-configured interrupt information stored in the operating system kernel. This intermediary contains interrupt affinity masks and routing tables that mediate between the virtual CPU and physical interrupt sources. When an interrupt occurs, the kernel uses this intermediary information to directly determine which virtual CPU should handle the interrupt, eliminating the need for complex thread switching and VMM involvement, thus reducing process complexity while maintaining reliable virtual interrupt injection
Data Source
Figure 1~2
Figure 3~4
Figure 5
AI summary
Disclosed are an operating system-based virtual interrupt handling method and apparatus, and an electronic device, relating to the field of virtualization technologies. The method includes: determining a first virtual central processing unit currently running; determining target configuration information corresponding to an interrupt request from pre-configured interrupt configuration information; and controlling a second virtual central processing unit to execute an interrupt handler by using an interrupt controller based on the first virtual central processing unit and the target configuration information. In technical solutions of this disclosure, the interrupt configuration information is pre-configured, so that there is no need for a VMM to participate in interrupt handling during virtual interrupt handling, which can simplify an interrupt handling process and improve interrupt handling efficiency.