Method and device for realizing MSI / MSIX interruption in jailhouse and electronic equipment

By establishing an address relationship mapping table in the EL2 page table of jailhouse, configuring MSI/MSIX capability table entries and interrupt translation service drivers, and registering interrupt vectors, the problem that jailhouse cannot handle PCI/PCIe device MSI/MSIX interrupts is solved and improved Improved interrupt handling performance.

CN118535281APending Publication Date: 2024-08-23PHYTIUM TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410584859.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

As a virtual machine manager, jailhouse cannot handle MSI/MSIX interrupts generated by PCI/PCIe devices, resulting in poor interrupt processing performance.

Method used

Establish the address relationship mapping table of the PCI/PCIe controller's configuration address space in the jailhouse's EL2 page table, configure the MSI/MSIX capability table entry, configure the interrupt translation service driver, and register MSI/MSIX in the CPU's exception vector table Interrupt vectors to enable jailhouse to handle MSI/MSIX interrupts generated by PCI/PCIe devices.

Benefits of technology

Improved jailhouse's interrupt handling performance so that it can effectively handle MSI/MSIX interrupts generated by PCI/PCIe devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535281A
    Figure CN118535281A
Patent Text Reader

Abstract

The invention relates to a method and a device for realizing MSI / MSIX interruption in jailhome, electronic equipment and a computer readable storage medium, the method comprises the following steps: establishing an address relation mapping table of a configuration address space of a PCI / PCIe controller in an EL2 page table of the jailhome, so that the jailhome can access the configuration address space of the PCI / PCIe controller; configuring an MSI / MSIX capability table item of the PCI device or the PCIe device according to the address relation mapping table, so that the PCI / PCIe controller can send an MSI / MSIX interrupt generated by the PCI device or the PCIe device to an interrupt controller according to the MSI / MSIX capability table item; an interrupt translation service driving program is configured in the jailhouse; and registering the MSI / MSIX interrupt vector in the abnormal vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving the LPI interrupt sent by the interrupt controller. According to the method and the device, the jailhome has the capability of processing the MSI / MSIX interrupt generated by the PCI / PCIe equipment, so that the interrupt processing performance of the jailhome is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine management, and in particular to a method, device, electronic device and computer-readable storage medium for implementing MSI / MSIX interruption in a jailhouse. Background Art

[0002] Jailhouse is a lightweight virtual machine manager in the field of embedded computers. It is a computer software that runs on a host machine to create, run and manage virtual machines. It is a functional component of computer virtualization technology.

[0003] As a virtual machine manager, jailhouse can only handle INTx interrupts generated by Peripheral Component Interconnect / Peripheral Component Interconnect Express (PCI / PCIe) devices, and does not have the ability to handle Message Signaled Interrupts / Message Signaled Interrupt-Extension (MSI / MSIX). As a result, jailhouse as a virtual machine manager has poor interrupt handling performance. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a method, device, electronic device and computer-readable storage medium for implementing MSI / MSIX interrupts in a jailhouse, so as to enable the jailhouse to have the ability to handle MSI / MSIX interrupts generated by PCI / PCIe devices, thereby improving the interrupt processing performance of the jailhouse.

[0005] The embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for implementing MSI / MSIX interrupts in a jailhouse, comprising: establishing an address relationship mapping table of a configuration address space of a PCI / PCIe controller in an EL2 page table of the jailhouse, so that the jailhouse can access the configuration address space of the PCI / PCIe controller; wherein the address relationship mapping table represents a mapping relationship between a virtual address and a physical address of the configuration address space of the PCI / PCIe controller; configuring an MSI / MSIX capability table entry of a PCI device or a PCIe device according to the address relationship mapping table, so that the PCI / PCIe controller can send an MSI / MSIX interrupt generated by the PCI device or the PCIe device to an interrupt controller according to the MSI / MSIX capability table entry; configuring an interrupt translation service driver in the jailhouse; wherein the interrupt translation service driver is used to control the interrupt controller to translate a received MSI / MSIX interrupt into an LPI interrupt and send it to a CPU pin; registering an MSI / MSIX interrupt vector in an exception vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving an LPI interrupt sent by the interrupt controller.

[0007] In the embodiment of the present application, an address relationship mapping table of the configuration address space of the PCI / PCIe controller is established in the EL2 page table of the jailhouse, so that the jailhouse has the ability to access the configuration address space of the PCI / PCIe controller. Then, by configuring the MSI / MSIX capability table item of the PCI / PCIe device connected to the PCI / PCIe controller, the PCI / PCIe controller can send the MSI / MSIX interrupt generated by the PCI device or PCIe device to the interrupt controller according to the MSI / MSIX capability table item. Then, by configuring the interrupt translation service driver, the MSI / MSIX interrupt is converted into an LPI interrupt and the LPI interrupt is sent to the interrupt pin of the CPU. Finally, the MSI / MSIX interrupt vector is registered in the exception vector table of the CPU, so that the CPU can determine the MSI / MSIX interrupt vector in the exception vector table and execute the interrupt processing function of the MSI / MSIX device, so that the jailhouse has the ability to process the MSI / MSIX interrupt generated by the PCI / PCIe device, thereby improving the interrupt processing performance of the jailhouse.

[0008] In combination with a possible implementation manner of the embodiment of the first aspect, the establishing an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse includes: establishing an L0 page table, an L1 page table and an L2 page table in the EL2 page table of the jailhouse; establishing an address mapping relationship of the virtual address base of the configuration address space of the PCI / PCIe controller from the L0 page table to the L2 page table, and establishing an address mapping relationship of the virtual address base of the configuration address space of the PCI / PCIe controller from the L1 page table to the L2 page table; and saving the physical address of the configuration address space of the PCI / PCIe controller in the L2 page table.

[0009] In an embodiment of the present application, by setting three-level page tables, namely L0 page table, L1 page table and L2 page table, the virtual address of the configuration address space of the PCI / PCIe controller is converted into a physical address according to the three-level page table, thereby achieving isolation and protection of the memory space.

[0010] In combination with a possible implementation manner of the embodiment of the first aspect, the address relationship mapping table of the configuration address space of the PCI / PCIe controller is established in the EL2 page table of the jailhouse, and also includes: saving the virtual address and physical address of the configuration address space of the PCI / PCIe controller in the address translation backup buffer of the memory management unit.

[0011] In an embodiment of the present application, the virtual address and physical address of the configuration address space of the PCI / PCIe controller are saved in the address translation lookaside buffer of the memory management unit. When the jailhouse queries the physical address of the configuration address space of the PCI / PCIe controller through the virtual address of the configuration address space of the PCI / PCIe controller, addressing is performed in the address translation lookaside buffer first, thereby improving the addressing speed.

[0012] In combination with a possible implementation manner of the embodiment of the first aspect, a capability table of a PCI device or a PCIe device is stored in the configuration address space of the PCI / PCIe controller, and configuring the MSI / MSIX capability table item of the PCI device or the PCIe device according to the address relationship mapping table includes: accessing the configuration address space of the PCI / PCIe controller according to the address relationship mapping table; determining the MSI / MSIX capability table item from the capability table of the PCI device or the PCIe device; and configuring the MSI / MSIX capability table item according to the base address of the interrupt controller.

[0013] In an embodiment of the present application, the MSI / MSIX capability table entry is determined by accessing the configuration address space of the PCI / PCIe controller, and the base address of the interrupt controller is written into the MSI / MSIX capability table entry, thereby enabling the PCI / PCIe controller to forward the MSI / MSIX interrupt to the interrupt controller.

[0014] In combination with a possible implementation manner of the embodiment of the first aspect, the configuring the MSI / MSIX capability table entry according to the base address of the interrupt controller includes: writing the first 32 bits of the base address of the interrupt translation service register of the interrupt controller into the first field of the MSI / MSIX capability table entry; writing the last 32 bits of the base address of the interrupt translation service register of the interrupt controller into the second field of the MSI / MSIX capability table entry; and writing the event number of the MSI / MSIX interrupt into the third field of the MSI / MSIX capability table entry.

[0015] In an embodiment of the present application, the base address of the interrupt translation service register and the event number of the MSI / MSIX interrupt are written into the three fields of the MSI / MSIX capability table entry, so that the PCI / PCIe controller forwards the MSI / MSIX interrupt to the interrupt translation service register of the interrupt controller, so that the MSI / MSIX interrupt can be subsequently converted into an LPI interrupt.

[0016] In combination with a possible implementation manner of the first aspect, the configuring of the interrupt translation service driver in the jailhouse includes: establishing a mapping relationship between a device table, an interrupt conversion table and a Collection table through an interrupt translation service command, so that the interrupt translation service driver can translate the MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin according to the device table, the interrupt conversion table and the Collection table.

[0017] In an embodiment of the present application, a mapping relationship between the device table, the interrupt conversion table and the Collection table is established through an interrupt translation service command, so that the interrupt translation service in the interrupt controller can translate the MSI / MSIX interrupt into an LPI interrupt according to the device table, the interrupt conversion table and the Collection table and send it to the CPU pin, thereby realizing the sending of the MSI / MSIX interrupt generated by the PCI / PCIe device to the CPU.

[0018] In combination with a possible implementation manner of the embodiment of the first aspect, registering the MSI / MSIX interrupt vector in the exception vector table of the CPU includes: establishing an exception vector table; writing the base address of the exception vector table into a vector base address register; and writing the MSI / MSIX interrupt vector into the exception vector table.

[0019] In an embodiment of the present application, by registering an MSI / MSIX interrupt vector in the exception vector table of the CPU, after the CPU receives an LPI interrupt sent by the interrupt controller, the MSI / MSIX interrupt vector is determined in the exception vector table, and the interrupt processing function of the MSI / MSIX device is executed, thereby processing the MSI / MSIX interrupt generated by the PCI / PCIe device.

[0020] In a second aspect, an embodiment of the present application further provides a device for implementing MSI / MSIX interruption in a jailhouse, comprising: a mapping module, configured to establish an address relationship mapping table of a configuration address space of a PCI / PCIe controller in an EL2 page table of a jailhouse, so that the jailhouse can access the configuration address space of the PCI / PCIe controller; wherein the address relationship mapping table represents a mapping relationship between a virtual address and a physical address of the configuration address space of the PCI / PCIe controller; a configuration module, configured to configure the MSI / MSIX function of a PCI device or a PCIe device according to the address relationship mapping table; The invention relates to a jailhouse, wherein the PCI / PCIe controller is provided with a MSI / MSIX capability table entry, so that the PCI / PCIe controller can send the MSI / MSIX interrupt generated by the PCI device or the PCIe device to the interrupt controller according to the MSI / MSIX capability table entry; an interrupt translation service driver is configured in the jailhouse; wherein the interrupt translation service driver is used to control the interrupt controller to translate the received MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin; and a registration module is used to register the MSI / MSIX interrupt vector in the exception vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving the LPI interrupt sent by the interrupt controller.

[0021] In combination with a possible implementation manner of the second aspect embodiment, the mapping module is specifically used to establish L0 page table, L1 page table and L2 page table in the EL2 page table of the jailhouse; establish an address mapping relationship of the virtual address base address of the configuration address space of the PCI / PCIe controller from the L0 page table to the L2 page table, and establish an address mapping relationship of the virtual address base address of the configuration address space of the PCI / PCIe controller from the L1 page table to the L2 page table; save the physical address of the configuration address space of the PCI / PCIe controller in the L2 page table.

[0022] In combination with a possible implementation manner of the second aspect embodiment, the mapping module is also used to save the virtual address and physical address of the configuration address space of the PCI / PCIe controller into the address translation backup buffer of the memory management unit.

[0023] In combination with a possible implementation manner of the second aspect embodiment, the configuration module is specifically used to access the configuration address space of the PCI / PCIe controller according to the address relationship mapping table; determine the MSI / MSIX capability table entry from the capability table of the PCI device or PCIe device; and configure the MSI / MSIX capability table entry according to the base address of the interrupt controller.

[0024] In combination with a possible implementation manner of the second aspect embodiment, the configuration module is specifically used to write the first 32 bits of the base address of the interrupt translation service register of the interrupt controller into the first field of the MSI / MSIX capability table item; write the last 32 bits of the base address of the interrupt translation service register of the interrupt controller into the second field of the MSI / MSIX capability table item; and write the event number of the MSI / MSIX interrupt into the third field of the MSI / MSIX capability table item.

[0025] In combination with a possible implementation manner of the second aspect embodiment, the configuration module is specifically used to establish a mapping relationship between the device table, the interrupt conversion table and the Collection table through an interrupt translation service command, so that the interrupt translation service driver can translate the MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin according to the device table, the interrupt conversion table and the Collection table.

[0026] In combination with a possible implementation manner of the embodiment of the second aspect, the registration module is specifically used to establish an exception vector table; write the base address of the exception vector table into a vector base address register; and write the MSI / MSIX interrupt vector into the exception vector table.

[0027] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus; the processor and the memory communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute a method as described in any of the foregoing embodiments.

[0028] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are read and executed by a computer, a method as described in any one of the aforementioned embodiments is executed.

[0029] Other features and advantages of the present application will be described in the following description. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The above and other purposes, features and advantages of the present application will be more clear as shown in the drawings.

[0031] Figure 1 A flowchart of a method for implementing MSI / MSIX interruption in a jailhouse provided by an embodiment of the present application is shown;

[0032] Figure 2 A flowchart showing a specific implementation of step S1 provided in an embodiment of the present application is shown;

[0033] Figure 3 A flowchart showing a specific implementation of step S2 provided in an embodiment of the present application is shown;

[0034] Figure 4 A structural block diagram of a device for implementing MSI / MSIX interruption in a jailhouse provided by an embodiment of the present application is shown;

[0035] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the scope of protection of the present application. It will be appreciated by those skilled in the art that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other.

[0037] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it is not necessary to further define and explain it in the subsequent drawings. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0038] In the description of the embodiments of the present application, unless otherwise clearly specified or limited, the technical term "electrical connection" may refer to a direct electrical connection or an indirect electrical connection via an intermediate medium.

[0039] To facilitate understanding of the technical solution of the present application, some professional terms involved in the embodiments of the present application are explained below.

[0040] PCI: Peripheral Component Interconnect, a standard for defining local buses introduced by Intel in 1991. This standard allows up to 10 expansion cards that comply with the PCI standard to be installed in a computer.

[0041] PCIe: Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard, high-speed serial point-to-point dual-channel high-bandwidth transmission, connected devices are allocated exclusive channel bandwidth and do not share bus bandwidth. It mainly supports active power management, error reporting, end-to-end reliability transmission, hot plugging, and quality of service functions.

[0042] PCI / PCIe device: a device that complies with the PCI standard or PCIe standard.

[0043] INTx interrupt: INTx interrupt is an interrupt request generated by the device through the INTx sideband signal. It is a pin-based signal interrupt, also called a legacy interrupt. INTx interrupt is an interrupt shared by multiple devices. When an interrupt occurs, the software interrupt processing function needs to query the hardware register to determine the interrupt source, which brings certain software overhead and performance loss.

[0044] MSI / MSIX interrupt: MSI / MSIX interrupt is an interrupt request generated by a device by writing specific data to a specific address in the system address space. It is a vector interrupt based on PCI bus transactions - memory write transactions.

[0045] Currently, MSI / MSIX interrupts are optional implementations of the PCI protocol and the preferred implementations of the PCIe protocol. Most PCI devices and PCIe devices generate interrupts through MSI / MSIX, and some specific PCIe devices only support MSI / MSIX interrupts. Jailhouse, as a widely used hypervisor, can only handle INTx interrupts, but lacks the ability to handle MSI / MSIX interrupts, which leads to poor interrupt handling performance of jailhouse.

[0046] In view of this, embodiments of the present application provide a method, apparatus, electronic device, and computer-readable storage medium for implementing MSI / MSIX interrupts in a jailhouse, so as to enable the jailhouse to have the ability to handle MSI / MSIX interrupts generated by PCI / PCIe devices, thereby improving the interrupt handling performance of the jailhouse.

[0047] The following will be combined Figure 1 The method for implementing MSI / MSIX interruption in a jailhouse provided in an embodiment of the present application is described.

[0048] S1: Create an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the jailhouse's EL2 page table.

[0049] In the embodiment of the present application, the address relationship mapping table represents the mapping relationship between the virtual address and the physical address of the configuration address space of the PCI / PCIe controller.

[0050] The jailhouse runs in the central processing unit (CPU). The CPU executes software programs of different natures at four different exception levels: EL3, EL2, EL1, and EL0. CPUs with higher exception levels have more control and management rights over software and hardware resources. The virtual machine manager runs at EL2, which is a hardware-specific exception level designed to provide CPU virtualization capabilities. As a virtual machine manager, jailhouse also runs at EL2.

[0051] In order to enable the jailhouse to handle the MSI / MSIX interrupts generated by the PCI / PCIe device, the MSI / MSIX capability table of the PCI / PCIe device needs to be configured. The MSI / MSIX capability table of the PCI / PCIe device is an item in the PCI / PCIe device capability list, which is usually configured in the configuration address space of the PCI / PCIe controller. Therefore, the jailhouse needs to be able to access the configuration address space of the PCI / PCIe controller first.

[0052] Various hardware registers in the PCI / PCIE controller provide an access interface to the jailhouse through the configuration space of the PCI / PCIE controller, and the configuration space is a physical address. Only physical addresses can be correctly addressed by the system. During the operation of the jailhouse, the CPU directly obtains virtual addresses instead of physical addresses from the jailhouse program. Virtual addresses cannot be directly used for addressing, and the virtual addresses need to be converted into physical addresses through the address translation function of the memory management unit (MMU). Therefore, it is necessary to establish an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse. The MMU queries the address relationship mapping table in the EL2 page table of the jailhouse, and determines the physical address of the configuration address space of the PCI / PCIe controller based on the virtual address of the configuration address space of the PCI / PCIe controller, so that the jailhouse can access the configuration address space of the PCI / PCIe controller.

[0053] In an optional implementation, Figure 2 As shown, the above step S1 may include the following contents:

[0054] Step A1: Create L0 page table, L1 page table and L2 page table in the EL2 page table of the jailhouse.

[0055] Step A2: Establish an address mapping relationship between the virtual address base of the configuration address space of the PCI / PCIe controller from the L0 page table to the L2 page table, and establish an address mapping relationship between the virtual address base of the configuration address space of the PCI / PCIe controller from the L1 page table to the L2 page table.

[0056] Step A3: Save the physical address of the configuration address space of the PCI / PCIe controller in the L2 page table.

[0057] In an embodiment of the present application, three-level page tables, namely, L0 page table, L1 page table and L2 page table, are established in the EL2 page table of the jailhouse. The three-level page table is used to convert the virtual address of the configuration address space of the PCI / PCIe controller into a physical address, thereby realizing isolation and protection of the memory space.

[0058] The above steps A1-A4 are described below with reference to specific examples.

[0059] In the above step A1, mapping the configuration address space of PCI / PCIE requires establishing three levels of page tables, namely, L0 page table, L1 page table and L2 page table. Each page table is an array, and the size of each array unit can be 8 bytes, a total of 64 bits. L0 page table, L1 page table and L2 page table can be set as three 4KB memory spaces.

[0060] The above step A2 may include:

[0061] Step A21: Set the virtual address range of the configuration address space of PCI / PCIE.

[0062] The size of the configuration address space of PCI / PCIE is usually 256 MB, so the virtual address base address of the configuration address space of PCI / PCIE can be configured as: 0x40000000, which is 256 MB.

[0063] Step A22: Check the validity of the L0 page table.

[0064] Through logical AND operation and shift operation, the virtual address [47:39] bit field of the configuration address space of PCI / PCIE is extracted, that is, [47:39] of the virtual base address 0x40000000. If the value is equal to 0, it means that the index value of the virtual address in the L0 page table is 0, that is, the 0th table entry of the L0 page table.

[0065] Check the 0th bit of the 0th entry in the L0 page table. If the bit is 1, it means that the page table entry of the L0 page table has been written into the L1 page table in advance, and the L1 page table needs to be released and cleared first; if the bit is 0, no cleanup operation is performed.

[0066] Step A23: Write the physical address of the L1 page table into the L0 page table.

[0067] The index value of the virtual base address of the PCI / PCIE configuration address space in the L0 page table is determined through step A22, and the index value is checked for validity. The physical address of the L1 page table is written to the [47:39] bit field of the 0th entry of the L0 page table.

[0068] Step A24: Write the attributes of the corresponding entry in the L0 page table.

[0069] Write the value 0x3 to the [1:0] bit field of the 0th entry in the L0 page table. 0x3 indicates that the entry is valid and its [47:12] bit field stores the physical address of the L1 page table.

[0070] Step A25: Refresh the system's data cache.

[0071] The updates to the L0 page table in step A23 and step A24 are flushed from the system cache to the system memory, thereby ensuring that the updated content of the L0 page table is stored in the system memory.

[0072] Step A26: Check the validity of the L1 page table entry.

[0073] Extract the virtual base address [38:30] bit field of the PCI / PCIE configuration address space, that is, [38:30] of the virtual base address 0x40000000. If the value is equal to 1, it means that the index value of the virtual address in the L1 page table is 1, that is, the first entry in the L1 page table.

[0074] Check the 0th bit of the 0th entry in the L1 page table. If the bit is 1, it means that the page table entry of the L1 page table has been written into the L2 page table in advance, and the L2 page table needs to be released and cleared first; if the bit is 0, no cleanup operation is performed.

[0075] Step A27: Write the physical address of the L2 page table into the L1 page table.

[0076] The index value of the virtual base address of the PCI / PCIE configuration address space in the L1 page table is determined through step A26, and the index value is checked for validity. The physical address of the L2 page table is written into the [38:30] bit field of the first entry of the L1 page table.

[0077] Step A28: Write the attributes of the corresponding entry in the L1 page table.

[0078] Write the value 0x3 to the [1:0] bit field of the first entry in the L1 page table. 0x3 indicates that the entry is valid and its [47:12] bit field stores the physical address of the L2 page table.

[0079] Step A29: Refresh the system's data cache.

[0080] The updates to the L1 page table in step A27 and step A28 are flushed from the system cache to the system memory, thereby ensuring that the updated content of the L1 page table is stored in the system memory.

[0081] Through the above steps A1 and A2, page tables L0, L1 and L2 are established, and address mapping of the virtual base value of the PCI / PCIE configuration address space from the L0 page table to the L2 page table is established.

[0082] In the above step A3, the physical address of the PCI / PCIE configuration address space is saved in the L2 page table, so that the jailhouse can determine the physical address of the PCI / PCIE configuration address space according to the L0 page table, the L1 page table and the L2 page table in the EL2 page table, thereby enabling the jailhouse to access the PCI / PCIe controller.

[0083] The above step A3 may include:

[0084] Step A31: Divide the memory block address of the physical address of the PCI / PCIE configuration address space.

[0085] The physical base value of the PCI / PCIE configuration address space is set to 0x40000000, and the size is 256MB. An L2 page table entry can map a 2MB memory block. Therefore, the configuration space is divided into a total of 128 physical memory blocks with consecutive physical addresses. The starting physical address of each memory block is shown in the following table:

[0086]

[0087]

[0088] Among them, the virtual address [29:21] in the above table represents the index value of the virtual base value of the PCI / PCIE configuration address space in the L2 page table, that is, the Nth table entry of the L2 page table, where the value range of N is 4 to 251, indicating the 248 memory blocks omitted in the middle.

[0089] Step A32: Check the validity of the L2 page table entry.

[0090] Check the 0th bit of the Nth entry in the L2 page table. If the bit is 1, it means that the page table entry of the L0 page table has been written into the memory block in advance, and the memory block needs to be released and cleared first; if the bit is 0, no cleanup operation is performed.

[0091] Step A33: Write the physical address of the PCI / PCIE configuration address space into the L2 page table.

[0092] The index value of the virtual base value of the PCI / PCIE configuration address space in the L2 page table, ie, the Nth entry in the L2 page table, is determined through step A32 and is checked for validity.

[0093] The physical address of the PCI / PCIE configuration address space determined in step A31 is written into the [47:21] bit field of the Nth entry in the L2 page table.

[0094] Through the above steps A1-A3, the mapping of the virtual address of the PCI / PCIE configuration address space to the physical address is established in the three-level page tables of L0, L1, and L2. When jailhouse is executed, the virtual address of the PCI / PCIE configuration address space is loaded, and the system MMU queries the three-level page tables of L0, L1, and L2 to find the corresponding physical address, and then performs memory addressing according to the physical address, so that jailhouse can access the configuration address space of the PCI / PCIe controller.

[0095] Further, as an optional implementation, the above step S1 also includes: saving the virtual address and the physical address of the configuration address space of the PCI / PCIe controller into the address translation backup buffer of the memory management unit.

[0096] In the embodiment of the present application, after the address relationship mapping table of the configuration address space of the PCI / PCIe controller is established in the EL2 page table of the jailhouse, the virtual address and physical address of the configuration address space of the PCI / PCIe controller are saved in the address translation lookup buffer of the memory management unit. In the process of the jailhouse querying the physical address of the configuration address space of the PCI / PCIe controller through the virtual address of the configuration address space of the PCI / PCIe controller, addressing is performed in the address translation lookup buffer first, thereby improving the addressing speed.

[0097] In another optional implementation, the above step S1 may include the following: determining a mapping relationship between a virtual address and a physical address in a configuration address space of a PCI / PCIe controller; and storing the mapping relationship in a form of a mapping table in an EL2 page table of a jailhouse.

[0098] In the embodiment of the present application, the mapping relationship between the virtual address of the configuration address space of the PCI / PCIe controller and the physical address of the configuration address space of the PCI / PCIe controller is determined. A mapping table is established, and two table entries are set in the mapping table. The first table entry stores the virtual address of the configuration address space of the PCI / PCIe controller, and the second table entry stores the physical address of the configuration address space of the PCI / PCIe controller. The mapping table is stored in the EL2 page table of the jailhouse.

[0099] In addition, the present application does not limit the specific implementation method of establishing the address relationship mapping table of the configuration address space of the PCI / PCIe controller. In addition to the two address relationship mapping table establishment methods provided above, the present application can also use other methods to establish the address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse.

[0100] S2: Configure the MSI / MSIX capability table entry of the PCI device or PCIe device according to the address relationship mapping table.

[0101] In the embodiment of the present application, through step S1, the jailhouse can access the configuration address space of the PCI / PCIe controller. In order to enable the jailhouse to have the ability to process the MSI / MSIX interrupts generated by the PCI / PCIe device, it is necessary to configure the MSI / MSIX capability table entry of the PCI / PCIe device connected to the PCI / PCIe controller, so that the PCI / PCIe controller can send the MSI / MSIX interrupts generated by the PCI device or PCIe device to the interrupt controller according to the MSI / MSIX capability table entry.

[0102] In an optional implementation, Figure 3 As shown, the above step S2 may include the following contents:

[0103] Step B1: Access the configuration address space of the PCI / PCIe controller according to the address relationship mapping table.

[0104] Step B2: Determine the MSI / MSIX capability table entry from the capability table of the PCI device or PCIe device.

[0105] Step B3: Configure the MSI / MSIX capability table entry according to the base address of the interrupt controller.

[0106] In the embodiment of the present application, the configuration address space of the PCI / PCIe controller stores a capability table of the PCI device or PCIe device connected to the PCI / PCIe controller, and the MSI / MSIX capability table item is one of the table items in the capability table item. After determining the MSI / MSIX capability table item, the base address of the interrupt controller is configured into the MSI / MSIX capability table item, so that after the MSI / MSIX interrupt sent by the PCI device or PCIe device reaches the PCI / PCIe controller, the PCI / PCIe controller can forward the MSI / MSIX interrupt to the interrupt controller according to the base address of the interrupt controller in the MSI / MSIX capability table item.

[0107] The above steps B1-B4 are described below with reference to specific examples.

[0108] In the above step B1, access to the configuration address space of the PCI / PCIe controller can be achieved according to the address relationship mapping table determined in step S1. The specific access method can refer to the above description of step S1, which will not be repeated here to make the description concise.

[0109] In the above step B2, the capability table of the PCI device or PCIe device is scanned according to the MSI / MSIX capability ID: 0x05 to determine the offset value of the MSI / MSIX capability table entry.

[0110] For example, the description field of the MSI / MSIX capability table entry includes: message address 1, message address 2, and message data. The offset value of message address 1 is 8 bytes, the offset value of message address 2 is 16 bytes, and the offset value of message data is 24 bytes.

[0111] The above step B3 may include:

[0112] Step B31: Write the first 32 bits of the base address of the interrupt translation service register of the interrupt controller into the first field of the MSI / MSIX capability table entry.

[0113] Step B32: Write the last 32 bits of the base address of the interrupt translation service register of the interrupt controller into the second field of the MSI / MSIX capability table entry.

[0114] Step B33: Write the event number of the MSI / MSIX interrupt into the third field of the MSI / MSIX capability table entry.

[0115] In the embodiment of the present application, since the MSI / MSIX interrupt generated by the PCI / PCIe device cannot be directly recognized by the CPU, it is necessary to convert the MSI / MSIX interrupt into an LPI interrupt through the Interrupt Translation Service (ITS) in the interrupt controller. Therefore, after receiving the MSI / MSIX interrupt generated by the PCI / PCIe device, the PCI / PCIe controller sends the MSI / MSIX interrupt to the interrupt translation service register of the interrupt controller. The base address of the interrupt translation service register of the interrupt controller is usually 64 bits. In order to achieve forwarding, the first 32 bits of the base address of the interrupt translation service register are written to the first field in the MSI / MSIX capability table item (i.e., the aforementioned message address 1), and the last 32 bits of the base address of the interrupt translation service register are written to the second field in the MSI / MSIX capability table item (i.e., the aforementioned message address 2).

[0116] Since a PCI device or PCIe device can send multiple MSI / MSIX interrupts, in this case, within the device scope, each MSI / MSIX interrupt needs to be software numbered, and this number is called event ID (EventID) in ITS. Whenever the PCI / PCIe controller receives an MSI / MSIX interrupt, it numbers it, determines the event ID, and writes the time ID into the third field of the MSI / MSIX capability table item (i.e. the aforementioned message data).

[0117] In the above manner, when a PCI device or PCIe device sends an MSI / MSIX interrupt, it is equivalent to sending a PCI / PCIE memory write transaction, that is, sending message data to the message address. When the PCI / PCIE controller receives this memory write transaction, it will consider that the device is sending an interrupt event to distinguish it from ordinary memory write transaction operations.

[0118] Since the MSI / MSIX capability table entry contains the base address of the interrupt translation service register of the interrupt controller, the PCI / PCIE controller will send the MSI / MSIX interrupt to the ITS module of the interrupt controller, so that the ITS module will call the MSI / MSIX message interrupt as an LPI interrupt.

[0119] S3: Configure the interrupt translation service driver in the jailhouse.

[0120] In an embodiment of the present application, through step S1 and step S2, when a PCI device or a PCIe device generates an MSI / MSIX interrupt and sends the MSI / MSIX interrupt to a PCI / PCIE controller, the PCI / PCIE controller sends the MSI / MSIX interrupt to the interrupt controller according to the MSI / MSIX capability table entry.

[0121] Since the MSI / MSIX interrupts generated by PCI / PCIe devices cannot be directly recognized by the CPU, the MSI / MSIX interrupts need to be converted to LPI interrupts through the ITS module in the interrupt controller. Therefore, it is necessary to configure an interrupt translation service driver in the jailhouse. The interrupt translation service driver is used to control the ITS module in the interrupt controller and convert the MSI / MSIX interrupt information received by the PCI / PCIE controller into the LPI interrupt type of the interrupt controller. The converted LPI interrupt is further routed to the redistributor of the interrupt controller, which sends the MSI / MSIX interrupt to the interrupt pin of the CPU.

[0122] Specifically, the above step S3 may include: establishing a mapping relationship between the device table, the interrupt conversion table and the Collection table through an interrupt translation service command, so that the interrupt translation service driver can translate the MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin according to the device table, the interrupt conversion table and the Collection table.

[0123] The device table (DT) stores the mapping relationship between the device ID (DeviceID) and the physical address of the interrupt translation table (ITT).

[0124] The interrupt conversion table stores the mapping relationship between the event ID (EventID) and the physical address of the Collection table (Collection table, CT).

[0125] The Collection table stores the mapping relationship between the LPI physical interrupt number (LPI) and the target CPU number (targetPE) and the redistributor number (target Redistributor) to which the LPI needs to be routed.

[0126] The interrupt translation service driver controls the ITS module to parse the EventID in the MSI / MSIX interrupt information after receiving the MSI / MSIX interrupt information sent by the PCI / PCIE controller. According to the EventID and the device table, the interrupt conversion table and the Collection table, the translation conversion of the MSI / MSIX interrupt to the LPI interrupt is realized, that is, the mapping relationship of the ternary (DeviceID, EventID, LPI) to the binary (target Redistributor, taget PE) is established, so as to route the converted LPI interrupt to the corresponding target redistributor, and then the target redistributor sends the LPI interrupt to the interrupt pin of the target CPU.

[0127] S4: Register the MSI / MSIX interrupt vector in the CPU's exception vector table.

[0128] In the embodiment of the present application, there are 4 exception levels in the CPU hardware, namely EL0, EL1, EL2, and EL3, and the CPU is always in one of the exception levels when it is running. Each exception level has 4 exception vector types, which are synchronization vector, system vector, interrupt vector, and fast interrupt vector. The exception vector table required by the hardware has 4 table entries, corresponding to 4 exception vector types respectively, and 4 exception levels and 4 exception vector types are cross-combined to form 16 exception types. The exception vector table is stored in a specific memory location, and the physical address of the memory location is stored in the CPU hardware vector base address register (Vector BaseAddress Register, VBAR). The table entry of the exception vector table stores the function code that needs to be executed when a certain exception type occurs in the CPU (when the exception vector type is an interrupt, it can also be called an interrupt processing function). In the processing flow of the CPU, after the CPU receives an interrupt, it determines the function code corresponding to the interrupt according to the exception vector table, and jumps to the exception vector of the interrupt type to execute the corresponding interrupt processing function. The MSI / MSIX interrupt sent by the PCI / PCIE device is converted into an LPI interrupt by the ITS module, and the CPU receives the LPI interrupt vector. Since the LPI interrupt vector corresponds to the MSI / MSIX interrupt sent by the PCI / PCIE device, it is necessary to register the MSI / MSIX interrupt vector in the CPU's exception vector table.

[0129] Through the above steps S1-S3, the MSI / MSIX interrupt generated by the PCI device or PCIe device is converted into an LPI interrupt and sent to the interrupt pin of the CPU. After the CPU receives the LPI interrupt sent by the interrupt controller, it jumps to the exception vector of the LPI interrupt to execute the interrupt processing function of the MSI / MSIX device, so that the jailhouse has the ability to handle the MSI / MSIX interrupt generated by the PCI / PCIe device.

[0130] In an optional implementation manner, the above step S3 may include: establishing an exception vector table; writing a base address of the exception vector table into a vector base address register; and writing an MSI / MSIX interrupt vector into the exception vector table.

[0131] In the embodiment of the present application, an exception vector table is established, and the base address of the exception vector table is written into VBAR, so that the CPU can query the exception vector table by accessing VBAR. The MSI / MSIX interrupt vector is written into the position corresponding to the LPI interrupt vector in the exception vector table.

[0132] The LPI interrupt vector is an entry in the exception vector table. This entry stores the function code that needs to be executed when the CPU jumps to this location after an LPI interrupt exception occurs. The function code placed here by this application is the MSI / MSIX interrupt processing function.

[0133] As the virtual machine management program code, jaihouse hardware requires that the exception level when the CPU executes the code must be EL2, so this application needs to establish the exception vector table of CPU EL2. At the same time, it is also necessary to write the MSI / MSIX interrupt processing function (Note: This process is also called registering interrupt Handle in software) at the LPI interrupt vector table entry position of the exception vector table, so that when the CPU receives the MSI / MSIX interrupt of the PCIE device, it can execute the processing function corresponding to the interrupt.

[0134] The embodiment of the present application also provides a device for implementing MSI / MSIX interruption in a jailhouse, such as Figure 4 As shown, the device 200 for implementing MSI / MSIX interruption in jailhouse includes:

[0135] A mapping module 201 is used to establish an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse, so that the jailhouse can access the configuration address space of the PCI / PCIe controller; wherein the address relationship mapping table represents the mapping relationship between the virtual address and the physical address of the configuration address space of the PCI / PCIe controller;

[0136] A configuration module 202 is used to configure an MSI / MSIX capability table entry of a PCI device or a PCIe device according to the address relationship mapping table, so that the PCI / PCIe controller can send an MSI / MSIX interrupt generated by the PCI device or the PCIe device to an interrupt controller according to the MSI / MSIX capability table entry; an interrupt translation service driver is configured in the jailhouse; wherein the interrupt translation service driver is used to control the interrupt controller to translate the received MSI / MSIX interrupt into an LPI interrupt and send it to a CPU pin;

[0137] The registration module 203 is used to register the MSI / MSIX interrupt vector in the exception vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving the LPI interrupt sent by the interrupt controller.

[0138] In an optional implementation manner, the mapping module 201 is specifically used to establish an L0 page table, an L1 page table and an L2 page table in the EL2 page table of the jailhouse; establish an address mapping relationship of the virtual address base of the configuration address space of the PCI / PCIe controller from the L0 page table to the L2 page table, and establish an address mapping relationship of the virtual address base of the configuration address space of the PCI / PCIe controller from the L1 page table to the L2 page table; and save the physical address of the configuration address space of the PCI / PCIe controller in the L2 page table.

[0139] In an optional implementation manner, the mapping module 201 is further configured to save the virtual address and the physical address of the configuration address space of the PCI / PCIe controller into an address translation look-aside buffer of a memory management unit.

[0140] In an optional implementation, the configuration module 202 is specifically used to access the configuration address space of the PCI / PCIe controller according to the address relationship mapping table; determine the MSI / MSIX capability table entry from the capability table of the PCI device or PCIe device; and configure the MSI / MSIX capability table entry according to the base address of the interrupt controller.

[0141] In an optional implementation, the configuration module 202 is specifically used to write the first 32 bits of the base address of the interrupt translation service register of the interrupt controller into the first field of the MSI / MSIX capability table item; write the last 32 bits of the base address of the interrupt translation service register of the interrupt controller into the second field of the MSI / MSIX capability table item; and write the event number of the MSI / MSIX interrupt into the third field of the MSI / MSIX capability table item.

[0142] In an optional implementation, the configuration module 202 is specifically used to establish a mapping relationship between the device table, the interrupt conversion table and the Collection table through an interrupt translation service command, so that the interrupt translation service driver can translate the MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin according to the device table, the interrupt conversion table and the Collection table.

[0143] In an optional implementation manner, the registration module 203 is specifically used to establish an exception vector table; write the base address of the exception vector table into a vector base address register; and write the MSI / MSIX interrupt vector into the exception vector table.

[0144] See also Figure 5 , Figure 5This is a schematic diagram of the structure of an electronic device of an embodiment of the present application. The electronic device 300 includes: at least one processor 301, at least one communication interface 302, at least one memory 303 and at least one bus 304. Among them, the bus 304 is used to realize the direct connection and communication of these components, the communication interface 302 is used to communicate signaling or data with other node devices, and the memory 303 stores machine-readable instructions executable by the processor 301. When the electronic device 300 is running, the processor 301 communicates with the memory 303 through the bus 304, and the machine-readable instructions are executed when the processor 301 calls the method for realizing MSI / MSIX interruption in the jailhouse as described above.

[0145] The processor 301 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 301 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0146] The memory 303 may include but is not limited to random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.

[0147] Understandably, Figure 5 The structure shown is for illustration only. The electronic device 300 may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown. Figure 5 Each component shown in can be implemented by hardware, software or a combination thereof. In the embodiment of the present application, the electronic device 300 can be, but is not limited to, a physical device such as a desktop computer, a laptop computer, a smart phone, a smart wearable device, a vehicle-mounted device, etc., and can also be a virtual device such as a virtual machine. In addition, the electronic device 300 is not necessarily a single device, but can also be a combination of multiple devices, such as a server cluster, etc.

[0148] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computer, the steps of the method for implementing MSI / MSIX interruption in a jailhouse in the above embodiment are executed.

[0149] The method for implementing MSI / MSIX interruption in a jailhouse provided in the embodiment of the present application has the same implementation principle and technical effects as those in the aforementioned terminal device embodiment. For the sake of brief description, for matters not mentioned in the method embodiment, reference may be made to the corresponding contents in the aforementioned terminal device embodiment.

[0150] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0152] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method to implement MSI / MSIX interruption in jailhouse, It is characterized in that include: Establishing an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse, so that the jailhouse can access the configuration address space of the PCI / PCIe controller; wherein the address relationship mapping table represents the mapping relationship between the virtual address and the physical address of the configuration address space of the PCI / PCIe controller; Configuring an MSI / MSIX capability table entry of a PCI device or a PCIe device according to the address relationship mapping table, so that the PCI / PCIe controller can send an MSI / MSIX interrupt generated by the PCI device or the PCIe device to an interrupt controller according to the MSI / MSIX capability table entry; An interrupt translation service driver is configured in the jailhouse; wherein the interrupt translation service driver is used to control the interrupt controller to translate the received MSI / MSIX interrupt into an LPI interrupt and send it to the CPU pin; The MSI / MSIX interrupt vector is registered in the exception vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving the LPI interrupt sent by the interrupt controller.

2. The method for implementing MSI / MSIX interruption in jailhouse according to claim 1, It is characterized in that The address relationship mapping table of the configuration address space of the PCI / PCIe controller is established in the EL2 page table of the jailhouse, including: Create L0 page table, L1 page table and L2 page table in the jailhouse's EL2 page table; Establishing an address mapping relationship of a virtual address base of a configuration address space of the PCI / PCIe controller from the L0 page table to the L2 page table, and establishing an address mapping relationship of a virtual address base of a configuration address space of the PCI / PCIe controller from the L1 page table to the L2 page table; The physical address of the configuration address space of the PCI / PCIe controller is stored in the L2 page table.

3. The method for implementing MSI / MSIX interruption in jailhouse according to claim 2, It is characterized in that The step of establishing an address relationship mapping table of the configuration address space of the PCI / PCIe controller in the EL2 page table of the jailhouse further includes: The virtual address and the physical address of the configuration address space of the PCI / PCIe controller are saved in the address translation look-aside buffer of the memory management unit.

4. The method for implementing MSI / MSIX interruption in jailhouse according to claim 1, It is characterized in that The configuration address space of the PCI / PCIe controller stores a capability table of the PCI device or PCIe device, and the MSI / MSIX capability table item of the PCI device or PCIe device is configured according to the address relationship mapping table, including: Accessing the configuration address space of the PCI / PCIe controller according to the address relationship mapping table; Determine an MSI / MSIX capability table entry from a capability table of the PCI device or PCIe device; The MSI / MSIX capability table entry is configured according to the base address of the interrupt controller.

5. The method for implementing MSI / MSIX interruption in jailhouse according to claim 4, It is characterized in that The configuring the MSI / MSIX capability table entry according to the base address of the interrupt controller includes: Writing the first 32 bits of the base address of the interrupt translation service register of the interrupt controller into the first field of the MSI / MSIX capability table entry; Writing the last 32 bits of the base address of the interrupt translation service register of the interrupt controller into the second field of the MSI / MSIX capability table entry; The event number of the MSI / MSIX interrupt is written into the third field of the MSI / MSIX capability table entry.

6. The method for implementing MSI / MSIX interruption in jailhouse according to claim 1, It is characterized in that The configuration of the interrupt translation service driver in the jailhouse includes: The mapping relationship between the device table, the interrupt conversion table and the Collection table is established through the interrupt translation service command, so that the interrupt translation service driver can translate the MSI / MSIX interrupt into the LPI interrupt and send it to the CPU pin according to the device table, the interrupt conversion table and the Collection table.

7. The method for implementing MSI / MSIX interruption in jailhouse according to claim 1, It is characterized in that The registering of the MSI / MSIX interrupt vector in the CPU exception vector table includes: Establish an exception vector table; Writing the base address of the exception vector table into a vector base address register; The MSI / MSIX interrupt vector is written into the exception vector table.

8. A device for implementing MSI / MSIX interruption in a jailhouse, It is characterized in that include: A mapping module, configured to establish an address relationship mapping table of a configuration address space of a PCI / PCIe controller in an EL2 page table of a jailhouse, so that the jailhouse can access the configuration address space of the PCI / PCIe controller; wherein the address relationship mapping table represents a mapping relationship between a virtual address and a physical address of the configuration address space of the PCI / PCIe controller; A configuration module, configured to configure an MSI / MSIX capability table entry of a PCI device or a PCIe device according to the address relationship mapping table, so that the PCI / PCIe controller can send an MSI / MSIX interrupt generated by the PCI device or the PCIe device to an interrupt controller according to the MSI / MSIX capability table entry; and configure an interrupt translation service driver in the jailhouse; wherein the interrupt translation service driver is used to control the interrupt controller to translate a received MSI / MSIX interrupt into an LPI interrupt and send the LPI interrupt to a CPU pin; The registration module is used to register the MSI / MSIX interrupt vector in the exception vector table of the CPU, so that the CPU executes the MSI / MSIX interrupt vector after receiving the LPI interrupt sent by the interrupt controller.

9. An electronic device, It is characterized in that include: processor, memory, and bus; The processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 7 by calling the program instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a computer, the method according to any one of claims 1 to 7 is executed.

Citation Information

Cited By

  • Virtualization system interrupt processing optimization method and device, equipment and medium

    CN122086529A

  • MSI address translation simulation system and method

    CN122113780A

  • MSI Address Translation Simulation System and Method

    CN122113780B