Interrupt processing method, device and equipment

By receiving and processing the interruption of non -fatal errors in the firmware, and blocking the interrupt of the target object according to the layered shielding information, the problem of interrupt storm caused by non -fatal errors in the system in the film, avoiding the death of the system or firmware, and improved The flexibility of interrupt treatment.

CN119376869APending Publication Date: 2025-01-28HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310942590.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In a system on chip, non-fatal errors trigger a large number of interrupts, resulting in the problem of system hang or firmware hang.

Method used

By receiving non -fatal error triggering interruptions in the firmware, interrupt information and layered shielding information are used to block the interruption of the target shielding object after the first time to avoid a large number of interruptions.

Benefits of technology

Effectively avoid non -fatal error triggered interrupt storms, prevent the system or firmware from hanging, and improve the flexibility of interrupt shielding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376869A_ABST
    Figure CN119376869A_ABST
Patent Text Reader

Abstract

The invention provides an interrupt processing method, device and equipment, relates to the technical field of computers, and is used for solving the problem that a system is suspended or firmware is suspended when a large number of interrupts are triggered by non-fatal errors. The method comprises the following steps: the firmware receives a plurality of interrupts in a first duration, wherein the plurality of interrupts are triggered when a non-fatal error occurs in the hardware layer; the firmware shields the interruption of a target shielding object corresponding to the plurality of interrupts after the first duration according to the interruption information of the plurality of interrupts and layered shielding information, the layered shielding information is used for indicating a plurality of shielding objects, and the plurality of shielding objects are obtained by layering transmission of the interrupts; the plurality of shielding objects comprise the target shielding object; and the firmware sends interrupt information of the plurality of interrupts to a kernel driver.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an interrupt processing method, device and equipment. Background Art

[0002] In a system on chip (SoC), there are situations where a large number of non-fatal errors (NFEs) occur suddenly. For example, the non-fatal errors may include correctable errors (CE) and non-fatal uncorrectable errors. For example, when there are a large number of faulty areas in the memory of the SoC (for example, multiple pages are abnormal at the same time), and / or the access frequency of the faulty areas is high, the memory will suddenly have a large number of non-fatal errors. These non-fatal errors will trigger a large number of interrupts, thereby affecting the access to normal services, and even causing the system to hang or the firmware in the system to hang. Summary of the invention

[0003] The present application provides an interrupt processing method, apparatus and device for solving the problem of system or firmware hang caused by non-fatal errors triggering a large number of interrupts.

[0004] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, an interrupt processing method is provided, which is applied to firmware, and the firmware is used to run on a hardware layer, and the hardware layer may include hardware modules such as processors, accelerators, memories, I / O units, sensors and buses. The method includes: the firmware receives multiple interrupts in a first duration, and the multiple interrupts are triggered when non-fatal errors occur in the hardware layer, and the non-fatal errors may include correctable errors and non-fatal uncorrectable errors; the firmware masks interrupts of target shielding objects corresponding to the multiple interrupts after the first duration according to interrupt information and hierarchical shielding information of the multiple interrupts, and the hierarchical shielding information is used to indicate multiple shielding objects, and the multiple shielding objects are obtained by hierarchically transmitting interrupts, and the multiple shielding objects include the target shielding objects; the firmware sends the interrupt information of the multiple interrupts to a kernel driver.

[0006] In the above technical scheme, when the firmware receives multiple interrupts triggered by non-fatal errors in the first time period, it can send the interrupt information of the multiple interrupts to the kernel driver. At the same time, the firmware can also shield the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time period according to the interrupt information and hierarchical shielding information of the multiple interrupts. The hierarchical shielding information is used to indicate multiple shielding objects, and the multiple shielding objects are obtained by layering the transmission of interrupts, thereby avoiding the situation where a large number of non-fatal errors trigger a large number of interrupts through the hierarchical shielding strategy, thereby solving the problem of system hang or firmware hang.

[0007] In a possible implementation of the first aspect, the multiple shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting interrupts, and an interrupt bit of a status register for storing interrupts. In a possible example, the multiple layers obtained by stratification may include a hardware module layer, an interrupt line layer, and an interrupt bit layer. The shielding objects in the hardware module layer may include multiple different hardware modules, for example, the shielding objects in the hardware module layer include a CPU, an accelerator, and a memory. The shielding objects in the interrupt line layer may include multiple different interrupt lines, for example, the shielding objects in the interrupt line layer include multiple interrupt lines identified by different interrupt numbers. The shielding objects in the interrupt bit layer may include different interrupt bit layers, for example, the shielding objects in the interrupt bit layer include different interrupt bits.

[0008] In a possible implementation of the first aspect, the firmware masks interruptions of target masking objects corresponding to the multiple interruptions after a first duration according to the interruption information and hierarchical masking information of the multiple interruptions, including: the interruption information of each interruption is used to indicate the masking object corresponding to the interruption; when the multiple interruptions belong to the target masking object and the number of the multiple interruptions reaches a preset threshold corresponding to the target masking object, the firmware masks interruptions of the target masking object after the first duration. Exemplarily, when the firmware receives an interrupt, the firmware can determine the hardware module, interrupt line and interrupt bit corresponding to the interrupt based on the hardware module identifier, interrupt number and error type in the interrupt information of the interrupt; then, the firmware can obtain different layers according to the stratification, and count the number of interrupts corresponding to each hardware module that triggers the interrupt, the number of interrupts corresponding to each interrupt line, and the number of interrupts corresponding to each interrupt bit; when the number of interrupts corresponding to a certain hardware module reaches a preset threshold, the hardware module is the target shielding object, and the firmware shields the interrupts of the hardware module after a first time length; when the number of interrupts corresponding to a certain interrupt line reaches a preset threshold, the interrupt line is the target shielding object, and the firmware shields the interrupts of the interrupt line after the first time length; when the number of interrupts corresponding to a certain interrupt bit layer reaches a preset threshold, the interrupt bit layer is the target shielding object, and the firmware shields the interrupts of the interrupt bit layer after the first time length.

[0009] In a possible implementation of the first aspect, the interrupt information of each interrupt includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of a non-fatal error corresponding to the interrupt bit. The hardware module identifier is used to indicate the hardware module where the non-fatal error corresponding to the interrupt occurs; the interrupt line identifier is used to indicate the interrupt line that transmits the interrupt, for example, the interrupt line identifier may be an interrupt number. The error type of the non-fatal error corresponding to the interrupt bit may also be referred to as the error type corresponding to the interrupt or the fault type corresponding to the interrupt, which may be used to determine the interrupt bit of the status register storing the interrupt. Exemplarily, the error type may include a single-bit error and a multi-bit error.

[0010] In a possible implementation of the first aspect, the method also includes: when the interrupt information includes the hardware module identifier, the firmware determines the hardware module to which each interrupt belongs based on the hardware module identifier in the interrupt information of each interrupt; and / or, when the interrupt information includes the interrupt line identifier, the firmware determines the interrupt line to which each interrupt belongs based on the interrupt line identifier in the interrupt information of each interrupt; and / or, when the interrupt information includes the error type of the non-fatal error corresponding to the interrupt bit, the firmware determines the interrupt bit to which each interrupt belongs based on the error type in the interrupt information of each interrupt.

[0011] In a possible implementation of the first aspect, the hardware layer includes a first hardware system, the firmware includes a first firmware running on the first hardware system, the non-fatal error includes an RSA specification error and / or a security error, and the first firmware is used to shield a shielding object corresponding to the RSA specification error and / or the security error. In the above possible implementation, the first firmware can avoid the problem of system or firmware hang caused by triggering a large number of interrupts by shielding interrupts triggered by RSA specification errors and / or security errors.

[0012] In a possible implementation of the first aspect, the hardware layer further includes a second hardware system, the firmware further includes a second firmware running on the second hardware system, the non-fatal error includes a non-RSA specification error, and the second firmware is used to shield a shielding object corresponding to the non-RSA specification error. In the above possible implementation, the second firmware can avoid the problem of system or firmware hang caused by triggering a large number of interrupts by shielding interrupts triggered by non-RSA specification errors.

[0013] In a possible implementation of the first aspect, for non-RSA specification errors, the method further includes: the second firmware unshields the shielded shielded objects among the multiple shielded objects after a delay of a second time length. In the above possible implementation, the second firmware unshields the shielded shielded objects among the multiple shielded objects after a delay of a second time length, thereby avoiding system or firmware hangs caused by interrupts triggered by a large number of non-RSA specification errors while not affecting the subsequent processing of interrupts triggered by non-fatal errors, thereby ensuring user experience.

[0014] In a possible implementation of the first aspect, the unmasking is performed after the last interrupt among the multiple interrupts is processed; or, the unmasking is performed in a polling manner. In the above possible implementations, when the impact of the interrupt after the first duration is large, by performing the unmasking after the last interrupt among the multiple interrupts is processed, the unmasking can be performed as early as possible, thereby reducing the impact of the masked interrupt; when the impact of the interrupt after the first duration is small, performing the unmasking in a polling manner can avoid the interrupt of a certain masked object after the first duration from being masked for a long time, thereby ensuring the performance of different masked objects.

[0015] In a possible implementation manner of the first aspect, the first firmware communicates with the kernel driver through an advanced platform fault interface APEI, and the second firmware communicates with the kernel driver through an inter-core error message IPEM interface.

[0016] In a second aspect, an interrupt processing method is provided, which is applied to a kernel driver, wherein the kernel driver is used to run on a hardware layer, and the hardware layer may include hardware modules such as a processor, an accelerator, a memory, an I / O unit, a sensor, and a bus. The method includes: the kernel driver receives interrupt information of multiple interrupts sent by firmware, the multiple interrupts are received by the firmware in a first time period, and the multiple interrupts are triggered when non-fatal errors occur in the hardware layer; the kernel driver processes the multiple interrupts according to the interrupt information of the multiple interrupts; wherein the interrupts of target shielding objects corresponding to the multiple interrupts after the first time period are shielded by the firmware, and the firmware is shielded according to the interrupt information of the multiple interrupts and the hierarchical shielding information, the multiple shielding objects are obtained by hierarchically transmitting the interrupts, and the multiple shielding objects include the target shielding object.

[0017] In the above technical scheme, when the firmware receives multiple interrupts triggered by non-fatal errors in the first time period, it can send interrupt information of the multiple interrupts to the kernel driver so that the kernel driver can process the multiple interrupts. At the same time, the firmware can also shield the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time period according to the interrupt information and hierarchical shielding information of the multiple interrupts. The hierarchical shielding information is used to indicate multiple shielding objects, and the multiple shielding objects are obtained by layering the transmission of interrupts, thereby avoiding the situation where a large number of non-fatal errors trigger a large number of interrupts through the hierarchical shielding strategy, thereby solving the problem of system hang or firmware hang.

[0018] In a possible implementation of the second aspect, the multiple shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting interrupts, and an interrupt bit of a status register for storing interrupts. In a possible example, the multiple layers obtained by layering may include a hardware module layer, an interrupt line layer, and an interrupt bit layer. The shielding objects in the hardware module layer may include multiple different hardware modules, for example, the shielding objects in the hardware module layer include a CPU, an accelerator, and a memory. The shielding objects in the interrupt line layer may include multiple different interrupt lines, for example, the shielding objects in the interrupt line layer include multiple interrupt lines identified by different interrupt numbers.

[0019] In a possible implementation of the second aspect, the interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to the interrupt bit. The hardware module identifier is used to indicate the hardware module where the non-fatal error corresponding to the interrupt occurs; the interrupt line identifier is used to indicate the interrupt line that transmits the interrupt, for example, the interrupt line identifier may be an interrupt number. The error type of the non-fatal error corresponding to the interrupt bit may also be referred to as the error type corresponding to the interrupt or the fault type corresponding to the interrupt, which may be used to determine the interrupt bit of the status register storing the interrupt. Exemplarily, the error type may include a single-bit error and a multi-bit error.

[0020] In a possible implementation of the second aspect, the non-fatal error includes an RSA specification error and / or a security error, and the method further includes: the kernel driver unshields the shielded shielded object among the multiple shielded objects after delaying the second time period. In the above possible implementation, the kernel driver unshields the shielded shielded object among the multiple shielded objects after delaying the second time period, thereby avoiding system or firmware hangs caused by interrupts triggered by a large number of RSA specification errors and / or security errors, while not affecting the subsequent processing of interrupts triggered by non-fatal errors, thereby ensuring user experience.

[0021] In a possible implementation of the second aspect, the unmasking is performed after the last interrupt among the multiple interrupts is processed; or, the unmasking is performed in a polling manner. In the above possible implementations, when the impact of the interrupt after the first duration is large, by performing the unmasking after the last interrupt among the multiple interrupts is processed, the unmasking can be performed as early as possible, thereby reducing the impact of the masked interrupt; when the impact of the interrupt after the first duration is small, performing the unmasking in a polling manner can avoid the interrupt of a certain masked object after the first duration from being masked for a long time, thereby ensuring the performance of different masked objects.

[0022] In a possible implementation of the second aspect, the non-fatal error also includes a non-RSA specification error, the firmware includes a first firmware and a second firmware, the first firmware is used to mask interrupts triggered by RSA specification errors and / or security errors, the second firmware is used to mask and unmask interrupts triggered by non-RSA specification errors, the first firmware communicates with the kernel driver through an advanced platform fault interface APEI, and the second firmware communicates with the kernel driver through an inter-core error message IPEM interface.

[0023] According to a third aspect, an interrupt processing device is provided, which is applied to firmware, and the firmware is used to run on a hardware layer. The device includes: a receiving unit, which is used to receive multiple interrupts in a first time period, and the multiple interrupts are triggered when a non-fatal error occurs in the hardware layer; a processing unit, which is used to mask the interrupts of target masking objects corresponding to the multiple interrupts after the first time period according to the interrupt information and hierarchical masking information of the multiple interrupts, and the hierarchical masking information is used to indicate multiple masking objects, and the multiple masking objects are obtained by hierarchically transmitting the interrupts, and the multiple masking objects include the target masking object; a sending unit, which is used to send the interrupt information of the multiple interrupts to the kernel driver.

[0024] In a possible implementation manner of the third aspect, the multiple shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting interrupts, and an interrupt bit of a status register for storing interrupts.

[0025] In a possible implementation of the third aspect, the processing unit is also used for: the interruption information of each interruption is used to indicate the shielding object corresponding to the interruption, and when the multiple interruptions belong to the target shielding object and the number of the multiple interruptions reaches a preset threshold corresponding to the target shielding object, the interruption of the target shielding object after the first time length is shielded.

[0026] In a possible implementation manner of the third aspect, the interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to the interrupt bit.

[0027] In a possible implementation of the third aspect, the processing unit is also used to: when the interrupt information includes the hardware module identifier, determine the hardware module to which each interrupt belongs according to the hardware module identifier in the interrupt information of each interrupt; and / or, when the interrupt information includes the interrupt line identifier, determine the interrupt line to which each interrupt belongs according to the interrupt line identifier in the interrupt information of each interrupt; and / or, when the interrupt information includes the error type of the non-fatal error corresponding to the interrupt bit, determine the interrupt bit to which each interrupt belongs according to the error type in the interrupt information of each interrupt.

[0028] In a possible implementation of the third aspect, the hardware layer includes a first hardware system, the firmware includes a first firmware running on the first hardware system, the non-fatal error includes an RSA specification error and / or a security error, and the first firmware is used to shield a shielding object corresponding to the RSA specification error and / or security error.

[0029] In a possible implementation of the third aspect, the hardware layer also includes a second hardware system, the firmware also includes a second firmware running on the second hardware system, the non-fatal error includes a non-RSA specification error, and the second firmware is used to shield a shielding object corresponding to the non-RSA specification error.

[0030] In a possible implementation manner of the third aspect, for the non-RSA standard error, the processing unit is further used to: after a delay of a second time period, unmask a masked object among the multiple masked objects.

[0031] In a possible implementation manner of the third aspect, the unmasking is performed after the last interrupt among the multiple interrupts is processed; or, the unmasking is performed in a polling manner.

[0032] In a fourth aspect, an interrupt processing device is provided, which is applied to a kernel driver, and the kernel driver is used to run on a hardware layer. The device includes: a receiving unit, which is used to receive interrupt information of multiple interrupts sent by a firmware, and the multiple interrupts are received by the firmware in a first time period, and the multiple interrupts are triggered when a non-fatal error occurs in the hardware layer; a processing unit, which is used to process the multiple interrupts according to the interrupt information of the multiple interrupts; wherein the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time period are shielded by the firmware, and the firmware is shielded according to the interrupt information of the multiple interrupts and the hierarchical shielding information, and the multiple shielding objects are obtained by hierarchically transmitting the interrupts, and the multiple shielding objects include the target shielding object.

[0033] In a possible implementation manner of the fourth aspect, the multiple shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting interrupts, and an interrupt bit of a status register for storing interrupts.

[0034] In a possible implementation manner of the fourth aspect, the interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to the interrupt bit.

[0035] In a possible implementation manner of the fourth aspect, the non-fatal error includes an RSA specification error and / or a security error, and the processing unit is further used to: after a delay of a second time period, unmask a masked object among the multiple masked objects.

[0036] In a possible implementation manner of the fourth aspect, the unmasking is performed after the last interrupt among the multiple interrupts is processed; or, the unmasking is performed in a polling manner.

[0037] In a possible implementation of the fourth aspect, the non-fatal error also includes a non-RSA specification error, the firmware includes a first firmware and a second firmware, the first firmware is used to mask interrupts triggered by RSA specification errors and / or security errors, the second firmware is used to mask and unmask interrupts triggered by non-RSA specification errors, the first firmware communicates with the kernel driver through an advanced platform fault interface APEI, and the second firmware communicates with the kernel driver through an inter-core error message IPEM interface.

[0038] Another aspect of the present application provides an interrupt processing device, which includes a processor and a memory, wherein instructions are stored in the memory, and the processor executes the instructions in the memory to enable the device to execute the interrupt processing method provided by the first aspect or any possible implementation of the first aspect, the second aspect or any possible implementation of the second aspect.

[0039] Another aspect of the present application provides an interrupt processing device, which includes a hardware layer, and firmware and a kernel driver running on the hardware layer, the firmware including the interrupt processing device provided by the third aspect or any possible implementation of the third aspect, and the kernel driver including the interrupt processing device provided by the fourth aspect or any possible implementation of the fourth aspect.

[0040] In another aspect of the present application, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed by a device, the device executes the interrupt handling method provided by the first aspect or any possible implementation of the first aspect.

[0041] In another aspect of the present application, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed by a device, the device executes the interrupt handling method provided by the second aspect or any possible implementation of the second aspect.

[0042] In another aspect of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute an interrupt handling method provided in the first aspect or any possible implementation of the first aspect.

[0043] In another aspect of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute an interrupt handling method provided in the second aspect or any possible implementation of the second aspect.

[0044] It can be understood that the beneficial effects that can be achieved by any of the interrupt processing devices, interrupt processing equipment, computer-readable storage media and computer program products provided above can correspond to the beneficial effects of the interrupt processing method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of the structure of the hardware layer of an electronic device provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the structure of a software layer of an electronic device provided in an embodiment of the present application;

[0047] Figure 3 A flowchart of an interrupt processing method provided in an embodiment of the present application;

[0048] Figure 4 A flowchart of another interrupt processing method provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of an interrupt processing provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of another interrupt processing provided in an embodiment of the present application;

[0051] Figure 7 A schematic diagram of the structure of an interrupt processing device provided in an embodiment of the present application;

[0052] Figure 8 A schematic diagram of the structure of another interrupt processing device provided in an embodiment of the present application;

[0053] Fig. 9 A schematic diagram of the structure of an interrupt processing device provided in an embodiment of the present application;

[0054] Fig.10 A schematic diagram of the structure of another interrupt processing device provided in an embodiment of the present application;

[0055] Fig.11 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The following will discuss the making and use of various embodiments in detail. However, it should be understood that many applicable inventive concepts provided by this application can be implemented in a variety of specific environments. The specific embodiments discussed are only illustrative of specific ways to implement and use this description and this technology, and do not limit the scope of this application.

[0057] Unless defined otherwise, all technical and scientific terms used herein have the same meanings as commonly understood by one of ordinary skill in the art.

[0058] Various circuits or other components may be described or referred to as being "configured to" perform one or more tasks. In this case, "configured to" is used to imply structure by indicating that the circuit / component includes structure (e.g., circuitry) that performs the one or more tasks during operation. Thus, even when the specified circuit / component is not currently operational (e.g., not turned on), the circuit / component may be referred to as being configured to perform the task. Circuits / components used with the phrase "configured to" include hardware, such as circuits that perform an operation, etc.

[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c; where a, b and c can be single or multiple.

[0060] The embodiments of the present application use words such as "first" and "second" to distinguish objects with similar names, functions or effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order. The term "coupled" is used to indicate electrical connection, including direct connection through wires or connection terminals or indirect connection through other devices. Therefore, "coupled" should be regarded as a broad electronic communication connection.

[0061] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0062] The technical solution of the present application can be applied to various electronic devices, and can also be applied to the chip of the electronic device, for example, the chip can be a system on chip (SoC). The electronic device can include but is not limited to: mobile phones, tablet computers, laptops, wearable devices, computers, ultra-mobile personal computers (UMPC), netbooks, cameras, cameras, vehicle-mounted devices (for example, cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed trains, etc.), virtual reality (VR) devices, or augmented reality (AR) devices, etc.

[0063] Figure 1 A schematic diagram of the structure of the hardware layer of an electronic device provided in an embodiment of the present application. The electronic device may include a memory 101, a processor 102, an input / output (I / O) unit 103 and a bus 104, and the memory 101, the processor 102 and the I / O unit 103 are interconnected through the bus 104.

[0064] Among them, the memory 101 can be used to store data, software programs and modules, mainly including a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function, such as a sound playback function, an image playback function, etc. The data storage area can store data created according to the use of the electronic device, such as audio data, image data, a phone book, etc. In some feasible embodiments, the memory 101 may include one memory or multiple memories, and the memory may include but is not limited to: random access memory (random access memory, RAM), double data rate synchronous dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SRAM) (DDR for short), high bandwidth memory (high bandwidth memory, HBM), read-only memory (read-only memory, ROM), programmable read-only memory (programmable read-only memory, PROM), erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), flash memory, etc. In addition, the memory may also include: a floppy disk, a hard disk such as a built-in hard disk and a mobile hard disk, a magnetic disk, an optical disk, a magneto-optical disk such as a compact disc read-only memory (CD_ROM), a digital video disc (DVD_ROM), or any other form of storage medium known in the technical field.

[0065] The processor 102 is used to control and manage the actions of the electronic device, such as by running or executing the software program and / or module stored in the memory 101, and calling the data stored in the memory 101, executing various functions of the electronic device and processing data, so as to control the electronic device as a whole. Optionally, the processor 102 may include one or more processing units, which may include a central processing unit (CPU), an application processor, a general processor, and an accelerator. The accelerator may include but is not limited to: a digital signal processor (DSP), a network processor (NPU), a graphic processing unit (GPU), an image signal processor (ISP), a matrix calculation unit, a video decoder (VDEC), a video encoder (VENC), a microcontroller or a microprocessor, etc. Further, the processor 102 may also include other hardware circuits or accelerators, such as application specific integrated circuits, field programmable gate arrays or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Optionally, the processor 102 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc.

[0066] The I / O unit 103 can be used to implement the input and output functions of the electronic device. In some feasible embodiments, the I / O unit 103 may include an input unit and an output unit. The input unit can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device. Exemplarily, the input unit may include a touch screen and other input devices. The touch screen can collect the user's touch operation on or near it (such as the user's operation on or near the touch screen using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, other input devices may include but are not limited to one or more of a physical keyboard, a function key (such as a volume control key, a power switch key, etc.), a trackball, a mouse, a joystick, etc. The display unit can be used to display information input by the user or information provided to the user and various menus of the electronic device, etc. In an example, the display unit may include a display screen, and the display screen may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Furthermore, the touch screen may cover the display screen, and when the touch screen detects a touch operation on or near it, it is transmitted to the processor 102 to determine the type of touch event, and then the processor provides a corresponding visual output on the display screen according to the type of touch event. Although the touch screen and the display screen are used as two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch screen and the display screen can be integrated to implement the input and output functions of the electronic device.

[0067] The bus 104 may be a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.

[0068] Furthermore, the electronic device may also include a power source (eg, a battery) for supplying power to each component. The power source may be logically connected to the processor 102 via a power management system, thereby implementing functions such as managing charging, discharging, and power consumption through the power management system.

[0069] Although not shown, the electronic device may also include a radio frequency (RF) circuit, a sensor component, an audio circuit, a wireless fidelity (WiFi) module, a Bluetooth module, etc., which will not be described in detail in the embodiments of the present application. Those skilled in the art will understand that Figure 1 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0070] In a possible embodiment, the hardware layer of the electronic device may include a first hardware system and a second hardware system, the first hardware system may be referred to as a general hardware system, and the second hardware system may be referred to as a small core hardware system or a dedicated hardware system. Exemplarily, the first hardware system may include one or more processors (e.g., CPUs), accelerators, memories, I / O interfaces, and buses, etc.; the second hardware system may include one or more little cores and buses, etc.

[0071] Among them, the first hardware system can be used to achieve hardware and software integrity design, fault detection, fault recording and hardware error correction and suppression capabilities, etc. The second hardware system can be an independent power supply clock domain design, an independent bus design, a sensor IP, and a fault dual reporting capability. Compared with the first hardware system, the second hardware system can provide safer and more reliable fault detection, recording, error correction and error detection capabilities.

[0072] Figure 2 A structural diagram of a software layer of an electronic device provided in an embodiment of the present application, wherein the software layer runs on the hardware layer of the electronic device, and the software layer may include an EL3 layer and an EL1 layer, and the EL3 layer may also be referred to as a firmware layer.

[0073] Among them, the EL3 layer may include one or more firmwares. In a possible embodiment, taking the hardware layer of the electronic device including the first hardware system and the second hardware system as an example, the EL3 layer may include a first firmware running on the first hardware system, and a second firmware running on the second hardware system, and the first firmware may be a trusted firmware (trustfirmware, TF). In a possible example, the first firmware and the EL1 layer may communicate through the advanced platform error interface (advanced platform error interfaces, APEI), and the second firmware and the EL1 layer may communicate through the inter-processor error message (inter-processor error message, IPEM) interface.

[0074] The EL1 layer may include one or more of a kernel driver, an operating system (OS), a management framework, an operator, and an application. In a possible example, the EL1 layer may include a virtualization / OS framework, a device management framework, and a unified abnormal event reporting channel, and may also include related operators or applications for functions such as node isolation, fault repair / function degradation / plane switching / backup, self-driving system intrusion detection, single-machine warning, and maintenance testing.

[0075] In an embodiment of the present application, the hardware layer can be used to be responsible for fault detection, error correction and suppression, the EL3 layer can be used to provide a unified interrupt fault reporting interface, and is responsible for the interrupt counting and masking functions of the fault, and the EL1 layer can be used to be responsible for aggregating the interrupts reported by EL3 to the fault management framework, and at the same time perform different unmasking operations according to the unmasking strategy.

[0076] It is understandable that the above Figure 2 The structure of the software layer of the electronic device is illustrated by taking the hardware layer including the first hardware system and the second hardware system as an example, which does not constitute a limitation to the embodiments of the present application. The software layer may also include more or fewer software structures than shown in the figure, or a combination of certain software structures, or different software structure arrangements.

[0077] During the use of the above-mentioned electronic device, there is usually a situation where a large number of non-fatal errors (NFE) occur suddenly, and the non-fatal error may include a correctable error (CE) error and a non-fatal uncorrectable error. The non-fatal error is usually generated by a hardware module in the electronic device or chip, and the hardware module may be a CPU, a memory, an accelerator or other components. Exemplarily, the memory may be a memory, and the memory may be a double data rate synchronous dynamic random access memory (DDR SRAM) (DDR for short) or a high bandwidth memory (HBM). Taking memory as an example, there are usually two reasons for a large number of non-fatal errors. On the one hand, the fault area is large (for example, multiple pages of memory are abnormal at the same time), and on the other hand, the access frequency of the fault area is high, which mainly depends on the business scenario of the device and the cycle of memory fault inspection (for example, scrub inspection). These non-fatal errors will trigger a large number of interrupts, thereby affecting the access to normal services, and even the problem of system hang or firmware hang in the system.

[0078] In the related art, a strategy for implementing statistics and threshold control of correctable errors on hardware modules is provided. Specifically, for the CPU, the correctable errors occurring on all industrial input / output (IIO) submodules and ultra path interconnect (UPI) links are counted, and when the counted number reaches the threshold, the corresponding event is triggered; wherein, for the IIO submodule, the report can be made according to the system management interrupt (SMI), and for the UPI link, the report can be made according to the correctable system management interrupt (CSMI). For the memory, the correctable error statistics are made according to each bank in the memory, and the interrupt reporting is triggered by the funnel algorithm. The specific reporting can be SMI, non-maskable interrupt (NMI) or ERROR_N[0]. The above reporting is limited to platform use and is not visible to the operating system (OS) and virtual machine monitor (VMM).

[0079] This method achieves error statistics and threshold control through technical hardening, but has poor flexibility. At the same time, due to cost considerations, this method usually only supports key hardware modules, such as CPU and memory, in actual application, and does not perform hardened error counting and threshold control on all hardware modules, so this method is not effective.

[0080] Based on this, an embodiment of the present application provides an interrupt processing method, which can be used to, when a non-fatal error triggers multiple interrupts in a first time duration, according to the interrupt information and hierarchical shielding information of the multiple interrupts, shield the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time duration, the hierarchical shielding information is used to indicate multiple shielding objects, the hierarchical shielding information is used to indicate multiple shielding objects, the multiple shielding objects are obtained in layers, and the multiple shielding objects include the target shielding object, thereby avoiding the situation where a large number of non-fatal errors trigger a large number of interrupts, that is, suppressing the generation of interrupt storms, thereby solving the problem of system hang or firmware hang, and at the same time improving the flexibility of interrupt shielding.

[0081] In an embodiment of the present application, an interrupt may refer to a signal used to suspend the execution of the current program by the processor and switch to processing the program corresponding to the new situation. The interrupt may usually be triggered by a failure or error in the hardware module of the device, and the corresponding hardware module that triggers the interrupt may also be referred to as an interrupt source. An interrupt line may refer to a channel for transmitting an interrupt triggered by an interrupt source to an interrupt controller, and generally one interrupt source may correspond to multiple interrupt lines. An interrupt bit may also be an interrupt status flag, which is used to indicate the error type corresponding to the error that triggered the interrupt, and generally one interrupt line may correspond to multiple interrupt bits.

[0082] Figure 3 A schematic diagram of a structure of an interrupt processing method provided in an embodiment of the present application, the method may include the following steps. The method may be applied to an interrupt processing device, where the interrupt processing device includes a hardware layer, and firmware and a kernel driver running on the hardware layer. For example, the interrupt processing device may be the electronic device provided above.

[0083] S301: The firmware receives a plurality of interrupts in a first time period, where the plurality of interrupts are triggered when a non-fatal error occurs at a hardware layer.

[0084] The hardware layer includes multiple hardware modules, for example, the hardware modules may include processors, accelerators, memories, I / O units, sensors, buses, etc. Exemplarily, the processor may include a central processing unit (CPU), an application processor, and a general processor, etc.; the accelerator may include a digital signal processor (DSP), a network processor (NPU), a graphics processing unit (GPU), an image signal processor (ISP), a matrix computing unit, a video decoder (VDEC), and a video encoder (VENC), etc.; the memory may include a memory, for example, the memory may be DDR or HBM.

[0085] In addition, the non-fatal error may include a correctable error (CE) error and a non-fatal uncorrectable error. The non-fatal error is divided according to the reliability, availability and serviceability (RSA) specifications, and may include RSA specification errors and non-RSA specification errors. The non-fatal error may also include errors divided according to other protocol specifications, such as, the non-fatal error may also include a safety error.

[0086] In a possible embodiment, when multiple non-fatal errors occur in the hardware module in the hardware layer, each of the multiple non-fatal errors will trigger an interrupt, so that the multiple non-fatal errors can trigger multiple interrupts, so that the firmware can receive the multiple interrupts. Among them, the multiple non-fatal errors can be non-fatal errors that occur in the hardware module in the hardware layer within a first time length, and each non-fatal error triggers an interrupt, so that the firmware can receive multiple interrupts within the first time length. The above-mentioned first time length can be pre-set, for example, the first time length can be 5 seconds, 10 seconds or 20 seconds, etc. The embodiment of the present application does not limit the specific value of the first time length.

[0087] S302: The firmware masks the interruption of the target masking object corresponding to the multiple interruptions after the first duration according to the interruption information and hierarchical masking information of the multiple interruptions, the hierarchical masking information is used to indicate multiple masking objects, the multiple masking objects are obtained by hierarchical transmission of the interruptions, and the multiple masking objects include the target masking object.

[0088] The interruption information of the multiple interruptions may include the interruption information of each interruption in the multiple interruptions. The interruption information of the multiple interruptions may be obtained by the firmware according to the multiple interruptions. For example, the firmware may parse each interruption received to obtain the corresponding interruption information, or the firmware may obtain the interruption information of each interruption by querying. The embodiment of the present application does not impose any specific limitation on this.

[0089] Optionally, the interrupt information of each interrupt may include at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of a non-fatal error corresponding to the interrupt. The hardware module identifier is used to indicate the hardware module where the non-fatal error corresponding to the interrupt occurs; the interrupt line identifier is used to indicate the interrupt line that transmits the interrupt, for example, the interrupt line identifier may be an interrupt number. The error type of the non-fatal error corresponding to the interrupt may also be referred to as the error type corresponding to the interrupt or the fault type corresponding to the interrupt, and may be used to indicate the interrupt bit of a status register storing the interrupt. Exemplarily, the error type may include a single-bit error and a multi-bit error.

[0090] In addition, the multiple layers obtained by the stratification may include one or more of the hardware module layer, the interrupt line layer, and the interrupt bit layer. The multiple shielding objects may include one or more shielding objects in each layer. In a possible example, the multiple layers may include the hardware module layer, the interrupt line layer, and the interrupt bit layer. The shielding objects in the hardware module layer may include multiple different hardware modules, for example, the shielding objects in the hardware module layer include CPU, accelerator and memory. The shielding objects in the interrupt line layer may include multiple different interrupt lines, for example, the shielding objects in the interrupt line layer include multiple interrupt lines identified by different interrupt numbers. The shielding objects in the interrupt bit layer may include different interrupt bit layers, for example, the shielding objects in the interrupt bit layer include interrupt bits corresponding to different error types.

[0091] In a possible embodiment, the interruption information of each interruption can be used to indicate the shielding object corresponding to the interruption in multiple layers. The firmware shields the interruption of the target shielding object corresponding to the multiple interruptions after the first time length based on the interruption information and the layered shielding information of the multiple interruptions. It can include: when the multiple interruptions belong to the target shielding object among the multiple shielding objects, and the number of the multiple interruptions reaches a preset threshold corresponding to the target shielding object, the firmware shields the interruption of the target shielding object after the first time length.

[0092] Exemplarily, when the firmware receives an interrupt, the firmware can determine the hardware module, interrupt line and interrupt bit corresponding to the interrupt based on the hardware module identifier, interrupt number and error type in the interrupt information of the interrupt; then, the firmware can count the number of interrupts corresponding to each hardware module that triggers the interrupt, the number of interrupts corresponding to each interrupt line, and the number of interrupts corresponding to each interrupt bit according to different layers; when the number of interrupts corresponding to a certain hardware module reaches a preset threshold, the hardware module becomes the target shielding object, and the firmware shields the interrupts of the hardware module after the first time length; when the number of interrupts corresponding to a certain interrupt line reaches the preset threshold, the interrupt line becomes the target shielding object, and the firmware shields the interrupts of the interrupt line after the first time length; when the number of interrupts corresponding to a certain interrupt bit reaches the preset threshold, the interrupt bit becomes the target shielding object, and the firmware shields the interrupts of the interrupt bit after the first time length.

[0093] It can be understood that the preset thresholds corresponding to the shielding objects in the multiple layers may be the same or different, and the preset thresholds corresponding to different shielding objects in the same layer may also be the same or different. The specific settings can be made by technical personnel in this field according to actual needs, and the embodiments of the present application do not impose specific limitations on this.

[0094] S303: The firmware sends the interrupt information of the multiple interrupts to the kernel driver. S303 and S302 may be performed in any order. Figure 3 The example of S303 being located after S302 is used for explanation.

[0095] Optionally, the firmware may also send other information of each of the multiple interrupts to the kernel driver, for example, the other information may include an interrupt address and an interrupt priority, etc., which is not specifically limited in the embodiments of the present application. The interrupt information and other information of each interrupt may be sent together (i.e., sent once) or separately (i.e., sent multiple times).

[0096] In a possible embodiment, when the firmware receives each of the multiple interrupts, the firmware can also send interrupt information of the interrupt to the kernel driver in the process of counting and masking interrupts according to the relevant description in S302. Optionally, an operating system OS is also running on the hardware layer of the interrupt processing device, and the firmware can send the interrupt information of the interrupt to the operating system OS, and the operating system OS sends the interrupt information of the interrupt to the kernel driver.

[0097] S304: The kernel driver receives the interrupt information of the multiple interrupts and processes the multiple interrupts.

[0098] In a possible embodiment, for each of the multiple interrupts, when the kernel driver receives the interrupt information of the interrupt sent by the firmware, the kernel driver can process the interrupt according to the interrupt information, and process the next interrupt after the processing is completed until the multiple interrupts are processed.

[0099] In an embodiment of the present application, when the firmware receives multiple interrupts triggered by non-fatal errors in the first time period, it can send corresponding interrupt information to the kernel driver so that the kernel driver can process the multiple interrupts. At the same time, the firmware can also shield the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time period based on the interrupt information and hierarchical shielding information of the multiple interrupts. The hierarchical shielding information is used to indicate multiple shielding objects, and the multiple shielding objects are obtained by layering the transmission of interrupts. The multiple shielding objects include the target shielding object, thereby avoiding the situation where a large number of non-fatal errors trigger a large number of interrupts through the hierarchical shielding strategy, thereby solving the problem of system hang or firmware hang, and improving the flexibility of interrupt shielding.

[0100] Further, the hardware layer of the interrupt processing device includes a first hardware system, the firmware includes a first firmware running on the first hardware system, the non-fatal error includes an RSA specification error and / or a security error, and the first firmware can be used to shield the shielding object corresponding to the RSA specification error and / or the security error. That is, the first firmware can receive multiple interrupts triggered by RSA specification errors and / or security errors, and shield the interrupts of the target shielding objects corresponding to the multiple interrupts according to the interrupt information and hierarchical shielding information of the multiple interrupts. Optionally, the first firmware communicates with the kernel driver through an advanced platform fault interface APEI, so that the first firmware can send interrupt information to the kernel driver through APEI, and the kernel driver processes the interrupt corresponding to the RSA specification error and / or the security error.

[0101] In another possible embodiment, the hardware layer of the interrupt processing device also includes a second hardware system, the firmware also includes a second firmware running on the second hardware system, the non-fatal error includes a non-RSA specification error, and the second firmware is used to shield the shielding object corresponding to the non-RSA specification error. That is, the second firmware can receive multiple interrupts triggered by non-RSA specification errors, and according to the interrupt information and hierarchical shielding information of the multiple interrupts, shield the interrupts of the target shielding objects corresponding to the multiple interrupts. Optionally, the second firmware communicates with the kernel driver through the inter-core error message IPEM interface, so that the second firmware can send interrupt information to the kernel driver through the IPEM interface, and the kernel driver processes the interrupt corresponding to the non-RSA specification error.

[0102] Further, such as Figure 4 As shown, after S304, the method further includes: S305a and S305b.

[0103] S305a: For the RSA standard error, the kernel driver unshields the shielded objects among the multiple shielded objects after a second delay. That is, for the interrupt triggered by the RSA standard error, the first firmware shields the multiple shielded objects, and the kernel driver unshields the multiple shielded objects.

[0104] Optionally, for a security error, the kernel driver may also unmask a masked object among the multiple masked objects after delaying for a second period of time.

[0105] S305b: For non-RSA standard errors, the second firmware unshields the shielded objects among the multiple shielded objects after a second delay. That is, for interrupts triggered by non-RSA standard errors, the second firmware shields and unshields the multiple shielded objects.

[0106] Among them, the second duration can be pre-set, for example, the second duration can be 5 minutes, 8 minutes or 10 minutes, etc., and the embodiment of the present application does not limit the specific value of the second duration. In addition, the second durations of the delay of shielded objects in different layers during unshielding can be the same or different, and the second durations of the delay of different shielded objects in the same layer can also be the same or different. Exemplarily, the second duration of the delay corresponding to the hardware module can be 8 minutes, and the second duration of the delay corresponding to the interrupt line can be 5 minutes; or, the second duration of the delay corresponding to the CPU in the hardware module can be 5 minutes, and the second duration of the delay corresponding to the memory can be 8 minutes.

[0107] In a possible embodiment, when the kernel driver unshields the masked shielded object, it can delay for a second time after the last interrupt of multiple interrupts is processed, and then unshield the masked shielded object. Exemplarily, when the CPU in the hardware module has multiple non-fatal errors in a first time and triggers multiple interrupts, and the firmware shields the interrupts of the CPU after the first time, the kernel driver can delay for a second time after processing the last interrupt of the multiple interrupts triggered by the CPU, and then unshield the CPU.

[0108] In another possible embodiment, when the kernel driver unshields the masked shielded object, the kernel driver can unshield the masked shielded object in a polling manner. Exemplarily, the firmware sequentially shields the CPU interrupt, the memory interrupt and the I / O unit interrupt in the hardware module, then the kernel driver can unshield in the following polling manner, specifically including: unshielding the CPU after the CPU interrupt is masked for a second time period, unshielding the memory after the memory interrupt is masked for a second time period, and unshielding the I / O unit after the I / O unit interrupt is masked for a second time period.

[0109] Optionally, when a shielded shielded object among the shielded objects in the different layers will cause the interrupt processing device to be unavailable after unshielding, or the interrupt processing device needs to be reset when unshielding, the kernel driver may not unshield the shielded object. When a shielded shielded object among the shielded objects in the different layers will not affect the use of the interrupt processing device after unshielding, or the interrupt processing device does not need to be reset, the kernel driver may unshield the shielded shielded object according to the relevant description of unshielding in the above text.

[0110] In an embodiment of the present application, the kernel driver unshields the shielded shielded objects among the multiple shielded objects after the second time period, thereby avoiding the system or firmware hang caused by a large number of non-fatal error-triggered interrupts, while not affecting the kernel driver's processing of interrupts triggered by later non-fatal errors, thereby ensuring user experience. In addition, in the above possible implementations, when the impact of the interrupt after the first time period is large, by performing unshielding after the last interrupt among the multiple interrupts is completed, the shielding can be unshielded as soon as possible, thereby reducing the impact of the shielded interrupt; when the impact of the interrupt after the first time period is small, performing unshielding in a polling manner can avoid the interrupt of a certain shielded object after the first time period from being shielded for a long time, thereby ensuring the performance of different shielded objects.

[0111] To facilitate understanding, the following Figure 5 and Figure 6 , respectively, from different levels and angles, the solutions provided in the embodiments of the present application are illustrated.

[0112] In a possible embodiment, Figure 5 As shown, the interrupt processing device includes an EL1 layer and an EL3 layer, the EL1 layer includes an operating system OS and a kernel driver, and the EL3 layer includes a first firmware and a second firmware. For an RSA specification error, the method may include: when an RSA specification error occurs in the hardware layer and triggers an interrupt, the first firmware receives the interrupt triggered by the RSA specification error, and masks the masked objects in different layers according to the hierarchical masking strategy described in S302 above, and the hierarchical masking may include masking according to hardware modules, interrupt lines, and interrupt bits; the first firmware sends the interrupt information corresponding to the interrupt to the kernel driver through the operating system OS, and the kernel driver processes the interrupt and unmasks it according to the unmasking strategy, and the unmasking strategy may include unmasking after a certain delay after the last interrupt is processed, or unmasking in a polling manner. For non-RSA specification errors, the method may include: when a non-RSA specification error occurs in the hardware layer and triggers an interrupt, the second firmware receives the interrupt triggered by the non-RSA specification error, and masks the masked objects in different layers according to the hierarchical masking strategy described in S302 above, and the hierarchical masking may include masking according to hardware modules, interrupt lines and interrupt bits; the second firmware unmasks according to the unmasking strategy, and the unmasking strategy may include unmasking after a certain delay after the last interrupt is processed, or unmasking in a polling manner.

[0113] In another possible embodiment, Figure 6As shown, the interrupt processing device includes a hardware layer, and a small core firmware, a trusted firmware TF, an operating system OS and a kernel driver running on the hardware layer; the trusted firmware TF includes a monitor and RAS firmware, the kernel driver includes a device management module and various management drivers, and the device management module includes a fault distribution driver. Optionally, the interrupt processing device may also include a user state driver, and the user state driver includes a device management interface library.

[0114] For an RSA specification error, the method may include: S1. an RSA specification error source at a hardware layer triggers a serial peripheral interface (SPI) interrupt; S2. when a monitor in a trusted firmware receives the SPI interrupt, the monitor submits a RAS record read to a RAS firmware, so that after the RSA specification error source writes the RAS record, the RAS firmware can read the RAS record, i.e., count the number of RAS specification errors (or triggered interrupts); S3. the RAS firmware generates an APEI table entry (i.e., interrupt information sent via the APEI), where APEI table entry × N represents the generated APEI table entry; S4. a software interrupt notifies an operating system OS; S5. the operating system OS reads the APEI table entry; S6. the operating system OS notifies a device management module of a fault (i.e., a RAS specification error); and S7. a fault distribution driver in the device management module distributes the fault to various management drivers, so that various management drivers perform RAS error processing. The above-mentioned trusted firmware serves as interrupt suppression point 1, and can shield shielded objects in different layers according to the layered shielding strategy; various management drivers serve as interrupt suppression point 2, and can unshield shielded objects in different layers according to the unshielding strategy.

[0115] For non-RSA specification errors, the small core firmware can receive the interrupt triggered by the non-RSA specification error, and shield the shielded objects in different layers according to the hierarchical shielding strategy described in S302 above, and can also unshield them according to the unshielding strategy. For the interrupt that has been received, the small core firmware can also send interrupt information to various management drivers so that various management drivers can perform interrupt processing for non-RAS errors. The above-mentioned small core firmware acts as interrupt suppression point 3, and can shield the shielded objects in different layers according to the hierarchical shielding strategy, and unshield the shielded objects in different layers according to the unshielding strategy.

[0116] Above Figure 5 and Figure 6 The RSA specification error source in the _ indicates the hardware module where the RSA specification error occurs, and the non-RSA specification error source indicates the hardware module where the non-RSA specification error occurs.

[0117] In an embodiment of the present application, when the firmware receives multiple interrupts triggered by non-fatal errors in the first time period, it can send corresponding interrupt information to the kernel driver so that the kernel driver processes the multiple interrupts. At the same time, the firmware can also shield the interrupts of the target shielding objects corresponding to the multiple interrupts after the first time period according to the interrupt information and hierarchical shielding information of the multiple interrupts. The hierarchical shielding information is used to indicate multiple shielding objects, and the multiple shielding objects are obtained by layering, thereby avoiding the situation where a large number of non-fatal errors trigger a large number of interrupts through the strategy of layered shielding, thereby solving the problem of system or firmware hanging. In addition, after a certain period of time, the kernel driver can unshield the shielded shielding objects in the shielding objects in the different layers, so that while avoiding the system or firmware hanging caused by the interrupts triggered by a large number of non-fatal errors, it does not affect the kernel driver's processing of the interrupts triggered by the later non-fatal errors, thereby ensuring the user experience.

[0118] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the interaction between the firmware and the kernel driver. It is understandable that, in order to realize the above functions, the interrupt processing device includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0119] The embodiment of the present application can divide the functional modules of the interrupt processing device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above functional modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The following is an example of dividing each functional module according to the corresponding function:

[0120] Figure 7This is a schematic diagram of the structure of an interrupt processing device provided in an embodiment of the present application. The interrupt processing device can be applied to firmware, and the firmware is used to run on the hardware layer. The device includes: a receiving unit 401, a processing unit 402, and a sending unit 403. Among them, the receiving unit 401 is used to execute S301 in the above method embodiment of the device; the processing unit 402 is used to execute S302, S305b in the above method embodiment of the device, and / or other technical processes described in this document; the sending unit 403 is used to execute S303 in the above method embodiment of the device.

[0121] It can be understood that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and the embodiment of the present application will not be repeated here.

[0122] Figure 8 This is a schematic diagram of the structure of another interrupt processing device provided in an embodiment of the present application, the interrupt processing device can be applied to a kernel driver, the kernel driver is used to run on a hardware layer, and the device includes: a receiving unit 501 and a processing unit 502. The receiving unit 501 is used to execute S304 in the above method embodiment of the device, and / or other technical processes described herein; the processing unit 502 is used to execute S305a in the above method embodiment of the device.

[0123] It can be understood that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and the embodiment of the present application will not be repeated here.

[0124] Fig. 9 A schematic diagram of the structure of an interrupt processing device provided in an embodiment of the present application, the interrupt processing device includes a hardware layer, and firmware and a kernel driver running on the hardware layer. The hardware layer may include but is not limited to: a memory, a processor, an I / O unit, and a bus. In the interrupt processing device, the firmware can be used to execute the steps of the firmware in the above method embodiment, and the kernel driver can be used to execute the steps of the kernel driver in the above method embodiment.

[0125] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0126] In another embodiment of the present application, Fig.10As shown, an interrupt processing device is also provided, the interrupt processing device includes a processor and a memory, the memory stores instructions, and the processor runs the instructions in the memory to make the interrupt processing device execute any one of the interrupt processing methods provided above. Optionally, the interrupt processing device may also include an I / O unit and a bus, and the processor, the memory and the I / O unit are coupled through the bus.

[0127] Among them, the processor can be a central processing unit, a general processor, a baseband processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0128] In another embodiment of the present application, Fig.11 As shown, a chip is also provided, which includes a processor and an interface circuit, wherein the interface circuit is used to support the processor to communicate, and when the processor runs instructions in the memory, the chip executes the interrupt processing method provided above.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0130] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium, which can include: a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., which can store program codes. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, be embodied in the form of a software product, in part or in part, as a contribution to the prior art.

[0133] In another embodiment of the present application, a computer-readable storage medium is also provided, in which instructions are stored. When a device (which may be a single-chip microcomputer, chip or electronic device, etc.) or a processor executes the steps of the firmware in the above method embodiment.

[0134] In another embodiment of the present application, a computer-readable storage medium is also provided, in which instructions are stored. When a device (which may be a single-chip microcomputer, chip or electronic device, etc.) or a processor executes the kernel driving steps in the above method embodiment.

[0135] In another embodiment of the present application, a computer program product is provided. The computer program product includes computer execution instructions. When at least one processor of a device executes the instructions, the device performs the steps of the firmware in the above method embodiment.

[0136] In another embodiment of the present application, a computer program product is provided. The computer program product includes computer execution instructions. When at least one processor of a device executes the instructions, the device performs the kernel driving steps in the above method embodiment.

[0137] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An interrupt processing method, characterized in that: Applied in firmware, the firmware is used to run on a hardware layer, the method includes: The firmware receives a plurality of interrupts in a first duration, wherein the plurality of interrupts are triggered when a non-fatal error occurs in the hardware layer; The firmware masks interruptions of target masking objects corresponding to the multiple interruptions after the first duration according to the interruption information and hierarchical masking information of the multiple interruptions, wherein the hierarchical masking information is used to indicate multiple masking objects, the multiple masking objects are obtained by hierarchically performing transmission of interruptions, and the multiple masking objects include the target masking object; The firmware sends interrupt information of the multiple interrupts to a kernel driver.

2. The method according to claim 1, characterized in that The plurality of shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting an interrupt, and an interrupt bit of a status register for storing an interrupt.

3. The method according to claim 1 or 2, characterized in that: The firmware masks interrupts of target masking objects corresponding to the multiple interrupts after the first duration according to the interrupt information and hierarchical masking information of the multiple interrupts, including: The interrupt information of each interrupt is used to indicate the shielding object corresponding to the interrupt. When the multiple interrupts belong to the target shielding object and the number of the multiple interrupts reaches a preset threshold corresponding to the target shielding object, the firmware shields the interrupt of the target shielding object after the first time length.

4. The method according to claim 3, characterized in that The interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to an interrupt bit.

5. The method according to claim 4, characterized in that The method further comprises: When the interrupt information includes the hardware module identifier, the firmware determines the hardware module to which each interrupt belongs according to the hardware module identifier in the interrupt information of each interrupt; and / or, When the interrupt information includes the interrupt line identifier, the firmware determines the interrupt line to which each interrupt belongs according to the interrupt line identifier in the interrupt information of each interrupt; and / or, When the interrupt information includes the error type of the non-fatal error corresponding to the interrupt bit, the firmware determines the interrupt bit to which each interrupt belongs according to the error type in the interrupt information of each interrupt.

6. The method according to any one of claims 1 to 5, characterized in that: The hardware layer includes a first hardware system, the firmware includes a first firmware running on the first hardware system, the non-fatal errors include RSA specification errors and / or security errors, and the first firmware is used to shield shielding objects corresponding to the RSA specification errors and / or security errors.

7. The method according to any one of claims 1 to 6, characterized in that: The hardware layer also includes a second hardware system, the firmware also includes a second firmware running on the second hardware system, the non-fatal error includes a non-RSA standard error, and the second firmware is used to shield a shielding object corresponding to the non-RSA standard error.

8. The method according to claim 7, characterized in that For the non-RSA specification error, the method further includes: The second firmware unshields the shielded shielded objects among the plurality of shielded objects after delaying for a second time period.

9. The method according to claim 8, characterized in that The unmasking is performed after the last interrupt processing of the multiple interrupts is completed; or, the unmasking is performed in a polling manner.

10. An interrupt processing method, characterized in that: Applied in a kernel driver, the kernel driver is used to run on a hardware layer, and the method includes: The kernel driver receives interrupt information of multiple interrupts sent by the firmware, the multiple interrupts are received by the firmware in a first time period, and the multiple interrupts are triggered when a non-fatal error occurs in the hardware layer; The kernel driver processes the multiple interrupts according to the interrupt information of the multiple interrupts; Among them, the target shielding objects corresponding to the multiple interrupts are shielded by the firmware after the first time length, and the firmware is shielded according to the interrupt information and hierarchical shielding information of the multiple interrupts. The multiple shielding objects are obtained by layering the transmission of interrupts, and the multiple shielding objects include the target shielding object.

11. The method according to claim 10, characterized in that The plurality of shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting an interrupt, and an interrupt bit of a status register for storing an interrupt.

12. The method according to claim 10 or 11, characterized in that: The interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to an interrupt bit.

13. The method according to any one of claims 10 to 12, characterized in that: The non-fatal error includes an RSA specification error and / or a security error, and the method further includes: The kernel driver unmasks the masked masked objects among the multiple masked objects after delaying for a second time period.

14. The method according to claim 13, characterized in that The unmasking is performed after the last interrupt processing of the multiple interrupts is completed; or, the unmasking is performed in a polling manner.

15. An interrupt processing device, characterized in that: Applied in firmware, the firmware is used to run on a hardware layer, and the device includes: A receiving unit, configured to receive a plurality of interrupts in a first duration, wherein the plurality of interrupts are triggered when a non-fatal error occurs in the hardware layer; a processing unit, configured to shield the interruption of the target shielding objects corresponding to the multiple interruptions after the first duration according to the interruption information and hierarchical shielding information of the multiple interruptions, wherein the hierarchical shielding information is used to indicate multiple shielding objects, the multiple shielding objects are obtained by hierarchically performing transmission of the interruption, and the multiple shielding objects include the target shielding object; The sending unit is used to send the interrupt information of the multiple interrupts to the kernel driver.

16. The device according to claim 15, characterized in that The plurality of shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting an interrupt, and an interrupt bit of a status register for storing an interrupt.

17. The device according to claim 15 or 16, characterized in that The processing unit is also used for: The interruption information of each interruption is used to indicate the shielding object corresponding to the interruption. When the multiple interruptions belong to the target shielding object and the number of the multiple interruptions reaches the preset threshold corresponding to the target shielding object, the interruption of the target shielding object after the first duration is shielded.

18. The device according to claim 17, characterized in that The interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to an interrupt bit.

19. The device according to claim 18, characterized in that The processing unit is also used for: When the interrupt information includes the hardware module identifier, determining the hardware module to which each interrupt belongs according to the hardware module identifier in the interrupt information of each interrupt; and / or, When the interruption information includes the interruption line identifier, determining the interruption line to which each interruption belongs according to the interruption line identifier in the interruption information of each interruption; and / or, When the interrupt information includes the error type of the non-fatal error corresponding to the interrupt bit, the interrupt bit to which each interrupt belongs is determined according to the error type in the interrupt information of each interrupt.

20. The device according to any one of claims 15 to 19, characterized in that The hardware layer includes a first hardware system, the firmware includes a first firmware running on the first hardware system, the non-fatal errors include RSA specification errors and / or security errors, and the first firmware is used to shield shielding objects corresponding to the RSA specification errors and / or security errors.

21. The device according to any one of claims 15 to 20, characterized in that The hardware layer also includes a second hardware system, the firmware also includes a second firmware running on the second hardware system, the non-fatal error includes a non-RSA standard error, and the second firmware is used to shield a shielding object corresponding to the non-RSA standard error.

22. The device according to claim 21, characterized in that For the non-RSA specification error, the processing unit is further configured to: After a delay of a second time period, the masked masked objects among the plurality of masked objects are unmasked.

23. The device according to claim 22, characterized in that The unmasking is performed after the last interrupt processing of the multiple interrupts is completed; or, the unmasking is performed in a polling manner.

24. An interrupt processing device, characterized in that: Applied to a kernel driver, the kernel driver is used to run on a hardware layer, and the device includes: A receiving unit, configured to receive interrupt information of a plurality of interrupts sent by the firmware, wherein the plurality of interrupts are received by the firmware in a first time period, and the plurality of interrupts are triggered when a non-fatal error occurs in the hardware layer; a processing unit, configured to process the plurality of interruptions according to the interruption information of the plurality of interruptions; Among them, the target shielding objects corresponding to the multiple interrupts are shielded by the firmware after the first time length, and the firmware is shielded according to the interrupt information and hierarchical shielding information of the multiple interrupts. The multiple shielding objects are obtained by layering the transmission of interrupts, and the multiple shielding objects include the target shielding object.

25. The device according to claim 24, characterized in that The plurality of shielding objects include at least one of the following: a hardware module in the hardware layer, an interrupt line for transmitting an interrupt, and an interrupt bit of a status register for storing an interrupt.

26. The device according to claim 24 or 25, characterized in that The interrupt information includes at least one of the following: a hardware module identifier, an interrupt line identifier, and an error type of the non-fatal error corresponding to an interrupt bit.

27. The device according to any one of claims 24 to 26, characterized in that The non-fatal error includes an RSA specification error and / or a security error, and the processing unit is further configured to: After a delay of a second time period, the masked masked objects among the plurality of masked objects are unmasked.

28. The device according to claim 27, characterized in that The unmasking is performed after the last interrupt processing of the multiple interrupts is completed; or, the unmasking is performed in a polling manner.

29. An interrupt processing device, characterized in that: The interrupt processing device includes a hardware layer, and firmware and a kernel driver running on the hardware layer, the firmware includes the interrupt processing device as described in any one of claims 15-23, and the kernel driver includes the interrupt processing device as described in any one of claims 24-28.

30. An interrupt processing device, characterized in that: The interrupt processing device comprises a processor and a memory, wherein instructions are stored in the memory, and the processor runs the instructions in the memory so that the device executes the interrupt processing method according to any one of claims 1 to 14.

31. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by a device, the device executes the interrupt processing method according to any one of claims 1 to 14.

Citation Information

Cited By

  • Interrupt processing method and device, electronic equipment and storage medium

    CN120743480A

  • Interrupt handling method, apparatus and device

    EP4738113A1

  • Interrupt handling method, apparatus and device

    WO2025020495A1