Virtual machine suspension processing method and hardware interrupt controller

By setting an interrupt controller dispatcher in the hardware interrupt controller and utilizing interrupt synchronization command processing logic, the problems of high resource consumption and high risk of exceptions in virtual machine suspension processing are solved, and efficient virtual machine suspension operation is achieved.

CN121636060APending Publication Date: 2026-03-10PHYTIUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In virtual machine systems, the hardware interrupt controller needs to make extensive modifications to the internal module logic when handling virtual machine suspension commands, resulting in high resource consumption and high risk of anomalies.

Method used

By setting an interrupt controller dispatcher in the hardware interrupt controller, the existing interrupt synchronization command processing logic is used to encapsulate the suspend command into an interrupt synchronization command, and the suspend operation is executed with the help of the virtual local specific peripheral interrupt routing module, reducing the configuration of the suspend command processing logic.

Benefits of technology

It reduces resource consumption and anomaly risks, and improves the efficiency of virtual machine suspension handling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636060A_ABST
    Figure CN121636060A_ABST
Patent Text Reader

Abstract

The invention provides a virtual machine suspension processing method and a hardware interrupt controller, the method is applied to the hardware interrupt controller, and an interrupt controller dispatcher of the hardware interrupt controller comprises a command state control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller and an interrupt routing distribution module. The method comprises the steps that when a command state control module receives a suspension command, an interrupt management controller is called to recall VLPI interrupt sent to a target virtual machine to an interrupt route distribution module, and the suspension command is packaged into an interrupt synchronization command, so that a virtual local specific peripheral interrupt route module executes the interrupt synchronization command, and the virtual local specific peripheral interrupt route module executes the interrupt synchronization command; the VLPI interrupt sent to the target virtual machine is recalled to the interrupt routing distribution module; and the interrupt route distribution module sends the interrupt to an off-chip interrupt list. According to the method, the configuration of the suspend command processing logic can be reduced, so that the resource consumption is reduced, and the possibility of abnormity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more particularly to a virtual machine suspension handling method and a hardware interrupt controller. Background Technology

[0002] In a virtual machine system, the hardware interrupt controller can directly inject Virtual Locality-Specific Peripheral Interrupts (VLPIs) into the virtual machine through the virtual CPU interface of the virtual machine system. For example, when it is necessary to send a VLPI interrupt to a virtual machine, the hardware interrupt controller can directly send a VLPI interrupt to the corresponding virtual machine.

[0003] In a virtual machine system, the virtual machine monitor can suspend a virtual machine at any time, thereby allocating the virtual machine's resources to other virtual machines. In this case, when a virtual machine is suspended, the hardware interrupt controller needs to send VLPI interrupts destined for that virtual machine but not yet actually delivered to it to the corresponding external interrupt list for storage.

[0004] The conventional approach involves configuring suspend command handling logic within the hardware interrupt controller. This allows the hardware interrupt controller to execute a suspend command received for a virtual machine. However, configuring entirely new suspend command handling logic within the hardware interrupt controller requires extensive modifications to its internal modules, resulting in significant resource consumption and potential for errors. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides a virtual machine suspension handling method and a hardware interrupt controller, which can reduce the configuration of suspension command processing logic, thereby reducing resource consumption and the possibility of exceptions.

[0006] The first aspect of this application provides a virtual machine suspension handling method, applied to the hardware interrupt controller of a virtual machine system. An interrupt controller dispatcher is provided inside the hardware interrupt controller. The interrupt controller dispatcher includes a command status control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller, and an interrupt routing and dispatching module. The method includes: When the command status control module receives a suspension command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. It also encapsulates the suspension command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module internally contains processing logic for executing the interrupt synchronization command, and this processing logic includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine.

[0007] In some implementations, the command status control module invokes the interrupt management controller to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module, including: The command status control module obtains the identification information of the target virtual machine from the suspend command; The command status control module sends the identification information of the target virtual machine to the interrupt management controller; The interrupt management controller searches for the virtual local specific peripheral interrupt destined for the target virtual machine from the stored virtual local specific peripheral interrupts, and sends the found virtual local specific peripheral interrupt to the interrupt routing and distribution module.

[0008] In some implementations, the command status control module invokes the interrupt management controller to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module, including: The command status control module encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the interrupt management controller; wherein, the interrupt management controller has internal processing logic for executing the interrupt synchronization command; The interrupt management controller executes the interrupt synchronization command to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module.

[0009] In some implementations, the interrupt routing and distribution module includes an interrupt routing module, an interrupt distribution logic judgment module, and an interrupt distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine, including: The interrupt routing module sends the received virtual local specific peripheral interrupt to the interrupt distribution logic judgment module; wherein, the virtual local specific peripheral interrupt received by the interrupt routing module includes the interrupt management controller and the virtual local specific peripheral interrupt recalled by the virtual local specific peripheral interrupt routing module. The interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module; The interrupt distribution module sends the virtual local specific peripheral interrupts received through the first interface to the off-chip interrupt list corresponding to the target virtual machine.

[0010] In some implementations, the interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module, including: When the interrupt distribution logic judgment module receives a virtual local specific peripheral interrupt, it determines whether it is currently in the execution period of a suspend command and whether the target virtual machine of the received virtual local specific peripheral interrupt has been suspended. When it is determined that the current process is in the execution of a suspend command and the target virtual machine of the received virtual local specific peripheral interrupt is suspended, the interrupt distribution logic judgment module sends the received virtual local specific peripheral interrupt to the interrupt distribution module through the first interface of the interrupt distribution module.

[0011] In some implementations, the command state control module is equipped with a command state machine; In the command state machine, after the interrupt management controller completes the recall of the virtual local specific peripheral interrupt, if it is determined that the current processing is a suspended command, the command state machine jumps from the state of the interrupt management controller completing the recall of the virtual local specific peripheral interrupt to the state of sending an interrupt synchronization command to the virtual local specific peripheral interrupt routing module. After the state of sending the interrupt synchronization command to the virtual local specific peripheral interrupt routing module is completed, the process jumps to the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall. After the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall is completed, it jumps to the idle state.

[0012] In some implementations, when the command status control module receives a suspend command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module, and encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module, including: When the command state control module receives a suspension command instructing the target virtual machine to be suspended, it processes the suspension command according to the command state machine. Specifically, during the process of the command state control module processing the suspend command according to the command state machine, when the interrupt management controller is invoked to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing and distribution module, the command state control module encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module.

[0013] A second aspect of this application provides a hardware interrupt controller, which includes an interrupt controller distributor. The interrupt controller distributor includes a command status control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller, and an interrupt routing distribution module. When the command status control module receives a suspension command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. It also encapsulates the suspension command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module internally contains processing logic for executing the interrupt synchronization command, and this processing logic includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine.

[0014] In some implementations, the interrupt routing and distribution module includes an interrupt routing module, an interrupt distribution logic judgment module, and an interrupt distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine, including: The interrupt routing module sends the received virtual local specific peripheral interrupt to the interrupt distribution logic judgment module; wherein, the virtual local specific peripheral interrupt received by the interrupt routing module includes the interrupt management controller and the virtual local specific peripheral interrupt recalled by the virtual local specific peripheral interrupt routing module. The interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module; The interrupt distribution module sends the virtual local specific peripheral interrupts received through the first interface to the off-chip interrupt list corresponding to the target virtual machine.

[0015] In some implementations, the command state control module is equipped with an interrupt synchronization command state machine; In the interrupt synchronization command state machine, after the interrupt management controller completes the recall of the virtual local specific peripheral interrupt, and if it is determined that the current processing is a suspend command, the interrupt synchronization command state machine jumps from the state of the interrupt management controller completing the recall of the virtual local specific peripheral interrupt to the state of sending an interrupt synchronization command to the virtual local specific peripheral interrupt routing module. After the state of sending the interrupt synchronization command to the virtual local specific peripheral interrupt routing module is completed, the process jumps to the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall. After the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall is completed, it jumps to the idle state.

[0016] In the virtual machine suspension processing method provided in this application, when the command status control module receives a suspension command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. Furthermore, it encapsulates the suspension command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module, so that the virtual local specific peripheral interrupt routing module executes the interrupt synchronization command and recalls the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. Finally, the interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine. The virtual local specific peripheral interrupt routing module internally has processing logic for executing the interrupt synchronization command, which includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module.

[0017] When handling virtual machine suspend commands, the above solution can encapsulate the suspend command into an interrupt synchronization command that the virtual local specific peripheral interrupt routing module could originally execute. This allows the virtual local specific peripheral interrupt routing module to perform part of the virtual machine suspend command operation by executing the interrupt synchronization command. In other words, it uses the original interrupt synchronization command processing logic of the virtual local specific peripheral interrupt routing module to implement part of the virtual machine suspend command operation. This reduces the configuration of the suspend command processing logic, thereby reducing resource consumption and the possibility of exceptions. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of a hardware interrupt controller provided in an embodiment of this application.

[0020] Figure 2 This is a schematic diagram illustrating the process by which the interrupt translation service module provided in this application translates VLPI interrupts.

[0021] Figure 3 This is a schematic diagram illustrating the processing procedure of the vPE context switch provided in an embodiment of this application.

[0022] Figure 4This is a schematic diagram of the command and interrupt handling flow of the interrupt controller dispatcher (PICD) provided in an embodiment of this application.

[0023] Figure 5 This is a flowchart illustrating the virtual machine suspension handling method provided in an embodiment of this application.

[0024] Figure 6 This is a schematic diagram of a command state machine provided in an embodiment of this application. Detailed Implementation

[0025] In virtual machine systems, the traditional method of injecting Virtual Locality-specific Peripheral Interrupt (VLPI) into a vPE (Virtual Processing Element) requires the following five steps: (1) The hardware interrupt controller sends a physical interrupt to the physical CPU interface.

[0026] (2) A physical interrupt is received.

[0027] (3) The Hypervisor sends interrupts to the running vPE.

[0028] (4) Hypervisor writes to registers to send a VLPI interrupt.

[0029] (5) The VLPI interrupt is received and reaches vPE.

[0030] In the above process, the involvement of the hypervisor is called a trap, requiring the software to perform a significant amount of work to save the current state, which greatly consumes system time. VLPI interrupt direct injection avoids trapping the hypervisor, directly injecting virtual interrupts into the virtual CPU interface, thus greatly improving system efficiency. VLPI interrupt direct injection only requires the following two steps: (1) The interrupt controller sends a VLPI interrupt to the virtual CPU interface.

[0031] (2) The VLPI interrupt is received by the vPE.

[0032] Figure 1 The internal structure of the hardware interrupt controller is shown.

[0033] See Figure 1As shown, the hardware interrupt controller includes an Interrupt Translation Service (ITS) module, an Interrupt Controller Distributor (PICD), and a Redistributor (RD).

[0034] The main function of ITS is to receive the device ID and event ID sent by the device, and translate the device ID and event ID into LPI interrupt (Locality-specific Peripheral Interrupt) or VLPI interrupt by looking up three interrupt translation tables.

[0035] like Figure 2 As shown, there are three interrupt translation tables: Device table, InterruptTranslation Table (ITT table, or instruction translation table), and vPE table (virtual processing unit table). DeviceTable uses deviceID for addressing and stores the entry address of the ITT table; the ITT table stores vPEID (virtual processing unit ID) and INTID (interrupt number); vPE table uses vPEID as the address and stores the entry address (vpt_addr) of the VLPI pending table and the interrupt target core number (RDbase).

[0036] The entry address of the Device table is stored in the GITS_BASER0 register, and the entry address of the vPE table is stored in the GITS_BASER2 register.

[0037] The following is a basic VLPI interrupt translation process: The interrupt source device sends its DeviceID and EventID to the ITS. The Device table uses GITS_BASER0 + DeviceID as the address to read the Device table and obtain the entry address of the ITT table. Then, it uses the ITT table entry address + EventID to obtain vPEID and INTID. Finally, it uses GITS_BASER2 + vPEID as the address to read the vPE table and obtain vpt_addr and RDbase.

[0038] Ultimately, the VLPI interrupt carries the following information: interrupt number INTID, the pending table entry address of the target vPE (vpt_addr), and the target core number (RDbase).

[0039] The PICD is the core component of the hardware interrupt controller, which controls and distributes LPI and VLPI interrupts. The RD receives interrupt information sent by the PICD and sends LPI interrupts to the physical CPU interface and VLPI interrupts to the virtual CPU interface.

[0040] During the operation of the virtual machine system, when the Hypervisor needs to switch the Guest OS (vPE) for some reason, such as switching the Guest OS from vPE1 to vPE3, the hardware interrupt controller needs to recall all pending interrupts of vPE1 to the hardware interrupt controller and then send them together to the corresponding off-chip pending table of vPE1. This process is called the deschedule process of vPE1.

[0041] When the Hypervisor switches the Guest OS to vPE3, the hardware interrupt controller needs to check if there are any pending interrupts in the off-chip pending table corresponding to vPE3. If so, the interrupts are sent to the hardware interrupt controller. This process is called the vPE3 scheduling (or resource allocation) process.

[0042] The entire process of scheduling vPE1 and then scheduling vPE3 is called vPE context switch.

[0043] Figure 3 A schematic diagram of the hardware interrupt controller implementing the vPE context switch described above is shown.

[0044] Figure 3 The black arrows indicate the vPE1 scheduling process, and the white arrows indicate the vPE3 scheduling process.

[0045] During the vPE1 Deschedule process, PICD needs to do the following three things: (1) Search for interrupts sent to vPE1 in VLPI RAM and transmit them to PICD; (2) If there is a pending interrupt of vPE1 in the VCPU Interface, the PICD sends a release command to the PPI (Point-to-Point Interconnect) module, which forwards it to the VCPU Interface to recall the pending interrupt of vPE1 to the PICD. (3) PICD sends all pending VLPI interrupts of vPE1 to the corresponding off-chip pendingtable of vPE1.

[0046] During the vPE3 scheduling process, PICD needs to do the following three things: (1) Read the VLPI interrupt in the external pending table corresponding to vPE3 into the hardware interrupt controller; (2) Write the read VLPI interrupt into VLPI RAM; (3) Send the VLPI interrupt read in to PPI, and PPI forwards it to VCPU Interface.

[0047] Figure 4 The internal structure of the interrupt controller dispatcher PICD and the processing procedure after receiving commands and VLPI interrupts are shown.

[0048] See Figure 4 As shown, when the PICD receives the command (CMD), it first enters the command state control module cmd_state, and then enters the virtual local specific peripheral interrupt routing module vlpi_pipe, the interrupt management controller dest_ctrl, and the off-chip interrupt management controller vpt_ctrl from the command state control module cmd_state.

[0049] If the command received by the PICD is the `deschedule` command, the virtual local specific peripheral interrupt routing module `vlpi_pipe`, the interrupt management controller `dest_ctrl`, and the external interrupt management controller `vpt_ctrl` will perform the following operations respectively: Among them, the virtual local specific peripheral interrupt routing module vlpi_pipe searches for all VLPI interrupts in VLPI_RAM whose target is the RDbase of the virtual machine that is scheduled, and sends the matching interrupts to the interrupt routing module Arbiter.

[0050] The interrupt management controller dest_ctrl searches the register status of dest_ctrl to determine whether there are any pending VLPI interrupts that need to be sent to the scheduled virtual machine, and whether there are any VLPI interrupts that were sent to the scheduled virtual machine but have not yet been received by the scheduled virtual machine. If so, it recalls the interrupt routing module Arbiter.

[0051] The external interrupt management controller vpt_ctrl searches the external vPE pending table for all VLPI interrupts whose target is the RDbase of the virtual machine that is scheduled, and sends the matching interrupts to the interrupt routing module Arbiter.

[0052] The interrupt routing module Arbiter sends the VLPI interrupt to the interrupt distribution logic judgment module COMB. After performing a logical judgment on the received VLPI interrupt, the interrupt distribution logic judgment module COMB enters the interrupt distribution module vlfa through channel ⑦ or through channel ⑧.

[0053] VLPI interrupts entering the interrupt dispatch module vlfa from channel ⑦ will be sent to the external interrupt management controller vpt_ctrl through channel ⑨, and then written into the external vPE pending table.

[0054] VLPI interrupts entering the interrupt distribution module vlfa from channel ⑧ will be sent to the virtual local specific peripheral interrupt routing module vlpi_pipe and the interrupt management controller dest_ctrl.

[0055] As can be seen, to implement the schedule operation for a virtual machine, the PICD needs to execute the schedule command and write the VLPI interrupts recalled by the virtual local specific peripheral interrupt routing module vlpi_pipe, the interrupt management controller dest_ctrl, and the external interrupt management controller vpt_ctrl to the interrupt distribution module vlfa through channel ⑦. Only in this way can the interrupt distribution module vlfa write the recalled VLPI interrupts to the external vPE pending table.

[0056] To enable the Virtual Local Specific Peripheral Interrupt Routing Module (vlpi_pipe), Interrupt Management Controller (dest_ctrl), and External Interrupt Management Controller (vpt_ctrl) to recall VLPI interrupts of scheduled virtual machines and send them to the external vPE pending table, it is necessary to modify the logic of these modules. Internally, VLPI interrupt recall processing logic for the scheduled command needs to be set up so that each module executes its respective scheduled command processing logic to recall VLPI interrupts.

[0057] However, the above implementation requires extensive modifications to the processing logic of the internal modules of the hardware interrupt controller, which consumes a lot of resources and may cause anomalies.

[0058] The inventors of this application have discovered that in hardware interrupt controllers, the processing flow of the existing interrupt synchronization command VINVALL is highly similar to the processing flow of the aforementioned schedule command.

[0059] The interrupt synchronization command VINVALL mentioned above is used to perform interrupt hardware synchronization, ensuring that the configuration information of VLPI interrupts stored in the on-chip RAM of the hardware interrupt controller is consistent with that in the off-chip VLPI config table. The VLPI config table stores the configuration information of each VLPI interrupt, which is usually located in the off-chip DDR.

[0060] See Figure 4The processing logic shown is as follows: After the PICD receives the interrupt synchronization command VINVALL, the command status control module cmd_state sends the VINVALL command to the interrupt management controller dest_ctrl via ①, to the virtual local specific peripheral interrupt routing module vlpi_pipe via ②, and to the external interrupt management controller vpt_ctrl via ③. If the interrupt management controller dest_ctrl finds a match internally, it sends the matched VLPI interrupt back to the interrupt routing module Arbiter via ④; if the virtual local specific peripheral interrupt routing module vlpi_pipe finds a match, it sends the matched VLPI interrupt back to the interrupt routing module Arbiter via ⑤; the external interrupt management controller vpt_ctrl searches in the external VLPI pending table and sends the matched VLPI interrupt back to the virtual local specific peripheral interrupt routing module vlpi_pipe. In the subsequent processing of the VINVALL command, the interrupt distribution logic judgment module COMB and the interrupt distribution module vlfa send the matched and recalled VLPI interrupt to the external DDR to achieve interrupt configuration information synchronization.

[0061] As can be seen, the processing flow of the VINVALL command is highly similar to that of the deschedule command, both involving the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe recalling VLPI interrupts. This can be leveraged by making minor modifications to the processing logic of the PICD's internal modules. By reusing the VINVALL processing logic, the deschedule command's processing logic can be implemented, thereby reducing the scope of modifications to the hardware interrupt controller's internal modules, lowering resource consumption, and reducing the risk of exceptions.

[0062] Based on the above ideas, this application provides a virtual machine suspension handling method that can realize virtual machine suspension (deschedule) operation by leveraging the existing interrupt synchronization command handling logic within the PICD.

[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0064] This application provides a virtual machine suspension handling method, which is applied to the hardware interrupt controller of the virtual machine system, and can be executed by the interrupt controller dispatcher (PICD) in the hardware interrupt controller.

[0065] See Figure 4 As shown, the interrupt controller dispatcher PICD mentioned above includes a command state control module cmd_state, which then leads to the virtual local specific peripheral interrupt routing module vlpi_pipe, the interrupt management controller dest_ctrl, and the interrupt routing dispatch module. The interrupt routing dispatch module includes... Figure 4 The interrupt routing module Arbiter, the interrupt distribution logic judgment module COMB, and the interrupt distribution module vlfa are shown in the diagram.

[0066] See Figure 5 As shown in the embodiments of this application, the virtual machine suspension processing method includes: S101. When the command status control module receives a suspend command indicating that the target virtual machine should be suspended, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing and distribution module, and encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module.

[0067] The aforementioned suspend command is the deschedule command, which instructs the target virtual machine to be descheduled. This suspend command contains the identification information of the target virtual machine being descheduled.

[0068] See Figure 4 The command processing flow shown is as follows: when the command status control module cmd_state receives the above-mentioned suspend command, it calls the interrupt management controller dest_ctrl through path ① to recall the Virtual Local Specific Peripheral Interrupt (VLPI) sent to the target virtual machine to the interrupt routing and distribution module.

[0069] In another embodiment, an implementation method is disclosed in which the command state control module cmd_state calls the interrupt management controller dest_ctrl through path ① to recall the Virtual Local Specific Peripheral Interrupt (VLPI) sent to the target virtual machine to the interrupt routing and distribution module.

[0070] The command status control module cmd_state can send the identifier (PID) of the VLPI interrupt that needs to be recalled and the identifier of the destination virtual machine of the VLPI interrupt that needs to be recalled to the interrupt management controller dest_ctrl. The interrupt management controller dest_ctrl then searches for the VLPI interrupt with the PID that is destined for the destination virtual machine.

[0071] In this embodiment, since the interrupt management controller dest_ctrl needs to recall all VLPI interrupts sent to the target virtual machine, the command state control module cmd_state sets the VLPI interrupt identifier PID sent to the interrupt management controller dest_ctrl to zero, and sets the destination virtual machine identifier to the aforementioned identifier of the target virtual machine. At this time, the interrupt management controller dest_ctrl will recall all VLPI interrupts sent to the target virtual machine.

[0072] Based on the above logic, the command state control module cmd_state obtains the identification information of the target virtual machine from the received suspend command, and then sends the identification information of the target virtual machine to the interrupt management controller dest_ctrl through path ①.

[0073] After receiving the identification information of the target virtual machine, the interrupt management controller dest_ctrl searches for the Virtual Local Specific Peripheral Interrupt (VLPI) destined for the target virtual machine from the stored VLPIs and sends the found VLPI to the interrupt routing module Arbiter in the interrupt routing distribution module.

[0074] In another embodiment, a different implementation is disclosed in which the command state control module cmd_state calls the interrupt management controller dest_ctrl through path ① to recall the Virtual Local Specific Peripheral Interrupt (VLPI) sent to the target virtual machine to the interrupt routing and distribution module.

[0075] In this embodiment, the command state control module cmd_state encapsulates the suspend command into an interrupt synchronization command VINVALL and sends the VINVALL command to the interrupt management controller dest_ctrl. The VINVALL command carries the identification information of the target virtual machine to instruct the synchronization of configuration information for VLPI interrupts destined for the target virtual machine. The interrupt management controller dest_ctrl internally has the processing logic to execute the VINVALL command, and the specific processing procedure for the interrupt management controller dest_ctrl to execute the VINVALL command can be found in the description of the above embodiment.

[0076] The interrupt management controller dest_ctrl executes the interrupt synchronization command to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing module Arbiter of the interrupt routing distribution module.

[0077] In addition to calling the interrupt management controller `dest_ctrl` to recall the VLPI interrupt destined for the target virtual machine to the interrupt routing and distribution module, the command state control module `cmd_state` also encapsulates the suspension command into an interrupt synchronization command `VINVALL`, and sends the `VINVALL` command to the VLPI interrupt routing module `vlpi_pipe`. The `VINVALL` command carries the identification information of the target virtual machine to instruct the synchronization of configuration information for the VLPI interrupt destined for the target virtual machine.

[0078] The virtual local specific peripheral interrupt routing module vlpi_pipe internally contains processing logic for executing the interrupt synchronization command VINVALL. The processing logic of the interrupt synchronization command VINVALL includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module vlpi_pipe. The specific process of the virtual local specific peripheral interrupt routing module vlpi_pipe executing the VINVALL command to recall the VLPI interrupt can be found in the description of the above embodiments.

[0079] S102, the Virtual Local Specific Peripheral Interrupt Routing Module executes the interrupt synchronization command to recall the Virtual Local Specific Peripheral Interrupt destined for the target virtual machine to the interrupt routing distribution module.

[0080] During the execution of step S102, the interrupt management controller dest_ctrl also recalls the virtual local specific peripheral interrupts sent to the target virtual machine to the interrupt routing and distribution module.

[0081] S103, The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine.

[0082] Specifically, when the interrupt routing and distribution module receives a recalled VLPI interrupt from the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe, it sends the recalled VLPI interrupt to the off-chip vPE pending table corresponding to the target virtual machine for storage.

[0083] Specifically, the processing logic of the interrupt routing and distribution module can be configured so that when it recognizes that a suspend command is being executed, it can send the VLPI interrupts recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe to the off-chip vPE pending table corresponding to the target virtual machine.

[0084] In some embodiments, an interrupt routing and distribution module is disclosed, comprising an interrupt routing module Arbiter, an interrupt distribution logic judgment module COMB, and an interrupt distribution module vlfa. Through the cooperation of the interrupt routing module Arbiter, the interrupt distribution logic judgment module COMB, and the interrupt distribution module vlfa, the transmission of VLPI interrupts to the off-chip vPE pending table is realized. Figure 4 The processing flow shown is as follows: VLPI interrupts recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe are sent to the interrupt routing module Arbiter. The interrupt routing module Arbiter then sends the received VLPI interrupts to the interrupt distribution logic judgment module COMB. The interrupt distribution logic judgment module COMB then performs distribution logic judgment on the received VLPI interrupts to determine the distribution direction of the VLPI interrupts, that is, to determine where the VLPI interrupts should be distributed. Then, according to the distribution direction of the VLPI interrupts, they are sent to different interfaces of the interrupt distribution module vlfa through channel ⑦ or channel ⑧. The interrupt distribution module vlfa distributes the received VLPI interrupts to different places according to the different interfaces receiving the VLPI interrupts.

[0085] Among them, see Figure 4 As shown, in addition to receiving VLPI interrupts recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe, the interrupt routing module Arbiter also receives new VLPI interrupts. At this time, the interrupt distribution logic judgment module COMB needs to perform distribution logic judgment on the VLPI interrupt sent by the interrupt routing module Arbiter to determine which path should be used to send it to the interrupt distribution module vlfa.

[0086] In this embodiment, the interrupt routing module Arbiter sends the received Virtual Local Specific Peripheral (VLPI) interrupts to the interrupt distribution logic judgment module COMB. The interrupts received by the interrupt routing module Arbiter include VLPI interrupts recalled by the interrupt management controller dest_ctrl and the VLPI interrupt routing module vlpi_pipe, as well as new VLPI interrupts received from outside the PICD.

[0087] Then, the interrupt distribution logic judgment module COMB identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module vlfa through the first interface of the interrupt distribution module vlfa.

[0088] As described in the above embodiment, interrupts sent through channel ⑦ to the interrupt distribution module vlfa are then sent by the interrupt distribution module vlfa to the off-chip vPE pending table through channel ⑨. Therefore, in this embodiment, channel ⑦ between the interrupt distribution logic judgment module COMB and the interrupt distribution module vlfa is connected to the first interface of the interrupt distribution module vlfa. The interrupt distribution logic judgment module COMB only needs to send the VLPI interrupts recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe to the first interface of the interrupt distribution module vlfa through channel ⑦, so that the recalled VLPI interrupts can be sent by the interrupt distribution module vlfa to the off-chip vPE pending table.

[0089] Therefore, the interrupt dispatch logic judgment module COMB needs to identify the VLPI interrupts recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe from the VLPI interrupts sent by the interrupt routing module Arbiter. In other words, it needs to identify the VLPI interrupts sent to the target virtual machine that is scheduled.

[0090] In this embodiment, the interrupt distribution logic judgment module COMB determines which channel the received VLPI interrupt was sent to the interrupt distribution module vlfa through in the following manner: First, when the interrupt dispatch logic judgment module COMB receives a VLPI interrupt sent by the interrupt routing module Arbiter, it first determines whether it is currently in the execution of a suspend command and whether the target virtual machine of the received VLPI interrupt has been suspended.

[0091] Whether the current state is in the process of suspending command execution can be determined by querying the state machine of the command status control module `cmd_state`. The `cmd_state` module internally uses a state machine to control the processing of received commands. During command processing, the state of `cmd_state` switches between various non-idle states of the state machine. When command processing is complete, the state of `cmd_state` remains in the idle state of the state machine. Therefore, the interrupt dispatch logic judgment module `COMB` can query the current state of the state machine of the command status control module `cmd_state` to determine whether the current state is in the process of suspending command execution. For example, when the command status control module cmd_state receives a suspend command and controls each module within the PICD to execute the suspend command, when the interrupt distribution logic judgment module COMB receives a VLPI interrupt from the interrupt routing module Arbiter, it queries the state machine of the command status control module cmd_state. If it is in a non-idle state, it means that the suspend command has not yet been completed, thus determining that the current period is during the execution of the suspend command; if it is in an idle state, it means that the suspend command has been completed, thus determining that the current period is not during the execution of the suspend command.

[0092] If the current execution of a suspend command is not in progress, the interrupt dispatch logic judgment module COMB can directly determine that the received VLPI interrupt is not a VLPI interrupt recalled by the interrupt management controller dest_ctrl and the virtual local specific peripheral interrupt routing module vlpi_pipe, and therefore is not a VLPI interrupt sent to the target virtual machine that is scheduled.

[0093] The interrupt dispatch logic judgment module COMB determines whether the target virtual machine of the received VLPI interrupt is suspended, that is, whether the target virtual machine of the received VLPI interrupt is in a scheduled state.

[0094] In this embodiment, the VLPI interrupt received by the interrupt distribution logic judgment module COMB carries the target core number (RDbase) and vpt_addr to which the VLPI interrupt is destined. The interrupt distribution logic judgment module COMB uses the target core number carried in the received VLPI interrupt to query another module for the current values ​​of GICR_VPENDBASERx.valid and GICR_VPENDBASERx.vpt_addr of the processor core corresponding to that target core number; wherein, the value of 'x' in the queried GICR_VPENDBASERx.valid and GICR_VPENDBASERx.vpt_addr is the value of the target core number.

[0095] Based on the above queries, if the current value of GICR_VPENDBASERx.valid for the processor core corresponding to the target core number is equal to 1, and the value of vpt_addr for the received VLPI interrupt is equal to the value of GICR_VPENDBASERx.vpt_addr for the processor core corresponding to the target core number, then the destination virtual machine of the received VLPI interrupt is in the scheduled state. Otherwise, if the current value of GICR_VPENDBASERx.valid for the processor core corresponding to the target core number is not equal to 1, or the value of vpt_addr for the received VLPI interrupt is not equal to the value of GICR_VPENDBASERx.vpt_addr for the processor core corresponding to the target core number, then the destination virtual machine of the received VLPI interrupt is in the scheduled state.

[0096] Using the above method, the interrupt dispatch logic judgment module COMB can determine whether the target virtual machine of the received VLPI interrupt is suspended.

[0097] When it is determined that the current process is in the execution of a suspend command and the target virtual machine of the received VLPI interrupt is suspended, the interrupt distribution logic judgment module COMB sends the received VLPI interrupt to the first interface of the interrupt distribution module vlfa through channel ⑦.

[0098] The interrupt dispatch module vlfa sends the VLPI interrupts received through the first interface to the off-chip interrupt list pending table corresponding to the target virtual machine through channel 9. This realizes that the VLPI interrupts destined for the scheduled target virtual machine are sent to the off-chip vPE pending table for storage, which means that the virtual machine is suspended.

[0099] As described above, in the virtual machine suspension processing method provided in this application embodiment, when the command status control module receives a suspension command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. Furthermore, it encapsulates the suspension command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module, so that the virtual local specific peripheral interrupt routing module executes the interrupt synchronization command and recalls the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. Finally, the interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine. The virtual local specific peripheral interrupt routing module internally has processing logic for executing the interrupt synchronization command, which includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module.

[0100] When handling virtual machine suspend commands, the above solution can encapsulate the suspend command into an interrupt synchronization command that the virtual local specific peripheral interrupt routing module could originally execute. This allows the virtual local specific peripheral interrupt routing module to perform part of the virtual machine suspend command operation by executing the interrupt synchronization command. In other words, it uses the original interrupt synchronization command processing logic of the virtual local specific peripheral interrupt routing module to implement part of the virtual machine suspend command operation. This reduces the configuration of the suspend command processing logic, thereby reducing resource consumption and the possibility of exceptions.

[0101] In another embodiment of this application, it is disclosed that the command state control module cmd_state internally contains a command state machine for implementing state switching during command processing. The command state control module cmd_state processes the received commands according to this command state machine.

[0102] Figure 6 A schematic diagram of the command state machine set up inside the command state control module cmd_state in this embodiment is shown.

[0103] See Figure 6As shown, in the command state machine set up inside the command state control module cmd_state, the DEST state indicates that the interrupt management controller dest_ctrl is called to recall the VLPI interrupt sent to the target virtual machine; the DEST_WAIT state indicates that the interrupt management controller dest_ctrl is waiting to complete the recall of the VLPI interrupt.

[0104] After the interrupt management controller dest_ctrl completes the recall of VLPI interrupts, that is, after the DEST_WAIT state ends, when it is determined that the currently processed command is the schedule suspend command, the command state machine jumps from the DEST_WAIT state to the PIPE state. The PIPE state indicates that the interrupt synchronization command VINVALL is sent to the virtual local specific peripheral interrupt routing module vlpi_pipe. In other words, the suspend command is encapsulated into a VINVALL command and sent to the virtual local specific peripheral interrupt routing module vlpi_pipe, so that the virtual local specific peripheral interrupt routing module vlpi_pipe will recall the VLPI interrupts sent to the target virtual machine.

[0105] After the PIPE state is completed, that is, after sending the interrupt synchronization command VINVALL to the virtual local specific peripheral interrupt routing module vlpi_pipe, it jumps to the PIPE_WAIT state, which is the state of waiting for the virtual local specific peripheral interrupt routing module vlpi_pipe to complete the VLPI interrupt recall.

[0106] When the PIPE_WAIT state ends, that is, when the virtual local specific peripheral interrupt routing module vlpi_pipe completes the VLPI interrupt recall, it jumps to the IDLE idle state.

[0107] In the command state machine described above, the PIPE state and PIPE_WAIT state are two new states added in this embodiment. The other states are existing states in the command state machine set internally by the command state control module cmd_state. Through the above command state machine design, this embodiment can utilize the original processing flow of the VANVALL command to execute the deschedule suspension command.

[0108] When the command state control module cmd_state receives a suspend command instructing the target virtual machine to suspend, it processes the suspend command according to the command state machine described above.

[0109] During the processing according to the command state machine flow, when the interrupt management controller dest_ctrl completes the process of recalling the VLPI interrupt sent to the target virtual machine, that is, when the DEST_WAIT state ends, it jumps to the PIPE state. At this time, the command state control module cmd_state encapsulates the received suspend command into an interrupt synchronization command VINVALL and sends the VINVALL command to the virtual local specific peripheral interrupt routing module vlpi_pipe, and then jumps to the PIPE_WAIT state.

[0110] In this embodiment, by partially modifying the command state machine of the command state control module cmd_state, the command state control module cmd_state can use the original VINVALL command processing logic in the command state machine to process the received schedule suspension command. Its implementation logic is simple, the scope of modification is smaller, and it can reduce resource consumption and the possibility of anomalies.

[0111] This application embodiment also provides a hardware interrupt controller, which includes an interrupt controller distributor. The interrupt controller distributor includes a command status control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller, and an interrupt routing distribution module. When the command status control module receives a suspend command instructing the target virtual machine to suspend, it calls the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module. It also encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module internally has processing logic for executing the interrupt synchronization command, and the processing logic for the interrupt synchronization command includes recalling the virtual local specific peripheral interrupt from within the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine.

[0112] In some embodiments, the command status control module invokes the interrupt management controller to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module, including: The command status control module obtains the identification information of the target virtual machine from the suspend command; The command status control module sends the identification information of the target virtual machine to the interrupt management controller; The interrupt management controller searches for the virtual local specific peripheral interrupt destined for the target virtual machine from the stored virtual local specific peripheral interrupts, and sends the found virtual local specific peripheral interrupt to the interrupt routing and distribution module.

[0113] In some embodiments, the command status control module invokes the interrupt management controller to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module, including: The command status control module encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the interrupt management controller; wherein, the interrupt management controller has internal processing logic for executing the interrupt synchronization command; The interrupt management controller executes the interrupt synchronization command to recall virtual local specific peripheral interrupts destined for the target virtual machine to the interrupt routing and distribution module.

[0114] In some embodiments, the interruption routing and distribution module includes an interruption routing module, an interruption distribution logic judgment module, and an interruption distribution module; The interrupt routing and distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to the off-chip interrupt list corresponding to the target virtual machine, including: The interrupt routing module sends the received virtual local specific peripheral interrupt to the interrupt distribution logic judgment module; wherein, the virtual local specific peripheral interrupt received by the interrupt routing module includes the interrupt management controller and the virtual local specific peripheral interrupt recalled by the virtual local specific peripheral interrupt routing module. The interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module; The interrupt distribution module sends the virtual local specific peripheral interrupts received through the first interface to the off-chip interrupt list corresponding to the target virtual machine.

[0115] In some embodiments, the interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt destined for the target virtual machine from the received virtual local specific peripheral interrupts, and sends the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module, including: When the interrupt distribution logic judgment module receives a virtual local specific peripheral interrupt, it determines whether it is currently in the execution period of a suspend command and whether the target virtual machine of the received virtual local specific peripheral interrupt has been suspended. When it is determined that the current process is in the execution of a suspend command and the target virtual machine of the received virtual local specific peripheral interrupt is suspended, the interrupt distribution logic judgment module sends the received virtual local specific peripheral interrupt to the interrupt distribution module through the first interface of the interrupt distribution module.

[0116] In some embodiments, the command state control module is provided with a command state machine; In the command state machine, after the interrupt management controller completes the recall of the virtual local specific peripheral interrupt, if it is determined that the current processing is a suspended command, the command state machine jumps from the state of the interrupt management controller completing the recall of the virtual local specific peripheral interrupt to the state of sending an interrupt synchronization command to the virtual local specific peripheral interrupt routing module. After the state of sending the interrupt synchronization command to the virtual local specific peripheral interrupt routing module is completed, the process jumps to the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall. After the state of waiting for the virtual local specific peripheral interrupt routing module to complete the virtual local specific peripheral interrupt recall is completed, it jumps to the idle state.

[0117] In some embodiments, when the command status control module receives a suspend command instructing the target virtual machine to suspend, it invokes the interrupt management controller to recall the virtual local specific peripheral interrupt destined for the target virtual machine to the interrupt routing and distribution module, and encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module, including: When the command state control module receives a suspension command instructing the target virtual machine to be suspended, it processes the suspension command according to the command state machine. Specifically, during the process of the command state control module processing the suspend command according to the command state machine, when the interrupt management controller is invoked to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing and distribution module, the command state control module encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module.

[0118] The hardware interrupt controller provided in this embodiment belongs to the same concept as the virtual machine suspension processing method provided in the above embodiments of this application. It can execute the virtual machine suspension processing method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment can be found in the specific processing content of the virtual machine suspension processing method provided in the above embodiments of this application, and will not be repeated here.

[0119] Another embodiment of this application provides a virtual machine system that includes the aforementioned hardware interrupt controller, thereby enabling the virtual machine suspension processing method described in any of the above embodiments to be implemented through the hardware interrupt controller in the virtual machine system, and possessing the beneficial effects of executing the virtual machine suspension processing method.

[0120] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0121] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0122] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.

[0123] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.

[0124] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0125] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.

[0126] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.

[0127] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0128] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0129] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0130] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A virtual machine suspension processing method, characterized by comprising: The application relates to a hardware interrupt controller applied to a virtual machine system, wherein an interrupt controller distributor is arranged in the hardware interrupt controller, and the interrupt controller distributor comprises a command state control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller and an interrupt routing distribution module. The method comprises: When the command state control module receives a suspension command indicating suspension of a target virtual machine, the interrupt management controller is called to recall a virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module, and the suspension command is encapsulated into an interrupt synchronization command and sent to the virtual local specific peripheral interrupt routing module; wherein the virtual local specific peripheral interrupt routing module has processing logic for executing the interrupt synchronization command, and the processing logic of the interrupt synchronization command comprises recalling a virtual local specific peripheral interrupt from the virtual local specific peripheral interrupt routing module; The virtual local specific peripheral interrupt routing module executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module; The interrupt routing distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to an off-chip interrupt list corresponding to the target virtual machine.

2. The method of claim 1, wherein, The command state control module calls the interrupt management controller to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module, which comprises: The command state control module obtains identification information of the target virtual machine from the suspension command; The command state control module sends the identification information of the target virtual machine to the interrupt management controller; The interrupt management controller searches for the virtual local specific peripheral interrupt sent to the target virtual machine from the stored virtual local specific peripheral interrupts, and sends the found virtual local specific peripheral interrupt to the interrupt routing distribution module.

3. The method of claim 1, wherein, The command state control module calls the interrupt management controller to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module, which comprises: The command state control module encapsulates the suspension command into an interrupt synchronization command and sends the interrupt synchronization command to the interrupt management controller; wherein the interrupt management controller has processing logic for executing the interrupt synchronization command; The interrupt management controller executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module.

4. The method of claim 1, wherein, The interrupt routing distribution module comprises an interrupt routing module, an interrupt distribution logic judgment module and an interrupt distribution module; The interrupt routing distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to an off-chip interrupt list corresponding to the target virtual machine, which comprises: The interrupt routing module sends the received virtual local specific peripheral interrupt to the interrupt distribution logic judging module; wherein the interrupt routing module includes the interrupt management controller and the virtual local specific peripheral interrupt routing module recalling the virtual local specific peripheral interrupt; The interrupt distribution logic judging module identifies the virtual local specific peripheral interrupt sent to the target virtual machine from the received virtual local specific peripheral interrupt, and sends the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module; The interrupt distribution module sends the virtual local specific peripheral interrupt received through the first interface to the off-chip interrupt list corresponding to the target virtual machine.

5. The method of claim 4, wherein, The interrupt distribution logic judging module identifies the virtual local specific peripheral interrupt sent to the target virtual machine from the received virtual local specific peripheral interrupt, and sends the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt distribution module through the first interface of the interrupt distribution module, comprising: The interrupt distribution logic judging module judges whether the current is in the suspension command execution period when receiving the virtual local specific peripheral interrupt, and judges whether the destination virtual machine of the received virtual local specific peripheral interrupt is suspended; When it is determined that the current is in the suspension command execution period, and the destination virtual machine of the received virtual local specific peripheral interrupt is suspended, the interrupt distribution logic judging module sends the received virtual local specific peripheral interrupt to the interrupt distribution module through the first interface of the interrupt distribution module.

6. The method according to any one of claims 1 to 5, characterized in that, The command state control module is provided with a command state machine; In the command state machine, when the interrupt management controller completes the recall of the virtual local specific peripheral interrupt, and it is determined that the current is processing the suspension command, the command state machine jumps from the state that the interrupt management controller completes the recall of the virtual local specific peripheral interrupt to the state of sending the interrupt synchronization command to the virtual local specific peripheral interrupt routing module; After the state of sending the interrupt synchronization command to the virtual local specific peripheral interrupt routing module is completed, jump to the state of waiting for the virtual local specific peripheral interrupt routing module to complete the recall of the virtual local specific peripheral interrupt; After the state of waiting for the virtual local specific peripheral interrupt routing module to complete the recall of the virtual local specific peripheral interrupt is completed, jump to the idle state.

7. The method of claim 6, wherein, When the command state control module receives the suspension command indicating the suspension of the target virtual machine, the interrupt management controller is called to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module, and the suspension command is encapsulated into an interrupt synchronization command and sent to the virtual local specific peripheral interrupt routing module, comprising: When the command state control module receives the suspension command indicating the suspension of the target virtual machine, the command state machine processes the suspension command; In the process of the command state control module processing the suspend command according to the command state machine, when the calling of the interrupt management controller recalling the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module is completed, the command state control module encapsulates the suspend command into an interrupt synchronization command and sends the interrupt synchronization command to the virtual local specific peripheral interrupt routing module.

8. A hardware interrupt controller, characterized by An interrupt controller distributor is arranged inside the hardware interrupt controller, and the interrupt controller distributor includes a command state control module, a virtual local specific peripheral interrupt routing module, an interrupt management controller, and an interrupt routing distribution module. When the command state control module receives a suspend command indicating suspension of a target virtual machine, the interrupt management controller is called to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module, and the suspend command is encapsulated into an interrupt synchronization command and sent to the virtual local specific peripheral interrupt routing module; the virtual local specific peripheral interrupt routing module has processing logic for executing the interrupt synchronization command inside, and the processing logic of the interrupt synchronization command includes recalling a virtual local specific peripheral interrupt from inside the virtual local specific peripheral interrupt routing module. The virtual local specific peripheral interrupt routing module executes the interrupt synchronization command to recall the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt routing distribution module. The interrupt routing distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to an off-chip interrupt list corresponding to the target virtual machine.

9. The hardware interrupt controller of claim 8, wherein, The interrupt routing distribution module includes an interrupt routing module, an interrupt distribution logic judgment module, and an interrupt distribution module. The interrupt routing distribution module sends the interrupts recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module to an off-chip interrupt list corresponding to the target virtual machine, including: The interrupt routing module sends the received virtual local specific peripheral interrupt to the interrupt distribution logic judgment module; the virtual local specific peripheral interrupt received by the interrupt routing module includes the virtual local specific peripheral interrupt recalled by the interrupt management controller and the virtual local specific peripheral interrupt routing module; The interrupt distribution logic judgment module identifies the virtual local specific peripheral interrupt sent to the target virtual machine from the received virtual local specific peripheral interrupt, and sends the virtual local specific peripheral interrupt sent to the target virtual machine to the interrupt distribution module through a first interface of the interrupt distribution module; The interrupt distribution module sends the virtual local specific peripheral interrupt received through the first interface to an off-chip interrupt list corresponding to the target virtual machine.

10. The hardware interrupt controller according to claim 8 or 9, characterized in that, The command state control module is provided with an interrupt synchronization command state machine. In the interrupt synchronization command state machine, when the interrupt management controller completes recall of the virtual local specific peripheral interrupt, and in a case where it is determined that a pending command is currently being processed, the interrupt synchronization command state machine jumps from a state in which the interrupt management controller completes recall of the virtual local specific peripheral interrupt to a state in which an interrupt synchronization command is sent to a virtual local specific peripheral interrupt routing module; after the state in which the interrupt synchronization command is sent to the virtual local specific peripheral interrupt routing module is completed, the interrupt synchronization command state machine jumps to a state in which the virtual local specific peripheral interrupt routing module is waited for to complete recall of the virtual local specific peripheral interrupt; after the state in which the virtual local specific peripheral interrupt routing module is waited for to complete recall of the virtual local specific peripheral interrupt is completed, the interrupt synchronization command state machine jumps to an idle state.