Computing device and method for handling interrupts - Patents.com

The use of a hardware layer with ITS and GIC in virtualized systems addresses the delay issue in interrupt handling by directly transferring virtual interrupts, ensuring timely processing without processor termination.

JP7615474B2Active Publication Date: 2025-01-17HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2022580544
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-06-29
Filing Date
2021-06-24
Publication Date
2025-01-17
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

Existing interrupt handling processes in virtualized computing environments incur delays due to the proactive triggering of virtual machine exits (VM-exits) when writing virtual interrupts to virtual CPUs, leading to temporary termination of virtual processors.

Method used

A method and system that utilizes a hardware layer with a physical interrupt translation service (ITS) and a physical general-purpose interrupt controller (GIC) to transparently transmit virtual interrupts to the correct virtual processors, eliminating the need for virtual processor termination by using preconfigured mapping relationships to ensure timely and efficient interrupt handling.

Benefits of technology

Reduces delays associated with virtual processor termination by directly transferring virtual interrupt identifiers to the target processor, enhancing the efficiency of interrupt handling in virtualized systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007615474000001
    Figure 0007615474000001
  • Figure 0007615474000002
    Figure 0007615474000002
  • Figure 0007615474000003
    Figure 0007615474000003
Patent Text Reader

Abstract

The embodiments of the present application disclose a computing device and are applied to the field of computing devices. In this application, a virtual interrupt acquired by a host machine is mapped to a physical interrupt of a physical layer, and a virtual interrupt identifier corresponding to the physical interrupt is transferred to a virtual processor by using the physical layer. When the hardware layer transparently transmits the virtual interrupt identifier to the virtual processor, the virtual processor does not need to terminate. This reduces the delay caused by the termination of the virtual processor when software implements virtual interrupt routing.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to the field of computers, and more particularly to a system and method for handling interrupts. [Background technology]

[0002] The virtualization technology adds specific software layers, including a host machine layer and a virtual computer layer, to a physical computer to implement "virtualization" and "isolation" of the hardware of the physical computer. Each software layer includes different operation modes, such as a user mode and a kernel mode. The diversification of the software layers and operation modes increases the number of processing steps for some requirements in the physical computer, and increases the delay in processing these requirements.

[0003] Interrupt handling is an important requirement of a computing device. In the existing interrupt handling process of a computing device, a virtual machine monitor (VMM) provides a virtual interrupt controller and a virtual interrupt translation service to a user by using an interrupt virtualization technology. The process of transferring a virtual interrupt to a virtual processor is controlled based on the software of the virtual machine monitor. Specifically, the VMM may implement the process by writing a virtual interrupt to a register corresponding to the virtual processor. However, in the existing implementation, the VMM may write a virtual interrupt to a system register corresponding to a virtual CPU only when the virtual CPU of the virtual machine is scheduled to reacquire permission to use a physical CPU. To ensure that the virtual interrupt is written in a timely manner, the VMM proactively triggers a virtual machine exit (VM-exit) and writes the virtual interrupt to a system register corresponding to the virtual CPU when the next virtual machine registration (VM-entry) occurs. In this case, the virtual processor temporarily stops working every time the VMM writes a virtual interrupt. As a result, the delay in handling the virtual interrupt increases. Summary of the Invention

[0004] According to a first aspect, the present application provides a computing device. The computing device includes a hardware layer and a host machine operating on the hardware layer, the host machine configured to acquire a virtual interrupt. The virtual interrupt may be valid for a virtual device in a virtual machine, and the virtual device may be a software-simulated virtual device, for example, a software-simulated serial port. A back-end driver (e.g., QEMU) in the host machine may acquire a virtual interrupt that enables the behavior of the virtual machine and may trigger the virtual interrupt. The virtual interrupt may include a virtual device identifier DEVICE ID and a virtual interrupt vector identifier VECTOR ID. When an interrupt resource is initialized, the virtual device identifier DEVICE ID and the virtual interrupt vector identifier VECTOR ID are assigned to a virtual processor of the virtual machine. Each virtual processor uniquely corresponds to one virtual device identifier DEVICE ID and multiple virtual interrupt vector identifier VECTOR ID. The virtual device identifier DEVICE ID in the virtual interrupt may indicate which virtual device enables the virtual interrupt, and the virtual interrupt vector identifier VECTOR ID may indicate a specific virtual interrupt in the multiple virtual interrupts assigned by the virtual device.

[0005] After triggering the virtual interrupt, the back-end driver (e.g., QEMU) may forward the virtual interrupt to the VMM. In response, the VMM in the host machine may obtain the virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to a hardware layer. The hardware layer is configured to obtain a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, where the virtual interrupt is configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely correspond to the virtual processor identifier, and the virtual processor identifier indicates the target virtual processor, and forward the virtual interrupt identifier to the target virtual processor.

[0006] Specifically, the hardware layer may include a physical interrupt translation service (ITS) and a physical generic interrupt controller (GIC). The physical ITS may obtain a physical interrupt, which is used to interrupt a virtual CPU. The physical ITS may determine a virtual CPU corresponding to the physical interrupt, and may determine a virtual interrupt identifier (which may indicate a particular virtual interrupt) corresponding to the physical interrupt. The physical GIC may send the virtual interrupt identifier to the virtual CPU. The physical ITS may include a register and an arithmetic circuit. The register may store a correspondence between the physical interrupt and the virtual interrupt identifier (more specifically, the register stores a base address of the correspondence between the physical interrupt and the virtual interrupt identifier), and may store a correspondence between the physical interrupt and the virtual processor identifier (more specifically, the register stores a base address of the correspondence between the physical interrupt and the virtual processor identifier). The arithmetic circuitry may obtain the correspondence from the register (the arithmetic circuitry may obtain a base address from the register, and based on the base address, may obtain a correspondence between the physical interrupt and the virtual interrupt identifier and between the physical interrupt and the virtual processor identifier from the register), may determine a specific virtual CPU corresponding to the received physical interrupt identifier, and may determine a virtual interrupt identifier corresponding to the physical interrupt identifier. The GIC may be implemented based on arithmetic circuitry in a chip of ARM architecture, the physical GIC being advanced microcontroller bus architecture (AMBA), and the peripheral devices of the system-on-chip (SoC) being compatible with the ARM architecture. The physical GIC has an on-chip AMBA bus interface.

[0007] When the hardware layer transparently transmits the virtual interrupt identifier to the target virtual processor, it is not necessary for the hardware layer to write the virtual interrupt identifier to a system register corresponding to the virtual processor, and then for the virtual processor to retrieve the virtual interrupt identifier from the system register when the virtual processor runs again. Instead, the virtual interrupt identifier is directly transferred to the target virtual processor (specifically, the virtual interrupt identifier may be written to an interface corresponding to the virtual processor and residing in physical memory, and the virtual processor may retrieve the virtual interrupt identifier based on the interface). Therefore, the target virtual processor does not need to be terminated. This reduces the delay caused by the termination of the virtual processor when software implements virtual interrupt routing.

[0008] In any implementation, a virtual interrupt corresponds uniquely to a virtual interrupt identifier.

[0009] In any implementation, the computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on a hardware layer.

[0010] The physical ITS is configured to obtain, based on the physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier.

[0011] The physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor.

[0012] In any implementation, the host machine is further configured to obtain physical interrupt identifiers corresponding to the virtual interrupts based on the virtual interrupts and a first preset mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and the physical interrupt identifier. For example, the first mapping relationship may include N virtual interrupts and N physical interrupt identifiers. The N virtual interrupts correspond one-to-one to the N physical interrupt identifiers, each of the N virtual interrupts corresponds to one physical interrupt identifier, and each of the N physical interrupt identifiers corresponds to one virtual interrupt.

[0013] The hardware layer is further configured to obtain a virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual interrupt identifier. For example, the second mapping relationship may include N physical interrupt identifiers and N virtual interrupt identifiers. The N physical interrupt identifiers correspond one-to-one to the N virtual interrupt identifiers, each of the N physical interrupt identifiers corresponds to one virtual interrupt identifier, and each of the N virtual interrupt identifiers corresponds to one physical interrupt identifier.

[0014] In any implementation, the hardware layer is further configured to obtain a corresponding virtual processor identifier based on the physical interrupt identifier and a third mapping relationship preset, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual processor identifier. For example, the third mapping relationship may include N physical interrupt identifiers and N virtual processor identifiers, each of the N physical interrupt identifiers corresponding to one virtual processor identifier, and each of the N virtual processor identifiers corresponding to one or more physical interrupt identifiers.

[0015] In order to transparently transmit the virtual interrupt acquired by the VMM to the corresponding virtual processor by using the hardware layer and ensure that the virtual processor can receive the correct virtual interrupt identifier, a new mapping relationship (hereinafter may be referred to as a first mapping relationship) needs to be preset on the VMM, and a new mapping relationship (hereinafter may be referred to as a second mapping relationship and a third mapping relationship) is adaptively configured on the hardware layer. The mapping relationship configured on the VMM and the mapping relationship configured on the hardware layer can be mutually configured, so that the VMM can convert the acquired virtual interrupt (including a virtual device identifier device ID and a virtual interrupt vector identifier vector ID) into a physical interrupt identifier (including a physical device identifier device ID and a physical interrupt vector identifier vector ID) that can be identified by the hardware layer (e.g., a physical ITS) based on the first mapping relationship. In addition, the hardware layer can determine a virtual interrupt identifier corresponding to the physical interrupt identifier based on the preset second mapping relationship, and can determine a virtual processor identifier corresponding to the physical interrupt identifier based on the preset third mapping relationship. The virtual processor identifier uniquely corresponds to the target virtual processor.

[0016] To ensure that the virtual processor can receive the correct virtual interrupt identifier, the virtual interrupt identifier determined by the hardware layer based on the preset second mapping relationship must match the virtual interrupt identifier corresponding to the virtual interrupt determined by the VMM in the virtual interrupt forwarding implemented via software, and the virtual processor identifier determined by the hardware layer based on the preset third mapping relationship must match the virtual processor identifier corresponding to the virtual interrupt determined by the VMM in the virtual interrupt forwarding implemented via software.

[0017] In any implementation, the hardware layer is further configured to generate a physical interrupt based on the physical interrupt identifier, and to obtain a virtual interrupt identifier and a virtual processor identifier based on the physical interrupt.

[0018] In one implementation, a host machine may forward an interrupt generation request carrying a physical interrupt identifier to a physical ITS on the hardware layer, and the physical ITS may generate a corresponding physical interrupt based on the interrupt generation request carrying the physical interrupt identifier.

[0019] In any other implementation, the host machine may write a physical interrupt identifier to a target register located in the hardware layer, which then generates a physical interrupt.

[0020] In this embodiment of the present application, the host machine can write a physical interrupt identifier to a target register located in the hardware layer. The target register has the function of generating a physical interrupt through software, and the physical ITS can obtain the physical interrupt from the target register.

[0021] In any implementation, a virtual interrupt includes a virtual device identifier and a virtual interrupt vector identifier.

[0022] The host machine is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, where the physical interrupt identifier includes a physical device identifier and a physical interrupt vector identifier.

[0023] In any implementation, the hardware layer is further configured to obtain interrupt state information corresponding to the physical interrupt identifier, the interrupt state information indicating whether a virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor. Specifically, the interrupt state information may include at least one of an interrupt pending state, an interrupt priority state, and an interrupt enabled state. The hardware layer is further configured to determine, based on the interrupt state information, that the virtual interrupt identifier may be forwarded to the virtual processor.

[0024] The interrupt pending information may indicate whether the virtual interrupt is in a pending / active state, the interrupt priority state may indicate the priority of the current virtual interrupt among all virtual interrupts to be processed, and the interrupt enabled state may indicate whether the interrupt can be forwarded to the processor. Specifically, if the physical interrupt identifier is in an enabled state and the priority state and pending state satisfy the conditions, the virtual interrupt identifier corresponding to the physical interrupt identifier can be forwarded to the virtual processor.

[0025] In any implementation, the host machine is further configured to obtain interrupt state information corresponding to the physical interrupt identifier from a hardware layer during a virtual machine live migration process, where the interrupt state information indicates whether a virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor, and the interrupt state information may include at least one of an interrupt pending state, an interrupt priority state, and an interrupt enabled state, and to write the interrupt state information to a hardware layer of a computing device other than the computing device.

[0026] According to a second aspect, the present application provides an interrupt processing method, the method being applied to a host machine, the host machine operating on a hardware layer, the method comprising the steps of: acquiring a virtual interrupt, acquiring a corresponding physical interrupt identifier based on the virtual interrupt, and forwarding the physical interrupt identifier to the hardware layer, such that the hardware layer acquires a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, the virtual processor identifier indicating the target virtual processor, and forwarding the virtual interrupt identifier to the target virtual processor.

[0027] In any implementation, a virtual interrupt corresponds uniquely to a virtual interrupt identifier.

[0028] In any implementation, the step of obtaining a corresponding physical interrupt identifier based on a virtual interrupt includes obtaining a physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a preset first mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and the physical interrupt identifier.

[0029] In any implementation, the virtual interrupt includes a virtual device identifier and a virtual interrupt vector identifier, and obtaining a corresponding physical interrupt identifier based on the virtual interrupt includes obtaining a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier based on the virtual interrupt, where the physical interrupt identifier includes the physical device identifier and the physical interrupt vector identifier.

[0030] In any implementation, the method further includes a step of obtaining interrupt state information corresponding to a physical interrupt identifier from a hardware layer in a virtual machine live migration process, where the interrupt state information indicates whether a virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to a virtual processor, and the interrupt state information may include at least one of an interrupt pending state, an interrupt priority state, and an interrupt enabled state, and a step of writing the interrupt state information to a hardware layer of a computing device other than the computing device.

[0031] According to a third aspect, the present application provides an interrupt processing method, the method being applied to a computing device, the computing device including a hardware layer and a host machine operating on the hardware layer, the method including: the hardware layer obtaining, based on a physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier, the physical interrupt identifier corresponding to the virtual interrupt and being obtained and sent by the host machine to the hardware layer based on the virtual interrupt, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, the virtual processor identifier indicating the target virtual processor; and forwarding the virtual interrupt identifier to the target virtual processor.

[0032] In any implementation, a virtual interrupt corresponds uniquely to a virtual interrupt identifier.

[0033] In any implementation, the computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on a hardware layer.

[0034] The step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier includes a step of the physical ITS obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier.

[0035] Forwarding the virtual interrupt identifier to the target virtual processor includes the physical GIC forwarding the virtual interrupt identifier to the target virtual processor.

[0036] In any implementation, the step of the hardware layer obtaining a corresponding virtual interrupt identifier based on the physical interrupt identifier includes a step of the hardware layer obtaining a virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a preset second mapping relationship, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual interrupt identifier.

[0037] In any implementation, the method further includes obtaining a corresponding virtual processor identifier based on the physical interrupt identifier and a preset third mapping relationship, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual processor identifier.

[0038] In any implementation, the step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier includes the step of the hardware layer generating a physical interrupt based on the physical interrupt identifier, and the step of obtaining a virtual interrupt identifier and a virtual processor identifier based on the physical interrupt.

[0039] In any implementation, the method further includes a step of the hardware layer acquiring interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether a virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor, and a step of determining, based on the interrupt status information, that the virtual interrupt identifier may be forwarded to the virtual processor.

[0040] In any implementation, the method further includes a step of the host machine obtaining interrupt status information corresponding to a physical interrupt identifier from a hardware layer in a virtual machine live migration process, the interrupt status information indicating whether a virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to a virtual processor, and a step of writing the interrupt status information to a hardware layer of a computing device other than the computing device.

[0041] According to a fourth aspect, the present application provides an interrupt processing apparatus, the apparatus including: a virtual interrupt processing unit configured to obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to a hardware layer, and a physical interrupt processing unit configured to obtain a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, the virtual processor identifier indicating the target virtual processor, and forward the virtual interrupt identifier to the target virtual processor.

[0042] The interrupt handling device may be used in a computing device including a hardware layer and a host machine operating on the hardware layer, the interrupt handling device including a virtual interrupt handling unit deployed in the host machine and a physical interrupt handling unit deployed in the hardware layer.

[0043] In any implementation, a virtual interrupt corresponds uniquely to a virtual interrupt identifier.

[0044] In any implementation, the computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on a hardware layer.

[0045] The physical ITS is configured to obtain, based on the physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier.

[0046] The physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor.

[0047] In any implementation, the virtual interrupt processing unit is further configured to obtain a physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a preset first mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and the physical interrupt identifier.

[0048] The physical interrupt processing unit is further configured to obtain a virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a preset second mapping relationship, where the second mapping relationship indicates a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual interrupt identifier.

[0049] In any implementation, the physical interrupt handling unit is further configured to obtain a corresponding virtual processor identifier based on the physical interrupt identifier and a preset third mapping relationship, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual processor identifier.

[0050] In any implementation, the physical interrupt handling unit is further configured to generate a physical interrupt based on the physical interrupt identifier, and to obtain a virtual interrupt identifier and a virtual processor identifier based on the physical interrupt.

[0051] In any implementation, the virtual interrupt includes a virtual device identifier and a virtual interrupt vector identifier, and the virtual interrupt processing unit is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, where the physical interrupt identifier includes the physical device identifier and the physical interrupt vector identifier.

[0052] In any implementation, the physical interrupt processing unit is further configured to obtain interrupt state information corresponding to the physical interrupt identifier, the interrupt state information indicating whether a virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor, and determine, based on the interrupt state information, that the virtual interrupt identifier may be forwarded to the virtual processor.

[0053] In any implementation, the virtual interrupt processing unit is further configured to obtain interrupt state information corresponding to a physical interrupt identifier from a hardware layer during a virtual machine live migration process, the interrupt state information indicating whether a virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor, and to write the interrupt state information to a hardware layer of a computing device other than the computing device.

[0054] According to a fifth aspect, an embodiment of the present application provides a computing device, the computing device including a processor and a memory, connected via a bus, the processor may call code in the memory to implement any of the interrupt handling methods in the second or third aspects.

[0055] An embodiment of the present application provides a computing device. The computing device includes a hardware layer and a host machine operating on the hardware layer. The host machine is configured to obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to the hardware layer. The hardware layer is configured to obtain a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, where the virtual interrupt is configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely correspond to the virtual processor identifier, and the virtual processor identifier indicates the target virtual processor, and forward the virtual interrupt identifier to the target virtual processor. In the above-mentioned method, a virtual interrupt obtained by the host machine is mapped to a physical interrupt of the physical layer, and the virtual interrupt identifier is forwarded to the virtual processor by using the physical layer. When the hardware layer transparently transmits the virtual interrupt identifier to the virtual processor, the virtual processor does not need to terminate. This reduces the delay caused by the termination of the virtual processor when software implements virtual interrupt routing. [Brief description of the drawings]

[0056] [Figure 1] FIG. 2 is a schematic diagram of the architecture of a computing node according to an embodiment of the present application;

[0057] [Figure 2a] FIG. 1 is a schematic diagram of a computing device according to an embodiment of the present application.

[0058] [Figure 2b] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0059] [Diagram 3] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0060] [Figure 4] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0061] [Diagram 5] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0062] [Figure 6] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0063] [Figure 7] FIG. 2 is a schematic diagram of an interrupt process according to an embodiment of the present application;

[0064] [Figure 8] FIG. 1 is a schematic diagram of an interrupt processing device according to an embodiment of the present application;

[0065] [Figure 9] FIG. 1 is a schematic diagram of a computing device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0066] Hereinafter, the embodiments of the present application will be described with reference to the accompanying drawings. It is clear that the described embodiments are only a part of the embodiments of the present application, not all of them. Those skilled in the art can understand that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application can also be applied to similar technical problems.

[0067] In the present specification, claims, and accompanying drawings, terms such as "first," "second," and the like are intended to distinguish between similar objects, but do not necessarily indicate a particular order or sequence. It should be understood that data referred to in such a manner are interchangeable in appropriate circumstances, such that the embodiments of the present application described herein may be implemented in other orders than those shown or described herein. In addition, the terms "include," "have," and any other variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to the process, method, product, or device. The names or numbers of steps in this application do not imply that the steps in a method procedure must be performed in the temporal / logical sequence indicated by the names or numbers. The sequence of execution of steps in a named or numbered procedure may be changed based on the technical objective to be achieved, provided that the same or similar technical effect may be achieved.

[0068] Additionally, in the present description, unless otherwise specified, "a plurality of" means two or more than two. The term "and / or" in the present description only describes a linkage relationship to describe related objects, and indicates that three relationships may exist. For example, A and / or B, or A / B, may represent the following three cases: only A exists, both A and B exist, and only B exists.

[0069] In order to facilitate understanding of the embodiments of the present application, the computing node 100 shown in Fig. 1 is first used as an example to explain some basic concepts in the virtualization field of the present application. The computing node 100 may be a computing device in the embodiments of the present application.

[0070] Virtualization is the virtualization of hardware resources (e.g., processors and storage space in memory and network resources) at the hardware layer of a computing node, and then sharing the virtualized hardware resources for use by multiple virtual computers. A virtual computer is a general term for operating environments virtualized through software on all types of computing devices, and includes virtual machines and containers.

[0071] 1, computing node 100 may include a hardware layer, a host machine layer, and a virtualization layer, where the virtualization layer includes two virtual machines. The hardware layer includes hardware such as two processors 110, memory 120, and a physical interrupt management unit 160. In other embodiments, there may be more or fewer processors 110 and virtual machines.

[0072] One or more virtual machines (VM) are obtained through simulation on a physical computer via software. These virtual machines run in a fully isolated environment and behave like a real computer. A guest operating system (guest OS) can be installed on the virtual machine, and one or more applications run on the guest operating system. The virtual machine can also access network resources. Applications running on the virtual machine behave similarly to applications running on a real computer.

[0073] A virtual processor (e.g., 110-v in FIG. 1) is a representation of a physical processing unit, such as a virtual central processing unit (vCPU), provided to a virtual computer in a shared or sliced ​​manner in virtualization technology. A virtual computer may have one or more virtual processors that serve the virtual computer. When there are multiple virtual processors, typically one virtual processor is a primary virtual processor and the other virtual processors are secondary virtual processors.

[0074] A host machine operating system 170 and a VMM 180 are deployed on a host machine, where the VMM 180 corresponds to a hypervisor or other type of virtual monitor in other virtualization architectures. The VMM 180 may be deployed on the host machine operating system 170 or may be deployed separately from the host machine operating system 170. The VMM 180 is responsible for managing one or more virtual machines running on the VMM 180.

[0075] A virtual machine (VM) includes a virtual hardware layer, a guest operating system 190, and multiple applications. The virtual hardware layer includes virtual hardware such as virtual memory and virtual processor 110-v (not shown in the figure). As shown in FIG. 1, this embodiment includes two virtual machines, each of which includes three virtual processors 110-v. The virtual processors 110-v are implemented by combining software and hardware. The operation of the virtual processors 110-v is actually implemented by reading and running a software program by a physical core. For example, one physical core reads a software program, runs the software program in a specific mode of the hardware-assisted virtualization of the physical core, and implements the virtual processors 110-v. Therefore, the virtual processors 110-v need to be scheduled to a physical core.

[0076] The virtual processor 110-v may be bound to a physical core. Specifically, one virtual processor 110-v is fixedly operated on a physical core and cannot be scheduled to operate on another physical core. In this case, the virtual processor is core-bound. If one virtual processor 110-v can be scheduled to operate on different physical cores according to requirements, the virtual processor is non-core-bound.

[0077] The total number of virtual processors 110-v shown in FIG. 1 is six, which is more than the number of physical cores, four. This scenario is called physical processor overcommitment. In the case of physical processor overcommitment, multiple virtual processors may share the same physical core in a time-slicing manner or other manner. Such a physical core is called a non-exclusive core. Indeed, non-exclusive cores may also occur in the case of non-overcommitment. A physical core is an exclusive core when it is bound to a virtual processor and is not shared by other virtual processors.

[0078] It should be understood that a virtual machine corresponds to an independent computer, and the operations performed by the virtual machine may be considered to be performed by a virtual processor. However, the virtual processor is implemented through software. Therefore, the operations performed by the virtual processor are actually performed by a physical processor or physical core operating by the virtual processor. In the embodiments of the present application, the above expression scheme is selectively used to follow the technical expression habits of the current scenario.

[0079] A virtual machine may include a container, and a container corresponds to an application. In some other embodiments, the virtualization layer is implemented by using a lightweight virtualization technology, such as libOS190. One libOS usually includes one application. The entire libOS includes one or more libraries that are linked to an application to form a single address space image. In the embodiments of the present application, a virtual machine implemented by using a conventional virtualization technology is generally used as an example. For other types of virtualization architectures, refer to the implementation of a virtual machine.

[0080] As a management layer, the host machine is configured to manage and allocate hardware resources, present them to the virtual machines for the virtual hardware platform, and implement virtual machine scheduling and isolation, and the like. In some implementations, the host machine layer includes a host machine operating system and a virtual monitor device, such as a virtual machine monitor (VMM) or a hypervisor. The virtual monitor device may be deployed inside the host machine operating system or outside the host machine operating system. In some other implementations, the "host machine layer" may further include one privileged virtual machine (e.g., virtualization architecture Xen). The virtual hardware platform provides various hardware resources, such as virtual processors, virtual memory, virtual disks, and virtual network interface cards, for each virtual computer running on the virtual hardware platform. The virtual computers run on the virtual hardware platform prepared by the host machine layer for the virtual computers. In this application, the host machine layer is sometimes referred to as a host machine for short.

[0081] The host machine may further include a back-end driver (e.g., software such as open source QEMU) configured to simulate a virtual disk with a cache for the virtual machine, including analyzing cache settings and cache policies (e.g., cache size, cache type, and cache priority) set by a user, and to simulate a virtual disk with a virtual machine cache that satisfies the user settings for the virtual machine, providing a simulation of the first physical address requested by the front-end driver, and initiating management operations related to cache attribute changes in virtualization management, such as tasks such as expanding and decreasing online cache capacity. The back-end driver may obtain a virtual interrupt that enables the behavior of the virtual machine, may trigger a corresponding virtual interrupt, and may forward the virtual interrupt to the VMM.

[0082] It should be understood that the QEMU included in the host machine shown in Figure 1 is just an example. In a real application, the host machine may further include other types of backend drivers.

[0083] As a virtual monitor, the VMM 180 is responsible for scheduling the virtual processors 110-v of each virtual machine VM. For example, a kernel-based virtual machine (KVM) is a typical VMM.

[0084] Virtual interrupt management unit 181 is deployed at the host machine layer. When VMM 180 is deployed at host machine operating system 170, virtual interrupt management unit 181 may be deployed at host machine operating system 170, may be deployed at VMM 180, or may be partially deployed at host machine operating system 170 and partially deployed at VMM 180. When VMM 180 is deployed at host machine operating system 170, virtual interrupt management unit 181 may be deployed at VMM 180, may be deployed at a space of host machine operating system 170 other than VMM 180, or may be partially deployed at VMM 180 and partially deployed at a space of host machine operating system 170 other than VMM 180.

[0085] The virtual interrupt management unit 181 may implement steps relating to the host machine in the interrupt handling method of the present application.

[0086] The hardware layer is the hardware platform on which the virtualization environment runs. The hardware layer may include multiple types of hardware. For example, the hardware layer of a physical computer may include a processor and memory, and may further include interrupt controllers, network interface cards (NICs), input / output I / O devices, and the like.

[0087] The processor 110 may also be referred to as a physical processor. A physical core represents the smallest processing unit in a processor. As shown in FIG. 1, the processor in this embodiment may have two physical cores, namely, core 0 and core 1, and multiple registers. In some other embodiments, the processor may include more or fewer cores, and the processor may include a different number of cores. A processor with multiple physical cores is referred to as a multi-core processor. Based on the kernel architecture, the processor may be classified into a processor with the same architecture and multiple cores, and a processor with a different architecture and multiple cores. A virtual processor may be bound to a physical core. Specifically, a virtual processor runs fixedly on a physical core and cannot be scheduled to run on another physical core. In this case, the virtual processor is core-bound. If one virtual processor can be scheduled to run on different physical cores according to requirements, the virtual processor is non-core-bound.

[0088] The physical interrupt management unit 160 is responsible for collecting physical interrupt requests (which may also be referred to as physical interrupts) and sending these physical interrupt requests to the respective processors 110 or transparently transmitting these physical interrupt requests to virtual processors on the respective processors according to certain rules. It should be noted that the physical interrupt management unit 160 may perform some steps related to the hardware layer in the interrupt processing method of the present application.

[0089] It should be noted that an interrupt is an event generated by software or hardware, and interrupts include virtual interrupts and physical interrupts. A physical interrupt is an event generated by hardware. The hardware sends the event to the processor. Upon receiving the event, the processor temporarily stops the execution of the current program and executes the program corresponding to the event. An interrupt request generated by hardware may be triggered by hardware or software. Some hardware in a computer (such as a network adapter, an audio adapter, a mouse, and a hard disk) may complete certain tasks without the intervention of the processor. However, these hardware still need to interrupt the processor periodically, so that the processor performs some specific tasks for the hardware.

[0090] In a virtualized environment, the VMM must present to the virtual machines a virtual interrupt architecture similar to the physical interrupt architecture, where physical interrupts correspond to virtual interrupts (which may also be referred to as virtualized interrupts), which may be enabled by a front-end driver in the virtual machine and captured and triggered by a back-end driver (e.g., QEMU) in the host machine.

[0091] An interrupt controller, located between the hardware that triggers the interrupt request and the processor, is primarily configured to collect the interrupts generated by the respective hardware and send them to the processor based on certain priorities or other rules.

[0092] Interrupt affinity refers to a correspondence between an interrupt and a processing entity (which may be a physical processing entity or a virtual processing entity, e.g., a physical core) that processes the interrupt request. Based on the interrupt affinity, an interrupt controller may send an interrupt request to one or more physical processing entities that correspond to the interrupt request.

[0093] 2a illustrates a computing device according to an embodiment of the present application. As shown in FIG. 2a, the computing device includes a host machine 200 and a hardware layer 203.

[0094] In this embodiment of the present application, a virtual device in a virtual machine may enable a virtual interrupt, and the virtual device may be a virtual device simulated through software, for example, a serial port simulated through software. A back-end driver (e.g., QEMU) in a host machine may obtain the behavior of enabling the virtual interrupt by the virtual machine and trigger the virtual interrupt. The virtual interrupt may include a virtual device identifier DEVICE ID and a virtual interrupt vector identifier VECTOR ID. When an interrupt resource is initialized, the virtual device identifier DEVICE ID and the virtual interrupt vector identifier VECTOR ID are assigned to a virtual processor of the virtual machine. Each virtual processor uniquely corresponds to one virtual device identifier DEVICE ID and multiple virtual interrupt vector identifier VECTOR ID. The virtual device identifier DEVICE ID in a virtual interrupt may indicate which virtual device enables the virtual interrupt, and the virtual interrupt vector identifier VECTOR ID may indicate a specific virtual interrupt in multiple virtual interrupts assigned by the virtual device.

[0095] After triggering the virtual interrupt, the back-end driver (e.g., QEMU) may forward the virtual interrupt to the VMM. In response, the VMM in the host machine 200 may acquire the virtual interrupt.

[0096] In this embodiment of the present application, the VMM in the host machine may obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to the hardware layer 203. For details, please refer to Figure 2b which shows more details.

[0097] By using the hardware layer, in order to transparently transmit the virtual interrupt acquired by the VMM to the corresponding virtual processor, the virtual interrupt needs to be converted into a physical interrupt that can be identified and handled by the hardware layer.

[0098] Specifically, the hardware layer may include a physical interrupt translation service (ITS) and a physical generic interrupt controller (GIC). The physical ITS may obtain a physical interrupt, which is used to interrupt a virtual CPU. The physical ITS may determine a virtual CPU corresponding to the physical interrupt, and may determine a virtual interrupt identifier (indicating a particular virtual interrupt) corresponding to the physical interrupt. The physical GIC may send the virtual interrupt identifier to the virtual CPU.

[0099] The following describes how the VMM translates virtual interrupts into physical interrupts that can be identified and handled by the hardware layer, which can ensure that the virtual processor receives the correct virtual interrupt identifier.

[0100] From the perspective of virtual interrupt forwarding processing implemented through software, after obtaining the virtual interrupt (including the virtual device identifier DEVICE ID and the virtual interrupt vector identifier VECTOR ID), the VMM may determine the virtual interrupt identifier and the virtual processor identifier corresponding to the virtual interrupt based on the physical ITS. It should be noted that the virtual interrupt identifier in this specification may be different from the virtual device identifier DEVICE ID and the virtual interrupt vector identifier VECTOR ID. GICv4 specified in the ARM architecture standard is used as an example, and the virtual interrupt identifier is vINTID. The virtual processor identifier uniquely indicates the target virtual processor.

[0101] In order to transparently transmit the virtual interrupt acquired by the VMM to the corresponding virtual processor by using the hardware layer and ensure that the virtual processor can receive the correct virtual interrupt identifier, a new mapping relationship (hereinafter may be referred to as a first mapping relationship) needs to be preset on the VMM, and a new mapping relationship (hereinafter may be referred to as a second mapping relationship and a third mapping relationship) is adaptively configured on the hardware layer. The mapping relationship configured on the VMM and the mapping relationship configured on the hardware layer can be mutually configured, so that the VMM can convert the acquired virtual interrupt (including a virtual device identifier device ID and a virtual interrupt vector identifier vector ID) into a physical interrupt identifier (including a physical device identifier device ID and a physical interrupt vector identifier vector ID) that can be identified by the hardware layer (e.g., a physical ITS) based on the first mapping relationship. In addition, the hardware layer can determine a virtual interrupt identifier corresponding to the physical interrupt identifier based on the preset second mapping relationship, and can determine a virtual processor identifier corresponding to the physical interrupt identifier based on the preset third mapping relationship. The virtual processor identifier uniquely corresponds to the target virtual processor.

[0102] In order to ensure that the virtual processor can receive the correct virtual interrupt identifier, the virtual interrupt identifier determined by the hardware layer based on the preset second mapping relationship must match the virtual interrupt identifier corresponding to the virtual interrupt determined by the VMM in the virtual interrupt transfer implemented through software. In addition, the virtual processor identifier determined by the hardware layer based on the preset third mapping relationship must match the virtual processor identifier corresponding to the virtual interrupt determined by the VMM in the virtual interrupt transfer implemented through software. Specifically, when the virtual interrupt transfer is implemented through software, the VMM may determine B (virtual interrupt identifier) ​​and C (virtual processor identifier) ​​based on A (virtual interrupt), the VMM may determine D (physical interrupt identifier) ​​based on A (virtual interrupt), and the physical layer may determine B (virtual interrupt identifier) ​​and C (virtual processor identifier) ​​based on D (physical interrupt identifier) ​​in a solution that transparently transmits the virtual interrupt acquired by the VMM to the corresponding virtual processor by using the hardware layer.

[0103] More specifically, in order to implement the above-mentioned process on the VMM, an abstraction of a corresponding physical device may be preset for each virtual device. Since a physical device may not actually exist, the abstraction is referred to as an abstraction of a physical device, and only interrupt resources allocated by the physical device are stored in the VMM, and the interrupt resources may include a physical interrupt identifier. In this embodiment, the VMM may store in advance a physical interrupt identifier corresponding to each of a plurality of virtual interrupts corresponding to a virtual device. For example, a virtual interrupt may include a virtual device identifier DEVICE ID and a virtual interrupt vector identifier VECTOR ID, and the VMM may obtain a physical device identifier DEVICE ID corresponding to the virtual device identifier DEVICE ID and a physical interrupt vector identifier VECTOR ID corresponding to the virtual interrupt vector identifier VECTOR ID.

[0104] In one implementation, the VMM may maintain a preset first mapping relationship. The first mapping relationship may include a mapping relationship between a virtual interrupt and a physical interrupt identifier. The VMM may obtain a physical interrupt identifier corresponding to the virtual interrupt based on the first mapping relationship. More specifically, the first mapping relationship may include two tables (table 1 and table 2). Table 1 includes a plurality of virtual device identifiers DEVICE IDs and pointers corresponding to the respective virtual device identifiers DEVICE IDs. The VMM may find table 2 corresponding to the virtual device identifier DEVICE IDs by using the pointers. Table 2 may include a plurality of virtual interrupt vector identifiers VECTOR IDs corresponding to the virtual device identifiers DEVICE IDs and physical interrupt vector identifiers VECTOR IDs corresponding to the respective virtual interrupt vector identifiers VECTOR IDs. In the above manner, the VMM may determine a physical interrupt identifier corresponding to the virtual interrupt.

[0105] After the VMM obtains the physical interrupt identifier corresponding to the virtual interrupt, the host machine may transfer the physical interrupt identifier to the hardware layer. Specifically, the host machine may transfer the physical interrupt identifier to a physical ITS on the hardware layer.

[0106] The physical ITS on the hardware layer may obtain a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, where the virtual interrupt identifier uniquely indicates a virtual interrupt and the virtual processor identifier indicates a target virtual processor, and the physical GIC on the hardware layer may forward the virtual interrupt identifier corresponding to the virtual processor identifier to the target virtual processor.

[0107] In any implementation, the hardware layer may further generate a physical interrupt based on the physical interrupt identifier.

[0108] In this embodiment of the present application, the host machine may further forward the interrupt generation request carrying the physical interrupt identifier to the hardware layer, and the hardware layer may generate a physical interrupt based on the interrupt generation request.

[0109] In one implementation, a host machine may forward an interrupt generation request carrying a physical interrupt identifier to a physical ITS on the hardware layer, and the physical ITS may generate a corresponding physical interrupt based on the interrupt generation request carrying the physical interrupt identifier.

[0110] In any other implementation, the host machine may write a physical interrupt identifier to a target register located in the hardware layer, which then generates a physical interrupt.

[0111] In this embodiment of the present application, the host machine can write a physical interrupt identifier to a target register located in the hardware layer. The target register has the function of generating a physical interrupt through software, and the physical ITS can obtain the physical interrupt from the target register.

[0112] In this embodiment of the present application, the hardware layer may obtain a corresponding virtual interrupt identifier based on the physical interrupt identifier and the preset second mapping relationship.

[0113] In one implementation, the physical ITS on the hardware layer may maintain a pre-configured mapping relationship, where the mapping relationship may include a mapping relationship between a physical interrupt identifier, a virtual interrupt identifier, and a virtual processor identifier. Specifically, the hardware layer may maintain a second mapping relationship, where the second mapping relationship includes a mapping relationship between a physical interrupt identifier and a virtual interrupt identifier. The hardware layer may obtain a virtual interrupt identifier corresponding to the physical interrupt identifier based on the second mapping relationship. The hardware layer may maintain a third mapping relationship, where the third mapping relationship includes a mapping relationship between a physical interrupt identifier and a virtual processor identifier. The hardware layer may obtain a virtual processor identifier corresponding to the physical interrupt identifier based on the third mapping relationship. Here, the virtual processor identifier indicates a target virtual processor.

[0114] In this embodiment of the present application, the second mapping relationship and the third mapping relationship may be set on the hardware layer in a pre-setting process. Based on the second mapping relationship and the third mapping relationship, the hardware layer may determine a virtual processor identifier corresponding to the physical interrupt identifier obtained from the VMM, and may determine a virtual interrupt identifier corresponding to the physical interrupt identifier. The virtual interrupt identifier (e.g., vINTID) may uniquely indicate a virtual interrupt. The hardware layer may transfer the virtual interrupt identifier to a target virtual processor.

[0115] The virtual interrupt is used to interrupt the corresponding target virtual processor. To ensure the correctness of the interrupt routing, the mapping relationship between the virtual interrupt and the physical interrupt identifier and maintained by the VMM, and the mapping relationship between the physical interrupt identifier and the target virtual processor and maintained by the hardware layer can be combined, so that the target virtual processor finally determined by the hardware layer is the corresponding target virtual processor interrupted by the virtual interrupt. In addition to ensuring the correctness of the root endpoint (target virtual processor), the correctness of the content of the virtual interrupt also needs to be guaranteed. Therefore, the virtual interrupt identifier obtained by the hardware layer by mapping the physical interrupt identifier needs to uniquely indicate the virtual interrupt. In this way, it corresponds to the target virtual processor receiving the correct virtual interrupt identifier. From the virtual processor's point of view, the above scheme is consistent with the existing scheme of implementing virtual interrupt routing via VMM software.

[0116] In this embodiment of the present application, the routing table of the physical ITS (the second and third mapping relationships in the above embodiment) is defined in the GICv4 specification. One channel is opened for the virtual interrupt on the hardware layer, and the channel can transparently transmit the virtual interrupt from the hardware layer to the target virtual processor. When the hardware layer transparently transmits the virtual interrupt identifier to the target virtual processor, it is not necessary for the hardware layer to write the virtual interrupt identifier to a system register corresponding to the virtual processor and then for the virtual processor to retrieve the virtual interrupt identifier from the system register when the virtual processor runs again. Instead, the virtual interrupt identifier is directly forwarded to the target virtual processor. Thus, the target virtual processor does not need to terminate. This reduces the delay caused by virtual processor termination when software implements virtual interrupt routing.

[0117] In one implementation, the hardware layer is further configured to obtain interrupt state information corresponding to the physical interrupt identifier, where the interrupt state information indicates whether a virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to a virtual processor, and the interrupt state information may include at least one of interrupt pending information, interrupt priority state, and interrupt enabled state, and determine whether the virtual interrupt identifier may be forwarded to the virtual processor based on the interrupt state information. The interrupt pending information may indicate whether the virtual interrupt is in a pending / active state, the interrupt priority state may indicate a priority of the current virtual interrupt among all virtual interrupts to be processed, and the interrupt enabled state may indicate whether the interrupt may be forwarded to the processor. Specifically, if the physical interrupt identifier is in an enabled state and the priority state and the pending state satisfy a condition, the virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor.

[0118] In this embodiment of the present application, the physical generic interrupt controller on the hardware layer can obtain interrupt status information corresponding to the physical interrupt identifier, where the interrupt status information indicates whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor, and the interrupt status information includes at least one of interrupt pending information, interrupt priority status, and interrupt enable status, and determine whether the virtual interrupt identifier can be transferred to the virtual processor based on the interrupt status information. For specific details, please refer to the relevant description specified by the physical terminal controller at the physical layer in ARM or other standards. Details will not be described again in this specification.

[0119] An embodiment of the present application provides a computing device. The computing device includes a hardware layer and a host machine operating on the hardware layer. The host machine is configured to obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to the hardware layer. The hardware layer is configured to obtain a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, where the virtual interrupt is configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely correspond to the virtual processor identifier, and the virtual processor identifier indicates the target virtual processor, and forward the virtual interrupt identifier to the target virtual processor. In the above-mentioned method, a virtual interrupt obtained by the host machine is mapped to a physical interrupt of the physical layer, and the virtual interrupt identifier is forwarded to the virtual processor by using the physical layer. When the hardware layer transparently transmits the virtual interrupt identifier to the virtual processor, the virtual processor does not need to terminate. This reduces the delay caused by the termination of the virtual processor when software implements virtual interrupt routing.

[0120] FIG. 3 shows a more specific embodiment. As shown in FIG. 3, the VMM may include a shadow mapping 2021 and a shadow device 2022, and the interrupt system may include a shadow interrupt domain 2023. The shadow mapping 2021 and the shadow device 2022 may provide an abstraction of a "shadow object" for each virtual device of the virtual machine. A front-end driver (e.g., a VirtIO driver) in the virtual machine assigns multiple virtual interrupts to the virtual devices. The shadow mapping 2021 and the shadow device 2022 are responsible for linking each virtual interrupt of the virtual device to one physical interrupt on the host. When a front-end driver of a virtual machine enables a virtual interrupt (in other words, when a virtual device triggers an interrupt), adjusts virtual interrupt routing (in other words, modifies the mapping relationship between a virtual interrupt and a virtual processor), modifies a virtual interrupt setting (in other words, modifies the mapping relationship between a virtual interrupt and a virtual interrupt identifier), etc., the VMM may intercept these operations and synchronize interrupt information configured on the virtual machine (e.g., including information related to enabling a virtual interrupt by a front-end driver, information related to adjusting virtual interrupt routing, and information related to modifying a virtual interrupt setting) to the corresponding shadow mapping 2021 and the corresponding shadow device 2022. Specifically, the shadow mapping 2021 may include important information registered by a virtual device, such as a device identifier of the virtual device, a virtual interrupt vector identifier, an upper limit of the number of virtual interrupts that can be processed by a virtual processor, and virtual routing information of the virtual interrupt of a device such as a virtual interrupt identifier and a virtual processor corresponding to each virtual interrupt.

[0121] Shadow device 2022 may apply a physical interrupt resource, such as a physical interrupt identifier on the host for each virtual device.

[0122] The shadow interrupt domain 2023 may forward the physical interrupt identifier to the physical ITS in the physical layer.

[0123] As shown in FIG. 3 , the physical ITS in the hardware layer may include a physical interrupt routing table 2041, and the hardware layer may include a physical generic interrupt controller 2042. The physical interrupt routing table 2041 may be a pre-configured mapping relationship, and the mapping relationship may include a mapping relationship between a physical interrupt identifier, a virtual interrupt identifier, and a virtual processor. Specifically, the hardware layer may maintain a second mapping relationship. The second mapping relationship may be part of the physical interrupt routing table 2041. The second mapping relationship includes a mapping relationship between a physical interrupt identifier and a virtual interrupt identifier. The hardware layer may obtain a virtual interrupt identifier corresponding to the physical interrupt identifier based on the second mapping relationship. The hardware layer may maintain a third mapping relationship. The third mapping relationship may be part of the physical interrupt routing table 2041. The third mapping relationship may include a mapping relationship between a physical interrupt identifier and a virtual processor. The hardware layer may obtain a virtual processor corresponding to the physical interrupt identifier based on the third mapping relationship.

[0124] The physical generic interrupt controller 2042 may obtain interrupt state information corresponding to the physical interrupt identifier based on the correspondence between the physical interrupt identifier and the interrupt state information, and may determine, based on the interrupt state information, that the virtual interrupt identifier may be transferred to the virtual processor.

[0125] Figure 4 shows more details than Figure 3. As shown in Figure 4, the VMM may write a physical interrupt identifier to a target register 2043 located in the hardware layer, which may then generate a physical interrupt. The target register may generate the physical interrupt via software, and the ITS may obtain the physical interrupt from the target register.

[0126] To implement the aforementioned effects, the VMM and hardware layers need to be pre-configured. In one implementation, a virtual VirtIO device driver in a virtual machine is loaded and initialized, and related operations are intercepted by the VMM to establish a software routing table for virtual interrupts. The virtual VirtIO device driver in a virtual machine enables virtual device functionality by writing a peripheral component interconnect (PCI) standard configuration space. This write operation is intercepted by the VMM. The VMM may register the important information of the virtual device with the VMM according to a protocol (such as a device identifier of the virtual device, a virtual interrupt vector identifier, an upper limit on the number of virtual interrupts that can be handled by a virtual processor, and the like). The VMM creates one shadow object for the registered virtual device, creates a shadow device based on the registered virtual device information, and applies to occupy the physical host device identifier and physical interrupt identifier resources. The requested physical interrupt identifier resource is registered in the shadow interrupt domain for management. The VMM may analyze the routing information of each virtual interrupt of the virtual device, including information such as a target virtual interrupt routing device, a virtual interrupt identifier, and a target virtual processor, by using the registered virtual device. The shadow object analyzes the virtual interrupt routing relationship, translates and constructs the format of the physical interrupt routing device, and establishes a physical device interrupt routing table of the physical interrupt of the corresponding virtual device through managing the shadow interrupt domain by using the physical interrupt corresponding to the shadow device. The VMM analyzes the routing information of each virtual interrupt of the virtual device, including information such as a target virtual interrupt routing device, a virtual interrupt identifier, and a target virtual processor, by using the registered virtual device.Other attributes of the virtual interrupt (such as enablement, priority, and affinity) are translated using shadow objects, and the interrupt setting table of the shadow device is configured or modified through managing the shadow interrupt domain.

[0127] In any implementation, the host machine may further obtain interrupt status information corresponding to the physical interrupt identifier from the hardware layer in the virtual machine live migration process, the interrupt status information including at least one of interrupt pending information, interrupt priority state, and interrupt enabled state, and write the interrupt status information to the hardware layer of the computing device other than the computing device. FIG. 5 illustrates an example of a computing device according to an embodiment of the present application. As shown in FIG. 5, the interrupt status information may be stored in an area 501 that can be accessed by both the hardware layer and the VMM, so that the physical interrupt processing unit 204 on the hardware layer may obtain the interrupt status information and determine whether the virtual interrupt identifier needs to be transferred to the corresponding virtual processor based on the interrupt status information. In addition, in the virtual machine live migration process, the VMM 201 may also obtain the interrupt status information corresponding to the physical interrupt identifier from the hardware layer and write the interrupt status information to the hardware layer of the computing device other than the computing device.

[0128] The computing device provided in one embodiment of the present application will be described below with reference to FIG. 6. As shown in FIG. 6, the computing device provided in this embodiment of the present application includes a virtual machine, a host machine, and a hardware layer. A virtual device in a virtual machine may trigger an interrupt, and a corresponding front-end driver enables the virtual interrupt. A back-end driver in a host machine may obtain the behavior of enabling the virtual interrupt by the front-end driver, and may trigger the virtual interrupt. An IRQFD subsystem may receive the virtual interrupt triggered by the back-end driver, and may transfer the virtual interrupt to a shadow device module. The shadow device module may determine a physical interrupt identifier of the virtual interrupt, and the shadow interrupt domain transfers the physical interrupt identifier to a physical ITS on a hardware layer by using a physical ITS driver. The physical ITS may determine a virtual interrupt identifier and a target virtual processor corresponding to the physical interrupt identifier, and the physical GIC transfers the virtual interrupt identifier to the target virtual processor VCPU. The computing device provided in one embodiment of the present application will be described below with reference to FIG. 7. As shown in FIG. 7, the computing device provided in this embodiment of the present application includes a virtual machine, a host machine, and a hardware layer. To ensure the consistency of interrupt states between software and hardware, the virtual GIC in the VMM needs to obtain the interrupt state information in the physical GIC and update the interrupt state information of the corresponding virtual interrupt. Specifically, as shown in FIG. 7, the back-end driver may trigger a status synchronization request, where the request holds information related to the virtual interrupt that needs to be synchronized. The shadow mapping and shadow object may decode the virtual interrupt information of the virtual device and convert the virtual interrupt information to the corresponding physical interrupt identifier, and the shadow interrupt domain may forward the physical interrupt identifier to the physical ITS of the physical layer. The physical GIC may forward the interrupt state information related to the physical interrupt identifier to a table (e.g., a reservation table) that stores the interrupt state information in the host machine.Additionally, the state synchronization system may transfer interrupt state information associated with the physical interrupt identifier to the virtual GIC, so that the virtual GIC updates the interrupt state information for the virtual interrupt.

[0129] 8 is a schematic diagram of the structure of an interrupt processing device 800 according to an embodiment of the present application. The computing device includes a hardware layer and a host machine running on the hardware layer. The interrupt processing device includes a virtual interrupt processing unit 801 deployed on the host machine and a physical interrupt processing unit 802 deployed on the hardware layer.

[0130] The virtual interrupt handling unit 801 is configured to obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to a hardware layer.

[0131] The physical interrupt handling unit 802 is configured to obtain, based on the physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier, where the virtual interrupt is configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely correspond to the virtual processor identifier, and the virtual processor identifier indicates the target virtual processor, and to forward the virtual interrupt identifier to the target virtual processor.

[0132] The virtual interrupt handling unit 801 may correspond to the virtual interrupt management unit 181 shown in FIG. 1, the virtual interrupt handling unit 202 shown in FIGS. 2a and 2b, and the shadow mapping, shadow device, and shadow interrupt domain shown in FIGS. 3 to 7.

[0133] The physical interrupt handling unit 802 may correspond to the physical interrupt management unit 160 shown in FIG. 1, the physical interrupt handling unit 204 shown in FIGS. 2a and 2b, and the physical ITS and physical generic interrupt controller GIC shown in FIGS. 3 to 7.

[0134] In any implementation, a virtual interrupt corresponds uniquely to a virtual interrupt identifier.

[0135] In any implementation, the computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on a hardware layer.

[0136] The physical ITS is configured to obtain, based on the physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier.

[0137] The physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor.

[0138] In any implementation, the virtual interrupt processing unit 801 is further configured to obtain a physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a pre-configured first mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and the physical interrupt identifier.

[0139] The physical interrupt processing unit 802 is further configured to obtain a virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a preset second mapping relationship, where the second mapping relationship indicates a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual interrupt identifier.

[0140] In any implementation, the physical interrupt handling unit 802 is further configured to obtain a corresponding virtual processor identifier based on the physical interrupt identifier and a preset third mapping relationship, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and the virtual processor identifier.

[0141] In any implementation, the physical interrupt handling unit 802 is further configured to generate a physical interrupt based on the physical interrupt identifier, and to obtain a virtual interrupt identifier and a virtual processor identifier based on the physical interrupt.

[0142] In any implementation, a virtual interrupt includes a virtual device identifier and a virtual interrupt vector identifier.

[0143] The virtual interrupt processing unit 801 is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, where the physical interrupt identifier includes a physical device identifier and a physical interrupt vector identifier.

[0144] In any implementation, the physical interrupt processing unit 802 is further configured to obtain interrupt state information corresponding to the physical interrupt identifier, where the interrupt state information indicates whether a virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor, where the interrupt state information includes at least one of an interrupt pending state, an interrupt priority state, and an interrupt enabled state, and to determine, based on the interrupt state information, that the virtual interrupt identifier may be forwarded to the virtual processor.

[0145] In any implementation, the virtual interrupt handling unit 801 is further configured to obtain interrupt state information corresponding to a physical interrupt identifier from a hardware layer during a virtual machine live migration process, where the interrupt state information indicates whether a virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to a virtual processor, and the interrupt state information includes at least one of an interrupt pending state, an interrupt priority state, and an interrupt enabled state, and to write the interrupt state information to a hardware layer of a computing device other than the computing device.

[0146] The present application further provides a non-volatile computer readable storage medium. The non-volatile computer readable storage medium includes computer instructions used to execute an interrupt processing method. The method is applied to a host machine, the host machine is located in a computing device, and the computing device includes a hardware layer. The non-volatile computer readable storage medium includes a first computer instruction used to obtain a virtual interrupt.

[0147] The non-volatile computer readable storage medium includes second computer instructions used to obtain a corresponding physical interrupt identifier based on the virtual interrupt and forward the physical interrupt identifier to a hardware layer.

[0148] In one implementation, a first computer instruction is used to obtain a corresponding physical interrupt identifier based on the virtual interrupt and a first preset mapping relationship.

[0149] In one implementation, a virtual interrupt includes a virtual device identifier and a virtual interrupt vector identifier.

[0150] The first computer instructions are configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, the physical interrupt identifier including the physical device identifier and the physical interrupt vector identifier.

[0151] In one implementation, the non-volatile computer-readable storage medium further includes third computer instructions used for obtaining interrupt status information corresponding to a physical interrupt identifier from a hardware layer in a virtual machine live migration process, where the interrupt status information includes at least one of pending information, priority information, and valid information, and writing the interrupt status information to a hardware layer of a computing device other than the computing device.

[0152] The present application further provides a non-volatile computer-readable storage medium, which includes computer instructions, which, when executed by a computer, can implement the interrupt handling method in the above-mentioned embodiment.

[0153] 9 is a schematic diagram of a computing device 900 according to an embodiment of the present application. As shown in FIG. 9, the computing device 900 includes a processor 901 and a memory 902 connected via a bus. The processor 901 can call a code in the memory 902 to implement the interrupt handling method in the above embodiment.

[0154] For the purpose of simple and concise description, it can be clearly understood by those skilled in the art that the detailed operation processes of the above-mentioned systems, devices and units can be referred to the corresponding processes in the above-mentioned method embodiments, and the details will not be described again in this specification.

[0155] In the embodiments provided in the present application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the above-mentioned device embodiment is merely exemplary. For example, the division into units is merely a division according to logical functions, and there may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into other systems, and some features may be ignored or not implemented. In addition, the shown or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electronic, mechanical, or other forms.

[0156] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

[0157] In addition, the functional units in the embodiments of the present application may be integrated into one processing unit, each of the units may exist physically isolated, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0158] When an integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the function may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, essentially or a part that contributes to the prior art, or all or a part of the technical solution may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for instructing a computer device (which may be a personal computer, a server, or other network device) to execute all or a part of the steps of the method in the embodiment of FIG. 2a of the present application. The aforementioned storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0159] In conclusion, the above embodiments are merely intended to illustrate the technical solutions of the present application. Although the present application has been described in detail with reference to the above embodiments, it should be understood that those skilled in the art may further modify the technical solutions described in the above embodiments or make conceivable substitutions to some technical features thereof without departing from the scope of the technical solutions of the embodiments of the present application. [Other possible items] [Item 1] A computing device comprising: a hardware layer; and a host machine operating on the hardware layer; The host machine includes: Obtaining a virtual interrupt; obtaining a corresponding physical interrupt identifier based on the virtual interrupt, and forwarding the physical interrupt identifier to the hardware layer; The device is configured to: The hardware layer includes: obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; 16. A computing device configured to: [Item 2] 2. The computing device of claim 1, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier. [Item 3] The computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on the hardware layer; The physical ITS is configured to obtain the corresponding virtual interrupt identifier and the corresponding virtual processor identifier based on the physical interrupt identifier; the physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor; 3. A computing device according to item 1 or 2. [Item 4] The host machine is further configured to obtain the physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a first preset mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and a physical interrupt identifier; The hardware layer is further configured to obtain the virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual interrupt identifier. 4. A computing device according to any one of items 1 to 3. [Item 5] 5. The computing device of claim 1, wherein the hardware layer is further configured to obtain the corresponding virtual processor identifier based on the physical interrupt identifier and a third mapping relationship that is preset, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual processor identifier. [Item 6] The hardware layer includes: generating a physical interrupt based on the physical interrupt identifier; obtaining the virtual interrupt identifier and the virtual processor identifier based on the physical interrupt; 6. The computing device of any one of items 1 to 5, further configured to: [Item 7] the virtual interrupt comprises a virtual device identifier and a virtual interrupt vector identifier; the host machine is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, the physical interrupt identifier comprising the physical device identifier and the physical interrupt vector identifier. 7. A computing device according to any one of items 1 to 6. [Item 8] The hardware layer includes: obtaining interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor; determining, based on the interrupt status information, that the virtual interrupt identifier may be transferred to the virtual processor; 8. The computing device of any one of items 1 to 7, further configured to: [Item 9] The host machine includes: obtaining, from the hardware layer in a virtual machine live migration process, the interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor; writing said interrupt status information to a hardware layer of a computing device other than said computing device; 9. The computing device of any one of items 1 to 8, further configured to: [Item 10] 1. A method for handling interrupts, the method being applied to a host machine, the host machine operating on a hardware layer, the method comprising: obtaining a virtual interrupt; obtaining a corresponding physical interrupt identifier based on the virtual interrupt; forwarding the physical interrupt identifier to the hardware layer, such that the hardware layer obtains a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; A method comprising: [Item 11] 11. The method of claim 10, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier. [Item 12] The step of obtaining a corresponding physical interrupt identifier based on the virtual interrupt comprises: obtaining the physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a first preset mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and a physical interrupt identifier; 13. The method according to item 11 or 12, comprising the steps of: [Item 13] the virtual interrupt comprises a virtual device identifier and a virtual interrupt vector identifier; The step of obtaining a corresponding physical interrupt identifier based on the virtual interrupt comprises: obtaining a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier based on the virtual interrupt, the physical interrupt identifier comprising the physical device identifier and the physical interrupt vector identifier. 13. The method according to any one of items 10 to 12, comprising the steps of: [Item 14] The method comprises: acquiring interrupt status information corresponding to the physical interrupt identifier from the hardware layer in a virtual machine live migration process, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor; writing the interrupt status information to a hardware layer of a computing device other than the computing device; 14. The method of any one of items 10 to 13, further comprising: [Item 15] 1. A method for handling interrupts, the method being applied to a computing device, the computing device comprising a hardware layer and a host machine operating on the hardware layer, the method comprising: the hardware layer obtaining, based on a physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier, the physical interrupt identifier corresponding to a virtual interrupt and being a physical interrupt identifier obtained by the host machine based on the virtual interrupt and sent to the hardware layer, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; A method comprising: [Item 16] 20. The method of claim 15, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier. [Item 17] The computing device includes a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on the hardware layer; The step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the physical ITS obtaining the corresponding virtual interrupt identifier and the corresponding virtual processor identifier based on the physical interrupt identifier. having The step of transferring the virtual interrupt identifier to the target virtual processor comprises: the physical GIC forwarding the virtual interrupt identifier to the target virtual processor. 17. The method according to item 15 or 16, comprising the steps of: [Item 18] The step of the hardware layer obtaining a corresponding virtual interrupt identifier based on the physical interrupt identifier, The hardware layer obtains the virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual interrupt identifier. 18. The method according to any one of items 15 to 17, comprising the steps of: [Item 19] The method comprises: obtaining the corresponding virtual processor identifier based on the physical interrupt identifier and a third mapping relationship preset, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual processor identifier; 19. The method of any one of items 15 to 18, further comprising: [Item 20] The step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the hardware layer generating a physical interrupt based on the physical interrupt identifier; obtaining the virtual interrupt identifier and the virtual processor identifier based on the physical interrupt; 20. The method according to any one of items 15 to 19, comprising the steps of: [Item 21] The method comprises: the hardware layer obtaining interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor; determining, based on the interrupt status information, that the virtual interrupt identifier may be forwarded to the virtual processor; 21. The method of any one of items 15 to 20, further comprising: [Item 22] a virtual interrupt processing unit configured to obtain a virtual interrupt, obtain a corresponding physical interrupt identifier based on the virtual interrupt, and forward the physical interrupt identifier to a hardware layer; a physical interrupt handling unit configured to obtain, based on the physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, the virtual processor identifier indicating the target virtual processor, and to forward the virtual interrupt identifier to the target virtual processor; An interrupt processing device comprising: [Item 23] 23. The apparatus of claim 22, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier. [Item 24] The computing device comprises a physical interrupt translation service ITS and a physical generic interrupt controller GIC, which are implemented based on the hardware layer; The physical ITS is configured to obtain the corresponding virtual interrupt identifier and the corresponding virtual processor identifier based on the physical interrupt identifier; the physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor; 24. The device according to item 22 or 23. [Item 25] The virtual interrupt processing unit is further configured to obtain the physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a first mapping relationship preset, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and a physical interrupt identifier; The physical interrupt processing unit is further configured to obtain the virtual interrupt identifier corresponding to the physical interrupt based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual interrupt identifier. 25. Apparatus according to any one of items 22 to 24. [Item 26] 26. The apparatus of claim 22, wherein the physical interrupt handling unit is further configured to obtain the corresponding virtual processor identifier based on the physical interrupt identifier and a third mapping relationship that is preset, the third mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual processor identifier. [Item 27] The physical interrupt processing unit includes: generating a physical interrupt based on the physical interrupt identifier; obtaining the virtual interrupt identifier and the virtual processor identifier based on the physical interrupt; 27. The apparatus of any one of items 22 to 26, further configured to: [Item 28] the virtual interrupt comprises a virtual device identifier and a virtual interrupt vector identifier; the virtual interrupt processing unit is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, the physical interrupt identifier comprising the physical device identifier and the physical interrupt vector identifier. 28. Apparatus according to any one of items 22 to 27. [Item 29] The physical interrupt processing unit includes: obtaining interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the virtual processor; determining, based on the interrupt status information, that the virtual interrupt identifier may be transferred to the virtual processor; 29. The apparatus of any one of items 22 to 28, further configured to: [Item 30] The virtual interrupt processing unit includes: obtaining, from the hardware layer in a virtual machine live migration process, the interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the virtual processor; writing said interrupt status information to a hardware layer of a computing device other than said computing device; 30. The apparatus of any one of items 22 to 29, further configured to: [Item 31] A computer-readable medium comprising instructions which, when executed by one or more processors of a processing device, cause the computer-readable medium to be operated to perform the method of any one of items 10 to 21.

Claims

1. A computing device comprising: a hardware layer; and a host machine operating on the hardware layer; The host machine includes: Obtaining a virtual interrupt; obtaining a corresponding physical interrupt identifier based on the virtual interrupt, and forwarding the physical interrupt identifier to the hardware layer; The device is configured to: The hardware layer includes: obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt identifier and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; configured to: The hardware layer is further configured to obtain the corresponding virtual processor identifier based on the physical interrupt identifier and a preset mapping relationship, the mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual processor identifier.

2. 2. The computing device of claim 1, wherein the hardware layer forwards the virtual interrupt identifier to the target virtual processor such that the target virtual processor can obtain the virtual interrupt identifier without ceasing operation.

3. 3. A computing device as claimed in claim 1 or 2, wherein the virtual interrupt corresponds uniquely to the virtual interrupt identifier.

4. The computing device includes a physical interrupt translation service (ITS) and a physical generic interrupt controller (GIC), the physical interrupt translation service (ITS) and the physical generic interrupt controller (GIC) being implemented based on the hardware layer; the physical ITS is configured to obtain the corresponding virtual interrupt identifier and the corresponding virtual processor identifier based on the physical interrupt identifier; the physical GIC is configured to forward the virtual interrupt identifier to the target virtual processor; A computing device according to any one of claims 1 to 3.

5. The host machine is further configured to obtain the physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a first preset mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and a physical interrupt identifier; The hardware layer is further configured to obtain the virtual interrupt identifier corresponding to the physical interrupt identifier based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual interrupt identifier. A computing device according to any one of claims 1 to 4.

6. The hardware layer includes: generating a physical interrupt based on the physical interrupt identifier; obtaining the virtual interrupt identifier and the virtual processor identifier based on the physical interrupt; The computing device of claim 1 , further configured to:

7. the virtual interrupt comprises a virtual device identifier and a virtual interrupt vector identifier; the host machine is further configured to obtain, based on the virtual interrupt, a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier, the physical interrupt identifier comprising the physical device identifier and the physical interrupt vector identifier. A computing device according to any one of claims 1 to 6.

8. The hardware layer includes: obtaining interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier may be forwarded to the target virtual processor; determining, based on the interrupt status information, that the virtual interrupt identifier may be forwarded to the target virtual processor; The computing device of claim 1 , further configured to:

9. A computing device comprising: a hardware layer; and a host machine operating on the hardware layer; The host machine includes: Obtaining a virtual interrupt; obtaining a corresponding physical interrupt identifier based on the virtual interrupt, and forwarding the physical interrupt identifier to the hardware layer; The device is configured to: The hardware layer includes: obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt identifier and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; configured to: The host machine includes: obtaining, from the hardware layer in a virtual machine live migration process, the interrupt status information corresponding to the physical interrupt identifier, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the target virtual processor; writing said interrupt status information to a hardware layer of a computing device other than said computing device; The computing device, further configured to:

10. An interrupt processing method, the interrupt processing method being applied to a host machine, the host machine operating on a hardware layer, the interrupt processing method comprising: obtaining a virtual interrupt; obtaining a corresponding physical interrupt identifier based on the virtual interrupt; forwarding the physical interrupt identifier to the hardware layer, such that the hardware layer obtains a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the virtual interrupt configured to interrupt a target virtual processor, the virtual interrupt identifier and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; Equipped with The interrupt processing method includes: obtaining interrupt status information corresponding to the physical interrupt identifier from the hardware layer in a virtual machine live migration process, the interrupt status information indicating whether the virtual interrupt identifier corresponding to the physical interrupt identifier can be transferred to the target virtual processor; writing said interrupt status information to a hardware layer of a computing device other than the computing device that comprises said host machine; The interrupt processing method further comprises:

11. 11. The method of claim 10, wherein the step of transferring the virtual interrupt identifier to the target virtual processor enables the target virtual processor to obtain the virtual interrupt identifier without ceasing operation.

12. 12. The method of claim 10, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier.

13. The step of obtaining a corresponding physical interrupt identifier based on the virtual interrupt comprises: obtaining the physical interrupt identifier corresponding to the virtual interrupt based on the virtual interrupt and a first preset mapping relationship, the first mapping relationship indicating a plurality of virtual interrupts and a correspondence between each virtual interrupt and a physical interrupt identifier; 13. A method for handling interrupts according to any one of claims 10 to 12, comprising:

14. the virtual interrupt comprises a virtual device identifier and a virtual interrupt vector identifier; The step of obtaining a corresponding physical interrupt identifier based on the virtual interrupt comprises: obtaining a physical device identifier corresponding to the virtual device identifier and a physical interrupt vector identifier corresponding to the virtual interrupt vector identifier based on the virtual interrupt, the physical interrupt identifier comprising the physical device identifier and the physical interrupt vector identifier.

14. A method for handling interrupts according to any one of claims 10 to 13, comprising:

15. An interrupt processing method, the interrupt processing method being applied to a computing device, the computing device including a hardware layer and a host machine operating on the hardware layer, the interrupt processing method comprising: the hardware layer obtaining, based on a physical interrupt identifier, a corresponding virtual interrupt identifier and a corresponding virtual processor identifier, the physical interrupt identifier corresponding to a virtual interrupt and being a physical interrupt identifier obtained by the host machine based on the virtual interrupt and sent to the hardware layer, the virtual interrupt being configured to interrupt a target virtual processor, the virtual interrupt identifier and the physical interrupt identifier uniquely corresponding to the virtual processor identifier, and the virtual processor identifier indicating the target virtual processor; transferring the virtual interrupt identifier to the target virtual processor; Equipped with The interrupt processing method includes: obtaining the corresponding virtual processor identifier based on the physical interrupt identifier and a preset mapping relationship, the mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual processor identifier; The interrupt processing method further comprises:

16. 16. The method of claim 15, wherein the step of transferring the virtual interrupt identifier to the target virtual processor enables the target virtual processor to obtain the virtual interrupt identifier without ceasing operation.

17. 17. The method of claim 15, wherein the virtual interrupt uniquely corresponds to the virtual interrupt identifier.

18. The computing device includes a physical interrupt translation service (ITS) and a physical generic interrupt controller (GIC), the physical interrupt translation service (ITS) and the physical generic interrupt controller (GIC) being implemented based on the hardware layer; The step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the physical ITS obtaining the corresponding virtual interrupt identifier and the corresponding virtual processor identifier based on the physical interrupt identifier. having The step of transferring the virtual interrupt identifier to the target virtual processor comprises: the physical GIC forwarding the virtual interrupt identifier to the target virtual processor. having 18. A method for handling interrupts according to any one of claims 15 to 17.

19. The step of the hardware layer obtaining a corresponding virtual interrupt identifier based on the physical interrupt identifier, The hardware layer acquires the virtual interrupt identifier corresponding to the physical interrupt identifier based on the physical interrupt identifier and a second mapping relationship preset, the second mapping relationship indicating a plurality of physical interrupt identifiers and a correspondence between each physical interrupt identifier and a virtual interrupt identifier.

19. A method for handling interrupts according to any one of claims 15 to 18, comprising:

20. The step of the hardware layer obtaining a corresponding virtual interrupt identifier and a corresponding virtual processor identifier based on the physical interrupt identifier, the hardware layer generating a physical interrupt based on the physical interrupt identifier; obtaining the virtual interrupt identifier and the virtual processor identifier based on the physical interrupt; 20. A method for handling interrupts according to any one of claims 15 to 19, comprising:

Citation Information

Patent Citations

  • Input and output interruption processing system

    JP1986240333A

  • Interrupt virtualization

    JP2013519169A

  • A method and related devices for handling interrupts by a virtualization platform

    JP2017518589A

  • Computer and interrupt control method

    WO2016092667A1