Virtualization processing method and device for message interruption and storage medium
By assigning a fixed interrupt identifier to each message interrupt and configuring the ITS component of the interrupt controller, the interrupt latency problem caused by hardware dependency is solved, achieving efficient message interrupt processing and security level isolation, thereby improving the performance and security of the vehicle operating system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZEBRED NETWORK TECH CO LTD
- Filing Date
- 2022-03-07
- Publication Date
- 2026-06-19
AI Technical Summary
In HyperVisior virtualization technology, hardware-based interrupt pass-through clients rely on hardware support, which increases interrupt handling latency and results in low security when running application software with different security levels on the in-vehicle operating system.
By assigning a fixed interrupt identifier to each message interrupt through the virtual machine manager and configuring the ITS component of the interrupt controller, interrupt handling can be managed uniformly, reducing dependence on hardware and enabling message interrupts to pass through the virtual machine.
It reduces message interruption processing latency, improves the processing efficiency of the in-vehicle operating system, and enables the isolated operation of application software with different security levels, thereby improving vehicle safety.
Smart Images

Figure CN114610444B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more particularly to a virtualization processing method, apparatus, and storage medium for message interruption. Background Technology
[0002] Hypervisor virtualization technology, as a core underlying IT technology, uses a hypervisor (virtual machine manager) to simulate a computer system with complete hardware system functionality, running in a completely isolated environment. When hypervisor virtualization technology is introduced into AOS (Automotive Operating System), it eliminates the need to design multiple hardware components to meet the different functional requirements of a car. Instead, virtualization software configuration is performed on the main automotive chip, creating multiple virtual machines. Each virtual machine runs the corresponding application software to meet the requirements, thus reducing vehicle costs. Furthermore, different security levels of application software need to run on the automotive operating system. For example, entertainment navigation voice systems and ADA (Active Drive Assist) systems have different security levels. Running them under the same system would compromise vehicle safety. This can be addressed by creating multiple virtual machines to run applications with different security levels.
[0003] In solutions utilizing HyperVisior technology to achieve secure isolation between multiple virtual machines on an in-vehicle operating system, most rely on interrupt injection via the virtual machine manager or on hardware-based interrupt pass-through guest OS. When using a hardware-based interrupt pass-through guest OS, it depends on the hardware itself supporting interrupt pass-through. When using message interrupt injection, the corresponding physical message interrupt needs to be identified and simulated in the virtual machine manager, causing delays in interrupt processing. Summary of the Invention
[0004] Given that existing technologies rely on hardware support for direct client communication with terminals, this invention provides a virtualization processing method, system, and storage medium for message interruption.
[0005] In a first aspect, embodiments of the present invention provide a virtualization processing method for message interruption, comprising: assigning a fixed interrupt identifier to each message interruption by a virtual machine manager, and configuring the ITS component of the interrupt controller according to the interrupt identifier of each message interruption; taking each virtual machine created by the virtual machine manager as a target virtual machine, and configuring the interrupt identifiers of M message interrupts into the configuration file of the target virtual machine by the virtual machine manager, wherein the M message interrupts belong to the target virtual machine; when the target virtual machine starts, parsing the interrupt identifiers of the M message interrupts from the configuration file of the target virtual machine, and registering corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts.
[0006] Optionally, before the virtual machine manager assigns a fixed interrupt identifier to each message interrupt, the method further includes: the virtual machine manager obtaining the device identifier of each peripheral from its configuration file, and obtaining the message interrupt used by the corresponding peripheral based on the device identifier; wherein the configuration file of the virtual machine manager defines attribute information for each message interrupt, and the attribute information of the message interrupt includes the device identifier of the peripheral using the message interrupt.
[0007] Optionally, the virtual machine manager assigns a fixed interrupt identifier to each message interrupt, including: treating each peripheral as a target peripheral, and assigning a fixed interrupt identifier segment to the target peripheral by the virtual machine manager, wherein each interrupt identifier in the interrupt identifier segment is used to identify each message interrupt used by the target peripheral in a one-to-one correspondence.
[0008] Optionally, the virtual machine manager assigns a fixed interrupt identifier segment to the target peripheral device, including: after each startup of the virtual machine manager, the virtual machine manager assigns an interrupt identifier segment to the target peripheral device using the same preset identifier allocation rule, so that the interrupt identifier segment assigned to the target peripheral device is fixed.
[0009] Optionally, the virtual machine manager assigns interrupt identifier segments to the target peripheral using the same preset identifier allocation rule, including: after each startup of the virtual machine manager, the virtual machine manager determines the number of interrupt identifiers required by the target peripheral based on the message interrupts used by the target peripheral; and the virtual machine manager assigns corresponding interrupt identifier segments to the target peripheral based on the identifier allocation rule and the number of interrupt identifiers.
[0010] Optionally, the attribute information of the message interrupt also includes the physical CPU bound to the message interrupt. After obtaining the message interrupt used by the corresponding peripheral based on the device identifier, the method further includes: the virtual machine manager obtaining the binding relationship between each message interrupt and the physical CPU from the configuration file of the virtual machine manager; and for each message interrupt, the virtual machine manager configuring the routing of the message interrupt based on the binding relationship between the message interrupt and the physical CPU.
[0011] Optionally, configuring the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt includes: the virtual machine manager creating multiple global ITS tables for the ITS component of the interrupt controller, wherein the multiple global ITS tables include an interrupt mapping table; the virtual machine manager configuring the interrupt identifier of each message interrupt into the interrupt mapping table; and ignoring the ITS table configuration of the ITS component when the target virtual machine starts.
[0012] Optionally, the virtual machine manager configures the interrupt identifiers of the M message interrupts into the configuration file of the target virtual machine, including: the virtual machine manager determining the M message interrupts belonging to the target virtual machine; and for each of the M message interrupts, configuring the interrupt identifier of that message interrupt into the configuration file of the target virtual machine.
[0013] Secondly, embodiments of the present invention provide a virtualization processing apparatus for message interruption, comprising: a virtual machine manager and multiple virtual machines; the virtual machine manager comprising: an identifier allocation unit, configured to assign a fixed interrupt identifier to each message interruption; a first configuration unit, configured to configure the ITS component of the interrupt controller according to the interrupt identifier of each message interruption; a second configuration unit, configured to configure the interrupt identifiers of M message interrupts into the configuration file of each virtual machine created by the virtual machine manager as a target virtual machine, wherein the M message interrupts belong to the target virtual machine; the target virtual machine comprising: a parsing unit, configured to parse the interrupt identifiers of the M message interrupts from the configuration file of the target virtual machine when the target virtual machine starts; and a registration unit, configured to register corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts.
[0014] Thirdly, embodiments of the present invention provide a physical node, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any embodiment of the first aspect.
[0015] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the first embodiments.
[0016] The embodiments of the present invention provide one or more technical solutions that achieve at least the following technical effects: By assigning a fixed interrupt identifier to each message interrupt through the virtual machine manager, configuring the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt, and configuring the fixed interrupt identifier in the configuration file of the target virtual machine to which the message interrupt belongs, the target virtual machine can parse the interrupt identifiers of M message interrupts belonging to the target virtual machine from its own configuration file when it starts up, and register the corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts. This realizes that message interrupts generated by peripherals are passed through to the virtual machine, and the virtual machine only needs to execute the corresponding interrupt handler according to the fixed interrupt identifier to accurately respond to the corresponding message interrupt, thereby reducing the delay of message interrupts and eliminating the need for hardware support. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a system architecture diagram of the virtualization processing method for message interruption implemented in an embodiment of the present invention;
[0019] Figure 2 This is a flowchart of the virtualization processing method for message interruption in an embodiment of the present invention;
[0020] Figure 3 This is a virtualized processing device for message interruption in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of a physical node in an embodiment of the present invention. Detailed Implementation
[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0023] First, it should be clarified that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0024] Firstly, embodiments of the present invention provide a virtualization processing method for message interruption, applied to a physical node (a physical machine) configured with a virtual machine monitor (VMM), also known as a Safety Hypervisor. Through the virtual machine monitor running on the physical node, multiple independent virtual machines (VMs) can be created on the physical node. These virtual machines are also called instances, guest operating systems, or virtual domains.
[0025] The virtualization processing method for message interruption provided in this embodiment of the invention can be based on, for example, Figure 1 The system architecture implementation of the physical nodes is shown. (Reference) Figure 1 As shown, the system architecture includes: a Generic Interrupt Controller (GIC), a virtual machine manager, and multiple virtual machines created by the virtual machine manager. The interrupt controller is a hardware component of the physical node. It includes an ITS (Interrupt Translation Service) component shared by all virtual machines. The ITS component is responsible for receiving interrupt signals from peripherals, parsing and processing them, and forwarding them to the corresponding redistributor. The redistributor then distributes the interrupt signals to the CPU interface of the corresponding CPU. These interrupt signals include message interrupts such as LPI (Locality-specific Peripheral Interrupt, a message-based edge interrupt).
[0026] This invention provides a virtualization processing method for message interrupts, enabling message interrupts generated by peripherals to pass through the virtual machine. This reduces the dependence of the message interrupt pass-through virtual machine on the hardware itself and reduces the processing latency of message interrupts. (Reference) Figure 2 As shown, the virtualization processing method for message interruption provided in this embodiment of the invention includes the following steps S201 to S203:
[0027] S201. The virtual machine manager assigns a fixed interrupt identifier to each message interrupt and configures the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt.
[0028] It should be understood that a physical node needs to use multiple peripherals, and each peripheral may use one or more message interrupts. Based on this, in step S101, the virtual machine manager assigns a fixed interrupt identifier to each message interrupt, specifically including: designating each peripheral as a target peripheral; and the virtual machine manager assigning a fixed interrupt identifier segment to the target peripheral, wherein each interrupt identifier in the interrupt identifier segment is used to identify each message interrupt used by the target peripheral in a one-to-one correspondence.
[0029] To ensure that the interrupt identifier segment allocated to each peripheral is fixed, and thus the interrupt identifier corresponding to each message interrupt is fixed, the same preset identifier allocation rule is used to allocate the corresponding interrupt identifier segment to each peripheral every time the virtual machine manager starts.
[0030] Understandably, the virtual machine manager assigns a numeric interrupt number as the interrupt identifier to each message interrupt. Based on this, the default identifier allocation rule can be: each time the virtual machine manager starts, it assigns a corresponding interrupt number segment to each peripheral device according to the interrupt number from smallest to largest, or sequentially from largest to smallest, to ensure that the interrupt number segment assigned to each peripheral device is fixed each time and will not change due to different startup times.
[0031] Specifically, the number of interrupt flags contained in the interrupt flag segment corresponding to the target peripheral is determined by the number of message interrupts required by the target peripheral. That is, the number of interrupt flags contained in the interrupt flag segment allocated to the target peripheral is the same as the number of message interrupts used by the target peripheral. Each time the virtual machine manager starts, it determines the number of interrupt flags required by the target peripheral based on the message interrupts used by the target peripheral; then, the virtual machine manager allocates the corresponding interrupt flag segment to the target peripheral according to the flag allocation rules and the number of interrupt flags.
[0032] For example, if the target peripheral needs to use 100 message interrupts, the virtual machine manager will assign 100 fixed interrupt identifiers to the target peripheral to identify the 100 message interrupts that the target peripheral needs to use.
[0033] Taking LPI type message interrupts as an example, assuming the entire available interrupt number range is 8192 to 10000, that is, the minimum available interrupt number for LPI interrupts is 8192 and the maximum available interrupt number is 10000. If the interrupt number range is allocated sequentially to the K peripherals ID1 to IDk according to the interrupt number from smallest to largest, and the peripheral identified by device ID1 needs to use 100 interrupt numbers, and another peripheral identified by device ID2 needs to use 90 interrupt numbers, then the 100 interrupt numbers from 8192 to 8291 are allocated to device ID1 for use, to identify the 100 message interrupts used by device ID1, and the 90 interrupt numbers from 8292 to 8382 are allocated to device ID2 for use, to identify the 90 message interrupts used by device ID2, and so on.
[0034] Understandably, to obtain the message interrupts used by each peripheral, the attribute information of each message interrupt is statically defined in the virtual machine manager's configuration file. The attribute information of each message interrupt includes at least the device identifier of the peripheral using that message interrupt, such as the peripheral's device ID (Identity document). The device ID indicates which peripheral initiated the message interrupt. Therefore, each time the virtual machine manager starts running, it retrieves the device identifier of each peripheral from its configuration file and, based on that device identifier, retrieves the corresponding message interrupt used by that peripheral from the virtual machine manager's configuration file.
[0035] Since a peripheral device may use one or more message interrupts, in the virtual machine manager's configuration file, a device identifier corresponds to one or more message interrupts, and the interrupt type of each peripheral device's message interrupt can be an LPI interrupt. For example, each device ID can be obtained from the virtual machine manager's configuration file: device ID1, device ID2, device ID3... device ID... K And using each obtained device ID as an index, the system finds the corresponding message interrupt for each device ID in the virtual machine manager's configuration file.
[0036] Through the above step S201, when the virtual machine manager starts, a fixed interrupt identifier is uniformly assigned to each message interrupt used by each peripheral by the virtual machine manager. This prevents the same message interrupt from being assigned different interrupt identifiers under different startup times of the virtual machine manager, thus solving the problem of inconsistent LPI interrupt numbers for each device.
[0037] To reduce the processing complexity of virtual machines, the ITS component of the interrupt controller can be configured by the already running virtual machine manager before the virtual machine starts, based on the interrupt identifier of each message interrupt:
[0038] Specifically, configuring the ITS component involves the following steps: The virtual machine manager creates multiple global ITS tables for the interrupt controller's ITS component. These global ITS tables are shared by all virtual machines, and each global ITS table includes an interrupt mapping table. The virtual machine manager configures the interrupt identifier for each message interrupt into the interrupt mapping table. When the target virtual machine starts, it ignores the configuration of the ITS component. Since the virtual machine manager has already initialized the ITS component, the target virtual machine does not configure it again after startup, preventing the target virtual machine from overwriting the virtual machine manager's previous initialization configuration. If the target virtual machine modifies the ITS component configuration after startup, the virtual machine manager intercepts the target virtual machine's configuration of the ITS component.
[0039] The global ITS tables created by the virtual machine manager include: Device Table, Interrupt Translation Tables, and Collection Table. The configuration of each global ITS table is as follows:
[0040] 1. Device Table: Maps device IDs to interrupt translation tables. Specifically, any device ID can be used to select the entry in the device table indexed by that device ID, and the location of the interrupt mapping table can be obtained from that entry.
[0041] 2. Interrupt Mapping Table: Maps event IDs (representing the event type of an interrupt sent by a peripheral device) to their corresponding interrupt numbers and the collection number to which that interrupt number belongs. Specifically, any event ID can be used to select the entry in the interrupt mapping table indexed by that event ID. This entry includes the interrupt number corresponding to the event ID and the collection number to which the interrupt belongs.
[0042] 3. Collection table: Maps collection numbers to redistributors. Using any collection number, you can select the redistributor with the index of that collection number from the collection table.
[0043] After startup, the virtual machine manager configures the various global ITS tables of the ITS component based on the interrupt identifier assigned to each message interrupt. This enables the shared use of the ITS component across multiple virtual machines, thus solving the problem of sharing the ITS component among multiple virtual machines. Furthermore, the enabling and interrupt number configuration of message interrupts are uniformly managed by the virtual machine manager, simplifying the complexity of virtual machine processing.
[0044] After step S201, step S202 is executed: each virtual machine created by the virtual machine manager is taken as the target virtual machine, and the virtual machine manager configures the interrupt identifiers of M message interrupts into the configuration file of the target virtual machine. All M message interrupts belong to the target virtual machine.
[0045] Where M is an integer greater than 1, and the specific value is determined based on the total number of message interrupts to be used by the peripheral device. No specific value is limited here.
[0046] Understandably, after each startup of the virtual machine manager, for the M message interrupts belonging to the same virtual machine, the interrupt identifiers assigned to the M message interrupts are configured in the configuration file of that virtual machine.
[0047] It should be noted that the number of message interrupts for each virtual machine may vary, depending on the actual message interrupt configuration, which will not be elaborated here.
[0048] For example, the virtual machine manager creates three virtual machines: VM1, VM2, and VM3. VM1 has 100 message interrupts for device ID1; VM2 has 20 message interrupts for device ID2; and VM3 has 50 message interrupts for device ID3. The interrupt numbers 8192–8291 assigned to the 100 message interrupts of VM1 are configured in the VM1 configuration file. The interrupt numbers 8292–8311 assigned to the 20 message interrupts of VM2 are configured in the VM2 configuration file. The interrupt numbers 8311–8360 assigned to the 50 message interrupts of VM3 are configured in the VM3 configuration file.
[0049] S203: When the target virtual machine starts, the target virtual machine parses the interrupt identifiers of M message interrupts from the target virtual machine's configuration file, and registers the corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts.
[0050] After the target virtual machine starts, the configuration file of the target virtual machine parses out the various interrupt identifiers belonging to the target virtual machine. For example, it parses out the 100 interrupt numbers 8192 to 8291 corresponding to device ID1. For each interrupt number in interrupt numbers 8192 to 8291, the corresponding interrupt handler is registered.
[0051] It should be understood that the routing of each message interrupt can also be configured uniformly by the virtual machine manager after it starts running but before the virtual machine starts running. In the virtual machine manager's configuration file, the attribute information of each message interrupt also includes the physical CPU bound to that message interrupt. The virtual machine manager obtains the binding relationship between each message interrupt and the physical CPU from its configuration file. For each message interrupt, the virtual machine manager configures the routing of that message interrupt based on the binding relationship between the message interrupt and the physical CPU. This routing configuration by the virtual machine manager allows the ITS component of the interrupt controller to determine which physical CPU should execute the message interrupt when it occurs.
[0052] By configuring a path for each message interrupt and assigning an interrupt identifier to each message interrupt during virtual machine manager startup, and configuring the ITS component of the interrupt controller and the virtual machine's configuration file according to the assigned interrupt identifier, when a peripheral device with a certain device ID initiates a message interrupt, the virtual machine to which the message interrupt belongs calls the interrupt handler based on the interrupt number corresponding to the message interrupt. The virtual machine uses the ITS component to obtain the interrupt number through a series of table lookups based on the device ID and event ID, and then uses the interrupt number to look up the table to obtain the physical CPU bound to the message interrupt, so as to execute the interrupt handler.
[0053] To run applications with different security levels on the in-vehicle operating system, hyperVisior creates multiple virtual machines within the system to run applications with different security levels. This isolates the runtime environments of applications with different security levels, thereby improving vehicle safety. The message interruption virtualization processing method provided in this embodiment can be applied to this scenario.
[0054] Specifically, according to ISO 26262 ASIL (Automotive Safety Integration Level), the safety levels of all electronic and electrical systems in a vehicle can be divided into five levels from low to high: QM (meaning not related to safety), A, B, C, and D. For example, entertainment and navigation systems belong to the QM level, with a virtual machine 1 created to run QM level applications such as entertainment and navigation; taillights belong to the A level, with a virtual machine 2 created to run A level applications such as taillight control; digital instrument clusters, headlights, and brake lights belong to the B level, with a virtual machine 3 created to run B level applications such as those controlling the digital instrument cluster, headlights, and brake lights; cruise control belongs to the C level, with a virtual machine 3 created for cruise control; and the autonomous driving system belongs to the D level, with a virtual machine 5 created to run the autonomous driving system.
[0055] Each time the vehicle OS system starts, it triggers the parsing of the attribute information of each message interrupt from the hyperVisior configuration file (the attribute information of the message interrupt includes: which device ID uses the message interrupt, which physical CPU the message interrupt is bound to, the trigger type of the message interrupt (rising edge trigger or falling edge trigger), etc.).
[0056] Next, the Hypervisor is started in the vehicle OS system. During the Hypervisor startup process, a fixed interrupt number is assigned to each message interrupt based on its attribute information, and the ITS component of the interrupt controller is configured according to the fixed interrupt number assigned to that message interrupt. The routing of each message interrupt is configured according to the binding relationship between the message interrupt and the physical CPU.
[0057] Next, the fixed interrupt number assigned to each message interrupt is configured in the configuration files of the corresponding virtual machines 1 to 5: the fixed interrupt number assigned to the message interrupt used by the entertainment navigation system is configured in the configuration file of virtual machine 1; the fixed interrupt number assigned to the message interrupt used by the taillights is configured in the configuration file of virtual machine 2; the fixed interrupt number assigned to the message interrupt used by the digital instrument panel, headlights and brake lights is configured in the configuration file of virtual machine 3; the fixed interrupt number assigned to the message interrupt used by the cruise control is configured in the configuration file of virtual machine 4; and the fixed interrupt number assigned to the message interrupt used by the automatic cruise system is configured in the configuration file of virtual machine 5.
[0058] Next, when the Hypervisor starts any of the virtual machines 1 through 5, the started virtual machine directly parses the fixed interrupt numbers configured in the previous step from its own configuration file during the startup process, and registers the corresponding interrupt handlers for each fixed interrupt number. It should be understood that virtual machines 1 through 5 can be running simultaneously. For example, during the startup process of virtual machine 5, virtual machine 5 parses the various fixed interrupt numbers configured in its configuration file and registers the corresponding interrupt handlers for each of the parsed fixed interrupt numbers.
[0059] Next, the Hypervisor manages the running virtual machines 1-5: Based on the aforementioned configuration, when any peripheral device in the vehicle generates a message interrupt, the Hypervisor directly connects to the corresponding virtual machine based on the fixed interrupt number assigned to that message interrupt during startup. Therefore, the connected virtual machine is unaware of the message interrupt's existence; instead, it perceives the fixed interrupt generated by the fixed interrupt number. This allows the virtual machine to execute the corresponding interrupt handler based on the perceived fixed interrupt number, quickly responding to the message interrupt generated by that peripheral device.
[0060] As can be seen from the above embodiments, by applying the virtualization processing method for message interruption in the embodiments of the present invention to the vehicle OS system, message interruption pass-through to the virtual machine can be realized in the vehicle OS system, thereby reducing the processing latency of message interruptions generated by peripherals in the vehicle and simplifying the complexity of virtual machine OS processing interrupts, which is beneficial to improving the processing efficiency of the vehicle OS system.
[0061] Based on the same inventive concept, and referring to Figure 3 As shown, this embodiment of the invention provides a virtualization processing device for message interruption, including: a virtual machine manager 10 and multiple virtual machines 20; wherein, the virtual machine manager 10 includes: an identifier allocation unit 101, used to assign a fixed interrupt identifier to each message interrupt; a first configuration unit 102, used to configure the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt; a second configuration unit 103, used to configure the interrupt identifiers of M message interrupts into the configuration file of each virtual machine created by the virtual machine manager as a target virtual machine, wherein the M message interrupts belong to the target virtual machine; wherein, the target virtual machine 20 includes: a parsing unit 201, used to parse the interrupt identifiers of the M message interrupts from the configuration file of the target virtual machine when the target virtual machine starts; and a registration unit 201, used to register the corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts.
[0062] This is used to parse the interrupt identifiers of the M message interrupts from the configuration file of the target virtual machine when the target virtual machine starts, and register the corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts.
[0063] In some implementations, the virtual machine manager 10 further includes: a device identifier acquisition unit, configured to acquire the device identifier of each peripheral from the configuration file of the virtual machine manager; and a message interrupt acquisition unit, configured to acquire the message interrupt used by the corresponding peripheral based on the device identifier; wherein the configuration file of the virtual machine manager defines attribute information for each message interrupt, and the attribute information of the message interrupt includes the device identifier of the peripheral using the message interrupt.
[0064] In some implementations, the identifier allocation unit 101 is specifically used to: assign a fixed interrupt identifier segment to each peripheral as a target peripheral, wherein each interrupt identifier in the interrupt identifier segment is used to identify each message interrupt used by the target peripheral in a one-to-one correspondence.
[0065] In some implementations, the identifier allocation unit 101 is specifically used to: allocate an interrupt identifier segment to the target peripheral device using the same preset identifier allocation rule after each startup of the virtual machine manager, so that the interrupt identifier segment allocated to the target peripheral device is fixed.
[0066] In some implementations, the identifier allocation unit 101 is specifically used to: after each startup of the virtual machine manager, determine the number of interrupt identifiers required by the target peripheral based on the message interrupts used by the target peripheral; and allocate a corresponding interrupt identifier segment to the target peripheral based on the identifier allocation rules and the number of interrupt identifiers.
[0067] In some implementations, the attribute information of the message interrupt also includes the physical CPU to which the message interrupt is bound, and the virtual machine manager further includes: a binding relationship acquisition unit, used to acquire the binding relationship between each message interrupt and the physical CPU from the configuration file of the virtual machine manager; and a third configuration unit, used to: configure the routing of the message interrupt by the virtual machine manager according to the binding relationship between the message interrupt and the physical CPU for each message interrupt.
[0068] In some implementations, the first configuration unit 102 is specifically configured to: create multiple global ITS tables for the ITS component of the interrupt controller by the virtual machine manager, wherein the multiple global ITS tables include an interrupt mapping table; configure the interrupt identifier of each message interrupt to the interrupt mapping table by the virtual machine manager; and ignore the ITS table configuration of the ITS component when the target virtual machine starts.
[0069] In some implementations, the second configuration unit 103 is specifically used to: determine M message interrupts belonging to the target virtual machine by the virtual machine manager; and for each of the M message interrupts, configure the interrupt identifier of the message interrupt into the configuration file of the target virtual machine.
[0070] Thirdly, based on the same inventive concept, embodiments of the present invention provide a physical node, with reference to... Figure 4 As shown, it includes a memory 404, a processor 402, and a computer program stored in the memory 404 and executable on the processor 402. When the processor 402 executes the program, it implements the aforementioned virtualization processing method embodiment for message interruption.
[0071] Among them, Figure 4In this document, a bus architecture (represented by bus 400) is used. Bus 400 may include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 can be used to store data used by processor 402 during operation.
[0072] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned virtualization processing method embodiment for message interruption.
[0073] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0075] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0077] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0078] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A virtualization method for handling message interruptions, characterized in that, include: The virtual machine manager assigns a fixed interrupt identifier to each message interrupt, including: treating each peripheral as a target peripheral, and after each startup of the virtual machine manager, the virtual machine manager assigns an interrupt identifier segment to the target peripheral using the same preset identifier allocation rule, so that the interrupt identifier segment assigned to the target peripheral is fixed, including: at each startup of the virtual machine manager, assigning a corresponding interrupt number segment to each peripheral according to the interrupt number from smallest to largest or sequentially assigning a corresponding interrupt number segment to each peripheral from largest to smallest; Configure the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt, including: the virtual machine manager configuring the interrupt identifier of each message interrupt into the interrupt mapping table of the ITS component, wherein each message interrupt belongs to the LPI interrupt; Each virtual machine created by the virtual machine manager is taken as the target virtual machine. The virtual machine manager configures the interrupt identifiers of M message interrupts into the configuration file of the target virtual machine. The M message interrupts belong to the target virtual machine. When the target virtual machine starts, the target virtual machine parses the interrupt identifiers of the M message interrupts from the target virtual machine's configuration file, and registers the corresponding interrupt handlers according to the interrupt identifiers of the M message interrupts; When the target virtual machine starts, the ITS table configuration of the ITS component is ignored. If the target virtual machine modifies the configuration of the ITS component after startup, the virtual machine manager intercepts the target virtual machine's configuration of the ITS component.
2. The method of claim 1, wherein, Before the virtual machine manager assigns a fixed interrupt identifier to each message interrupt, the following is also included: The virtual machine manager obtains the device identifier of each peripheral from the configuration file of the virtual machine manager, and obtains the message interrupt used by the corresponding peripheral based on the device identifier; The configuration file of the virtual machine manager defines the attribute information for each message interrupt, including the device identifier of the peripheral that uses the message interrupt.
3. The method of claim 1, wherein, The virtual machine managers all use the same preset identifier allocation rule to allocate interrupt identifier segments to the target peripherals, including: After each startup of the virtual machine manager, the virtual machine manager determines the number of interrupt flags required by the target peripheral based on the message interrupts used by the target peripheral; The virtual machine manager allocates a corresponding interrupt identifier segment to the target peripheral device according to the identifier allocation rules and the number of interrupt identifiers.
4. The method of claim 2, wherein, The attribute information of the message interrupt also includes the physical CPU to which the message interrupt is bound. After obtaining the message interrupt used by the corresponding peripheral based on the device identifier, it also includes: The virtual machine manager obtains the binding relationship between each message interrupt and the physical CPU from the virtual machine manager's configuration file; For each message interrupt, the virtual machine manager configures the routing of the message interrupt according to the binding relationship between the message interrupt and the physical CPU.
5. The method of claim 1, wherein, The virtual machine manager configures the interrupt identifiers of M message interrupts into the configuration file of the target virtual machine, including: The virtual machine manager determines M message interrupts belonging to the target virtual machine; For each of the M message interrupts, the interrupt identifier of that message interrupt is configured in the configuration file of the target virtual machine.
6. A virtualization processing apparatus for message interruption, characterized in that, include: Virtual machine manager and multiple virtual machines; The virtual machine manager includes: The identifier allocation unit is used to assign a fixed interrupt identifier to each message interrupt, wherein each message interrupt belongs to the LPI interrupt. The unit includes: treating each peripheral as a target peripheral, and after each startup of the virtual machine manager, the virtual machine manager assigns an interrupt identifier segment to the target peripheral using the same preset identifier allocation rule, so that the interrupt identifier segment assigned to the target peripheral is fixed. This includes: when the virtual machine manager starts each time, assigning a corresponding interrupt number segment to each peripheral according to the interrupt number from smallest to largest or sequentially assigning a corresponding interrupt number segment to each peripheral from largest to smallest. The first configuration unit is used to configure the ITS component of the interrupt controller according to the interrupt identifier of each message interrupt, including: the virtual machine manager configuring the interrupt identifier of each message interrupt into the interrupt mapping table of the ITS component; when the target virtual machine starts, ignoring the ITS table configuration of the ITS component; if the target virtual machine modifies the configuration of the ITS component after startup, the virtual machine manager intercepts the target virtual machine's configuration of the ITS component. The second configuration unit is used to configure the interrupt identifiers of M message interrupts into the configuration file of each virtual machine created by the virtual machine manager as a target virtual machine, wherein the M message interrupts belong to the target virtual machine. The target virtual machine includes: The parsing unit is used to parse the interrupt identifiers of the M message interrupts from the configuration file of the target virtual machine when the target virtual machine starts. The registration unit is used to register the corresponding interrupt handler based on the interrupt identifier of the M message interrupts.
7. A physical node comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1-5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
PCI (Peripheral Component Interconnect) device INTx interruption delivery method for computer virtualization system
CN103984591A
Avirtualization interrupt transmission method and device based on KVM virtualization
CN109284178A
Interrupt management method and device, electronic equipment and computer storage medium
CN113391881A