Interrupt processing method, device, medium and equipment
By using simulated software interrupts to replace maintenance interrupts in virtualization technology, managing and processing interrupt information in the virtual machine monitor solves the problem of increased maintenance overhead and processing time caused by frequent interrupt events, and achieves more efficient interrupt management and processing efficiency.
Patent Information
- Application Number
- CN202210253496.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-03-15
AI Technical Summary
In virtualization technology, interrupt events occur frequently and cannot be processed in time, which results in an increase in the frequency of calls to maintain interrupts, increases the maintenance overhead of the virtual machine monitor and the processing time of memory interrupts, and cannot be processed in an efficient and timely manner.
By generating simulated software interrupts instead of maintaining interrupts, the interrupt information in the memory is managed. The simulated software interrupt is used to detect the status of the list register. When it becomes available, the pending interrupt information is written to the list register to use it as a virtual Interrupts are sent to virtual processing units, reducing system maintenance overhead and improving interrupt management efficiency.
It reduces maintenance overhead, improves interrupt processing efficiency, reduces the frequency of calls to maintain interrupts, and promotes efficient and timely processing of interrupts in memory.
Smart Images

Figure CN114691296B
Abstract
Description
Technical Field
[0001] The present application relates to the field of interrupt technology, and in particular to an interrupt processing method, apparatus, medium and equipment. Background Art
[0002] In related technologies, people have proposed a virtualization technology that can virtualize the CPU (Central Processing Unit), memory, and hardware devices of a physical computer through a virtual machine monitor (Hypervisor), virtualize multiple virtual machines (VMs) on a real computer, and run different operating systems on multiple virtual machines.
[0003] In the virtual machine monitor, maintenance interrupts (a type of physical interrupt) are used to track and process some key interrupt events in the virtual machine. For example, when the ARM system register LR changes from an unavailable state to an available state or when an interrupt overflows, the maintenance interrupt needs to be generated. If interrupt events occur frequently and cannot be processed in time, the call frequency of the maintenance interrupt will increase, increasing the maintenance overhead of the virtual machine monitor. Summary of the invention
[0004] In order to reduce the maintenance cost of interruption, the present application provides an interruption processing method, device, medium and equipment. The technical solution is as follows:
[0005] In a first aspect, the present application provides an interrupt processing method, the method comprising:
[0006] Get interrupt information;
[0007] When the current state of the list register indicates that the list register is unavailable, saving the interrupt information to a memory;
[0008] Generate and send a simulated software interrupt to an interrupt controller, wherein the simulated software interrupt is used to manage pending interrupt information stored in a memory and detect a current state of the list register; the pending interrupt information includes the interrupt information;
[0009] When the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information stored in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit.
[0010] Optionally, the method further includes:
[0011] If the pending interrupt information still cannot be successfully written into the list register, a maintenance interrupt is triggered, and the maintenance interrupt is a physical interrupt for notifying management of the pending interrupt information.
[0012] Further, writing the pending interrupt information stored in the memory into the list register comprises:
[0013] Determine target interrupt information corresponding to the target interrupt according to the priority information and interrupt status information in the interrupt information to be processed;
[0014] The target interrupt information is preferentially written into the list register.
[0015] Further, the step of writing the pending interrupt information stored in the memory into the list register to convert the pending interrupt information into a virtual interrupt and sending the virtual interrupt to the corresponding virtual processing unit includes:
[0016] The list register determines the interrupt number and the virtual processing unit identifier according to the interrupt information to be processed;
[0017] The list register writes the interrupt number into a virtual processing unit interface register corresponding to the virtual processing unit identifier according to the interrupt number and the virtual processing unit identifier.
[0018] In a second aspect, the present application provides an interrupt processing device, the device comprising:
[0019] An acquisition module is used to obtain interrupt information;
[0020] A saving module, used for saving the interrupt information to a memory when the current state of the list register indicates that the list register is unavailable;
[0021] A simulation module, used for generating and sending a simulated software interrupt to an interrupt controller, wherein the simulated software interrupt is used for managing the pending interrupt information stored in the memory and detecting the current state of the list register; the pending interrupt information includes the interrupt information;
[0022] A writing module is used to notify the interrupt controller to write the pending interrupt information stored in the memory into the list register when the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, so as to send the pending interrupt information as a virtual interrupt to the corresponding virtual processing unit.
[0023] In a third aspect, the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement an interrupt handling method as described in the first aspect.
[0024] In a fourth aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement an interrupt handling method as described in the first aspect.
[0025] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes computer instructions, and when the computer instructions are executed by a processor, an interrupt processing method as described in the first aspect is implemented.
[0026] The interrupt processing method, device, medium and equipment provided by this application have the following technical effects:
[0027] The solution provided by the present application saves the overflowed interrupt information into the memory when the current state of the list register indicates that the list register is unavailable; at the same time, generates and sends a simulated software interrupt to the interrupt controller, and the simulated software interrupt is used to manage the pending interrupt information saved in the memory and detect the current state of the list register; the pending interrupt information includes the interrupt information; when the simulated software interrupt detects that the current state of the list register indicates that the list register changes from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information saved in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit. In an ARM-based virtualization extension, if the list register is full or changes from unavailable to available, the interrupts in the memory are managed by triggering a maintenance interrupt. However, a CPU has only one maintenance interrupt. When interrupt exceptions occur frequently, the maintenance interrupt will be called at a high frequency. When the usage frequency is very high, it will cause waiting and increase the processing time of the memory interrupt. The interrupts in the memory cannot be processed efficiently and promptly. The technical solution provided in the present application manages the interrupts in the memory by generating simulated software interrupts instead of maintenance interrupts, thereby reducing the system maintenance overhead and improving the management efficiency of the interrupts in the memory, thereby promoting the processing efficiency of the interrupts.
[0028] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions 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.
[0030] Figure 1 It is a flowchart of an interrupt processing method provided in an embodiment of the present application;
[0031] Figure 2 It is a flowchart of another interrupt processing method provided in an embodiment of the present application;
[0032] Figure 3 is a schematic diagram of an interrupt processing device provided in an embodiment of the present application;
[0033] Figure 4 It is a schematic diagram of the hardware structure of a device for implementing an interrupt processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] In order to facilitate understanding of the technical solutions described in the embodiments of the present application and the technical effects produced therefrom, the embodiments of the present application explain the relevant professional terms involved:
[0036] Interrupt: When a computer is running and some unexpected situation occurs, requiring host intervention, the machine can automatically stop the running program and switch to a program to handle the new situation. After the processing is completed, it returns to the originally paused program to continue running.
[0037] Virtualization: It is to simulate a single physical device into multiple isolated virtual devices while ensuring the high efficiency of these virtual devices.
[0038] ARM: It is a reduced instruction set computer (RISC) architecture. Reduced means that each assembly instruction completes all the work alone, while the complex instruction set is not like this. One of its assembly instructions may be translated into several machine instructions.
[0039] Hypervisor: Also known as virtual machine monitor (VMM), it is an intermediate software layer running between the basic physical server and the operating system, which can access all physical devices on the server including disks and memory. Hypervisor coordinates access to these hardware resources and protection between virtual machines. When the server starts, it loads the operating system of all virtual machine clients and allocates memory, disk, and network to the virtual machines. Hypervisor implements isolation between the operating system and application and the hardware layer, which can effectively reduce the software's dependence on hardware devices and drivers. Hypervisor can allow operating systems and application workloads to run on a wider range of hardware resources and support multiple operating systems and workloads.
[0040] GIC: Generic Interrupt Controller, is a general interrupt controller provided by ARM. GIC is connected to one or more ARM processors through an on-chip bus such as AMBA (Advanced Microcontroller Bus Architecture), and sends interrupt requests from multiple interrupt sources to different CPUs. GIC can be divided into two parts:
[0041] Distributor: Distributor is responsible for receiving interrupts, setting whether the interrupt is enabled and its priority, and then sending it to the corresponding CPU interface (central processing unit interface).
[0042] CPU interface: The interrupt interface is responsible for shielding low-priority interrupts and allowing high-priority interrupts to preempt the CPU.
[0043] Maintenance interrupt: In GIC virtual extension, it is used to track and handle some key interrupt events on the virtual machine.
[0044] SGI: Software Generated Interrupt, software generated interrupt, used for inter-core communication.
[0045] See also Figure 1, Figure 1 This is a flowchart of an interrupt handling method provided by an embodiment of the present application. The present application provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Please refer to Figure 1 , an interrupt processing method provided by an embodiment of the present application may include the following steps:
[0046] S100: Obtain interruption information.
[0047] In the embodiment of the present application, support can be provided for peripheral interrupts, software interrupts, etc. based on the ARM system, wherein the peripheral interrupt corresponds to an interrupt request or interrupt event triggered by an external device. When data is received at the serial port, a device is inserted into the USB (Universal Serial Bus) interface, a key is pressed on the keyboard, etc., a peripheral interrupt request will be triggered. The software interrupt is used for inter-core communication between multi-core systems.
[0048] In an ARM-based hardware virtualization architecture, the interrupt controller collects each interrupt request and sends it to the virtual machine monitor, which sends each interrupt to one or more CPUs. The virtual machine monitor obtains the interrupt information corresponding to the interrupt request, which may include basic information of the interrupt such as the interrupt device, interrupt number, interrupt program address, interrupt context, etc., and may also include corresponding control information.
[0049] In an ARM-based system on chip, which includes an interrupt controller, a virtual machine monitor and a list register, the interrupt controller and the virtual machine monitor can both write to and access the list register.
[0050] S200: When the current state of the list register indicates that the list register is unavailable, save the interrupt information to a memory.
[0051] In the embodiment of the present application, the list register (LR) is a system register in ARM, which provides basic information of virtual interrupts for the virtual CPU interface of the virtual processing unit. There can only be one interrupt from the same interrupt source in the LR, and the next one must wait until the previous one is executed. The LR can write up to 16 interrupts. When the number of interrupts written reaches the maximum number, there is no free bit, the current list register is unavailable, and the new interrupt information fails to be written, that is, the interrupt overflows.
[0052] Generally, after receiving the interrupt information, the virtual machine monitor sets a virtual interrupt to add the virtual interrupt to the virtual CPU interface of the corresponding virtual processing unit, so that the corresponding virtual processing unit obtains the virtual interrupt by accessing the virtual CPU interface. However, when the interrupt overflows, a write failure will occur, that is, when the interrupt information needs to be written to the LR, there is no available data space in the LR. At this time, in the ARM architecture, a Maintenance Interrupt is generally set up in advance. Under certain circumstances, such as when there is no available space in the LR or the virtual interrupt injected into the virtual machine (VM) has been completed and the virtual machine monitor needs to be notified to clear the corresponding interrupt status, the interrupt will be triggered, and the virtual machine monitor will send a signal to the interrupt controller to tell the interrupt controller that the context corresponding to the interrupt (the pending, active, active and pending status of the interrupt in the register GICH_LR or the security group where the interrupt is located, etc.) has changed and the information needs to be changed. When the interrupt overflows or the interrupt occurs frequently and cannot be processed in time, the call frequency of the Maintenance Interrupt will increase, which increases the maintenance overhead of the virtual machine monitor.
[0053] In the embodiment of the present application, when the list register is currently unavailable, that is, when the interrupt information cannot be successfully written into the register, the virtual machine monitor first saves it in the memory.
[0054] S300: Generate and send a simulated software interrupt to an interrupt controller, wherein the simulated software interrupt is used to manage pending interrupt information stored in a memory and detect a current state of the list register; the pending interrupt information includes the interrupt information.
[0055] In the embodiment of the present application, the simulated software interrupt is a signal sent by the virtual machine monitor in the form of a simulated software interrupt, and the interrupt processing function in the software interrupt is used to manage the pending interrupt information stored in the memory (which may mainly include the management of status information and security group information). At the same time, in the embodiment of the present application, the simulated software interrupt can also detect the current available state of the list register by reading the state of the list register. It can be understood that the simulated software interrupt is used to replace the maintained interrupt. Whether it is a simulated software interrupt or a maintained interrupt, its essence is not a real interrupt event, but a semaphore.
[0056] It should be noted that the aforementioned interrupt information is an overflow interrupt, and there may be other interrupts stored in the memory due to overflow before this, that is, the aforementioned interrupt information to be processed may include one or more interrupt information, and one or more interrupt information includes the aforementioned interrupt information.
[0057] S400: When the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information stored in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit.
[0058] In the embodiment of the present application, the simulated software interrupt can also detect the current available state of the list register by reading the state of the list register. When the idle state bit is detected, that is, indicating that the list register changes from unavailable to available, the simulated software interrupt notifies the interrupt controller to try to write the pending interrupt information in the memory into the list register.
[0059] Specifically, writing the to-be-processed interrupt information stored in the memory into the list register includes:
[0060] Determine target interrupt information corresponding to the target interrupt according to the priority information and interrupt status information in the interrupt information to be processed;
[0061] The target interrupt information is preferentially written into the list register.
[0062] That is, for one or more interrupt information stored in the memory, the writing order of each interrupt information can be determined according to the priority and interrupt status of the interrupt information, and written into the list register in sequence.
[0063] Specifically, the writing of the pending interrupt information stored in the memory into the list register to convert the pending interrupt information into a virtual interrupt and send the virtual interrupt to the corresponding virtual processing unit also includes:
[0064] The list register determines the interrupt number and the virtual processing unit identifier according to the interrupt information to be processed;
[0065] The interrupt number representation is a code assigned by the system to each interrupt source for identification and processing, that is, it allows the processor to identify which device has issued an interrupt request; the virtual processing unit identifier indicates the virtual processor responsible for processing the interrupt.
[0066] The list register writes the interrupt number into a virtual processing unit interface register corresponding to the virtual processing unit identifier according to the interrupt number and the virtual processing unit identifier.
[0067] That is, by writing the interrupt information into the list register and routing the interrupt by the list register, the conversion from physical interrupt to virtual interrupt can be realized in the virtualization extension. The virtual processing unit obtains the corresponding virtual interrupt by accessing the corresponding virtual processing unit interface register, thereby executing the corresponding interrupt program.
[0068] In one embodiment of the present application, if the pending interrupt information still fails to be successfully written into the list register, a maintenance interrupt is triggered, and the maintenance interrupt is a physical interrupt for notifying management of the pending interrupt information.
[0069] It is understandable that since each CPU has only one maintenance interrupt, the maintenance interrupt needs to be generated when disabling and enabling the Group0 / 1 virtual interrupt, when the ARM system register LR changes from unavailable to available, when there is no available LR when there is an EOI request, and when the interrupt overflows. This leads to a high frequency of calling the maintenance interrupt and low efficiency in interrupt-related processing. The embodiment of the present application generates a simulated software interrupt to replace part of the work of maintaining the interrupt, thereby reducing the frequency of calling the maintenance interrupt, that is, reducing the maintenance overhead of the virtual machine monitor for interrupts. At the same time, the simulated software interrupt can effectively improve the management efficiency of pending interrupts stored in the memory when the LR availability status changes.
[0070] See also Figure 2 , Figure 2 FIG. 1 is a flowchart of another interrupt processing method provided by the present application. Figure 2 As shown, the virtual machine monitor obtains interrupt information. When the interrupt information needs to be written into the LR but there is no available data space in the LR, resulting in a write failure, the virtual machine monitor first saves it in the memory. Then the virtual machine monitor generates a simulated software interrupt and sends it to the notification interrupt controller (Generic Interrupt Controller, GIC). The simulated software interrupt notifies the execution of its own interrupt processing service program to manage the pending interrupt information stored in the memory and detect the current state of the list register, wherein the aforementioned interrupt information is included in the pending interrupt information. When the simulated software interrupt detects that the list register changes from unavailable to available, for example, after the execution of the interrupt in the list register is cleared, an idle state bit appears in the list register, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information stored in the memory into the list register, that is, the interrupt controller will try to write the pending interrupt information in the memory into the list register. During the writing process, it can be selected according to the priority of each pending interrupt information. If the writing is successful, the pending interrupt information in the memory can be managed without triggering the maintenance interrupt, thereby improving the processing efficiency of the pending interrupt information in the memory.
[0071] Furthermore, if the interrupt information still cannot be fully written into the list register, a maintenance interrupt is triggered, and the maintenance interrupt is used to notify maintenance management of the interrupt information.
[0072] Among them, the maintenance interrupt event (Maintenance Interrupt) is a physical interrupt that tracks the status of various interrupt events, such as interrupt write success, failure, interrupt processing, interrupt clearing, etc.
[0073] In addition to the interrupt overflow shown in the embodiment of the present application, MaintenanceInterrupt may also need to be triggered in other situations, such as: disabling and enabling virtual interrupts, when there is an EOI (End of Interrupt) request, there is no available LR, etc. In other situations where Maintenance Interrupt needs to be generated, corresponding interrupt processing methods may be adopted based on the same concept as the embodiment of the present application, and Maintenance Interrupt may be replaced by simulated software interrupts to reduce the use of Maintenance Interrupt.
[0074] Further, if the interrupt information is successfully written into the list register, the interrupt information is initialized.
[0075] Furthermore, if the interrupt information can be successfully written into the list register and after the virtual processing unit completes the processing, the register GICC_EOIR1 of the general interrupt controller (GIC) is written to inform the CPU that the interrupt processing is completed.
[0076] The solution provided by the present application saves the overflowed interrupt information into the memory when the current state of the list register indicates that the list register is unavailable; at the same time, generates and sends a simulated software interrupt to the interrupt controller, and the simulated software interrupt is used to manage the pending interrupt information saved in the memory and detect the current state of the list register; the pending interrupt information includes the interrupt information; when the simulated software interrupt detects that the current state of the list register indicates that the list register changes from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information saved in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit. In an ARM-based virtualization extension, if the list register is full or changes from unavailable to available, the interrupts in the memory are managed by triggering a maintenance interrupt. However, a CPU has only one maintenance interrupt. When interrupt exceptions occur frequently, the maintenance interrupt will be called at a high frequency. When the usage frequency is very high, it will cause waiting and increase the processing time of the memory interrupt. The interrupts in the memory cannot be processed efficiently and promptly. The technical solution provided in the present application manages the interrupts in the memory by generating simulated software interrupts instead of maintenance interrupts, thereby reducing the system maintenance overhead and improving the management efficiency of the interrupts in the memory, thereby promoting the processing efficiency of the interrupts.
[0077] The present application embodiment also provides an interrupt processing device 300, such as Figure 3 As shown, the device 300 may include:
[0078] An acquisition module 310 is used to acquire interruption information;
[0079] A saving module 320, configured to save the interrupt information to a memory when the current state of the list register indicates that the list register is unavailable;
[0080] The simulation module 330 is used to generate and send a simulated software interrupt to the interrupt controller, wherein the simulated software interrupt is used to manage the pending interrupt information stored in the memory and detect the current state of the list register; the pending interrupt information includes the interrupt information;
[0081] The writing module 340 is used to notify the interrupt controller to write the pending interrupt information stored in the memory into the list register when the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, so as to send the pending interrupt information as a virtual interrupt to the corresponding virtual processing unit.
[0082] In one embodiment of the present application, the apparatus 300 may further include:
[0083] A maintenance interrupt triggering unit is used to trigger a maintenance interrupt if the pending interrupt information still fails to be successfully written into the list register, wherein the maintenance interrupt is a physical interrupt for notifying the management of the pending interrupt information.
[0084] In one embodiment of the present application, the writing module 340 may include:
[0085] A target interrupt selection unit, configured to determine target interrupt information corresponding to a target interrupt according to priority information and interrupt status information in the interrupt information to be processed;
[0086] The priority writing unit is used to write the target interrupt information into the list register in priority.
[0087] In one embodiment of the present application, the writing module 340 may further include:
[0088] A write information determination unit is used for the list register to determine the interrupt number and the virtual processing unit identifier according to the interrupt information to be processed;
[0089] A writing unit unit is used for the list register to write the interrupt number into the virtual processing unit interface register corresponding to the virtual processing unit identifier according to the interrupt number and the virtual processing unit identifier.
[0090] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0091] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement an interrupt handling method provided in the above method embodiment.
[0092] Figure 4 A schematic diagram of the hardware structure of a device for implementing an interrupt processing method provided in an embodiment of the present application is shown, and the device may participate in or include the apparatus or system provided in an embodiment of the present application. Figure 4As shown, the device 10 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only and does not limit the structure of the electronic device. Figure 4 More or fewer components as shown, or with Figure 4 Different configurations are shown.
[0093] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0094] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods in the embodiments of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, to implement the above-mentioned interrupt processing method. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0095] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0096] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).
[0097] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to an interrupt handling method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement an interrupt handling method provided by the above method embodiment.
[0098] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0099] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes an interrupt processing method provided in the above various optional implementations.
[0100] It can be seen from the embodiments of the interrupt processing method, device, medium and equipment provided by the present application that:
[0101] The solution provided by the present application saves the overflowed interrupt information into the memory when the current state of the list register indicates that the list register is unavailable; at the same time, generates and sends a simulated software interrupt to the interrupt controller, and the simulated software interrupt is used to manage the pending interrupt information saved in the memory and detect the current state of the list register; the pending interrupt information includes the interrupt information; when the simulated software interrupt detects that the current state of the list register indicates that the list register changes from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information saved in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit. In an ARM-based virtualization extension, if the list register is full or changes from unavailable to available, the interrupts in the memory are managed by triggering a maintenance interrupt. However, a CPU has only one maintenance interrupt. When interrupt exceptions occur frequently, the maintenance interrupt will be called at a high frequency. When the usage frequency is very high, it will cause waiting and increase the processing time of the memory interrupt. The interrupts in the memory cannot be processed efficiently and promptly. The technical solution provided in the present application manages the interrupts in the memory by generating simulated software interrupts instead of maintenance interrupts, thereby reducing the system maintenance overhead and improving the management efficiency of the interrupts in the memory, thereby promoting the processing efficiency of the interrupts.
[0102] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0103] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0104] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0105] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. An interrupt processing method, characterized in that: The method comprises: Get interrupt information; When the current state of the list register indicates that the list register is unavailable, saving the interrupt information to a memory; Generate and send a simulated software interrupt to an interrupt controller, wherein the simulated software interrupt is used to manage pending interrupt information stored in a memory and detect a current state of the list register; the pending interrupt information includes the interrupt information; When the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, the simulated software interrupt notifies the interrupt controller to write the pending interrupt information stored in the memory into the list register, so as to treat the pending interrupt information as a virtual interrupt and send it to the corresponding virtual processing unit.
2. The interrupt processing method according to claim 1, characterized in that: The method further comprises: If the pending interrupt information still cannot be successfully written into the list register, a maintenance interrupt is triggered, and the maintenance interrupt is a physical interrupt for notifying management of the pending interrupt information.
3. The interrupt processing method according to claim 1, characterized in that: The step of writing the pending interrupt information stored in the memory into the list register comprises: Determine target interrupt information corresponding to the target interrupt according to the priority information and interrupt status information in the interrupt information to be processed; The target interrupt information is preferentially written into the list register.
4. The interrupt processing method according to claim 1, characterized in that: The step of writing the pending interrupt information stored in the memory into the list register to convert the pending interrupt information into a virtual interrupt and sending the virtual interrupt to the corresponding virtual processing unit includes: The list register determines the interrupt number and the virtual processing unit identifier according to the interrupt information to be processed; The list register writes the interrupt number into a virtual processing unit interface register corresponding to the virtual processing unit identifier according to the interrupt number and the virtual processing unit identifier.
5. An interrupt processing device, characterized in that: The device comprises: An acquisition module is used to obtain interrupt information; A saving module, used for saving the interrupt information to a memory when the current state of the list register indicates that the list register is unavailable; A simulation module, used for generating and sending a simulated software interrupt to an interrupt controller, wherein the simulated software interrupt is used for managing the pending interrupt information stored in the memory and detecting the current state of the list register; the pending interrupt information includes the interrupt information; A writing module is used to notify the interrupt controller to write the pending interrupt information stored in the memory into the list register when the simulated software interrupt detects that the current state of the list register indicates that the list register has changed from unavailable to available, so as to send the pending interrupt information as a virtual interrupt to the corresponding virtual processing unit.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement an interrupt processing method as claimed in any one of claims 1 to 4.
7. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement an interrupt processing method as described in any one of claims 1 to 4.
