CN115185734A - Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium - Google Patents

Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium Download PDF

Info

Publication number
CN115185734A
CN115185734A CN202210880287.6A CN202210880287A CN115185734A CN 115185734 A CN115185734 A CN 115185734A CN 202210880287 A CN202210880287 A CN 202210880287A CN 115185734 A CN115185734 A CN 115185734A
Authority
CN
China
Prior art keywords
firmware
interrupt
running
unit
analyzing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210880287.6A
Other languages
Chinese (zh)
Inventor
周维
罗宗扬
张佳磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Yilian Information System Co Ltd
Original Assignee
Suzhou Yilian Information System Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Yilian Information System Co Ltd filed Critical Suzhou Yilian Information System Co Ltd
Priority to CN202210880287.6A priority Critical patent/CN115185734A/en
Publication of CN115185734A publication Critical patent/CN115185734A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0721Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment within a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a firmware abnormity diagnosis method based on interrupt, a device, a computer device and a storage medium, wherein the method comprises the following steps: running the firmware; judging whether the running firmware enters a loop death state or not; if the running firmware enters the endless loop state, triggering external interruption to enable the CPU to enter an interruption mode; dumping a user call stack according to the interrupt mode; and analyzing the call path according to the call stack to obtain an analysis result. The invention stores the user call stack in the interrupt mode by triggering the interrupt, thereby analyzing and obtaining the call path and the transmitted parameters of the firmware and finding out the design defects of the firmware.

Description

Firmware abnormity diagnosis method and device based on interrupt, computer equipment and storage medium
Technical Field
The present invention relates to the field of firmware exception diagnosis technologies, and in particular, to a firmware exception diagnosis method and apparatus based on an interrupt, a computer device, and a storage medium.
Background
Without a debugger, a logical exception to firmware is often difficult to analyze and locate. For example, due to the defect of firmware design, under the trigger of a certain command sequence, the firmware enters a dead-cycle state, and the CPU cannot respond to the external request and cannot acquire further diagnostic information.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a firmware abnormity diagnosis method and device based on interruption, computer equipment and a storage medium.
In order to solve the technical problems, the invention adopts the following technical scheme:
in a first aspect, the present embodiment provides an interrupt-based firmware exception diagnosis method, including the following steps:
running the firmware;
judging whether the running firmware enters a loop death state or not;
if the running firmware enters a loop-locked state, triggering external interruption to enable the CPU to enter an interruption mode;
dumping a user call stack according to the interrupt mode;
and analyzing the call path according to the call stack to obtain an analysis result.
The further technical scheme is as follows: after the step of judging whether the running firmware enters the endless loop state, the method further comprises the following steps: and if the running firmware does not enter the endless loop state, skipping to execute the running firmware.
The further technical scheme is as follows: and triggering external interrupt to enable the CPU to enter an interrupt mode step, and triggering the external interrupt by pulling low or high GPIO or sending IPC information through other CPUs.
The further technical scheme is as follows: after the step of analyzing the call path according to the call stack to obtain the analysis result, the method further comprises the following steps: and analyzing the reason of the firmware entering the endless loop according to the analysis result.
In a second aspect, the present embodiment provides an interrupt-based firmware abnormality diagnosis apparatus, including: the system comprises an operation unit, a judgment unit, a trigger entry unit, a calling unit and an analysis unit;
the running unit is used for running the firmware;
the judging unit is used for judging whether the running firmware enters a closed loop state;
the trigger entering unit is used for triggering external interruption if the running firmware enters a dead cycle state so as to enable the CPU to enter an interruption mode;
the call unit is used for dumping a user call stack according to the interrupt mode;
and the analysis unit is used for analyzing the call path according to the call stack to obtain an analysis result.
The further technical scheme is as follows: further comprising: and the skipping unit is used for skipping to execute the running firmware if the running firmware does not enter a dead loop state.
The further technical scheme is as follows: and in the triggering entry unit, an external interrupt is triggered by pulling low or high GPIO or sending IPC information through other CPUs.
The further technical scheme is as follows: further comprising: and the analysis unit is used for analyzing the reason of the firmware entering the endless loop according to the analysis result.
In a third aspect, the present embodiment provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the interrupt-based firmware abnormality diagnosis method when executing the computer program.
In a fourth aspect, the present embodiment provides a storage medium storing a computer program comprising program instructions that, when executed by a processor, may implement the interrupt-based firmware exception diagnostic method as described above.
Compared with the prior art, the invention has the beneficial effects that: and storing the user call stack in the interrupt mode by triggering interrupt, so as to analyze and obtain a call path and transmitted parameters of the firmware and find out the design defects of the firmware.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a method for diagnosing an exception of firmware based on an interrupt according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of an interrupt-based firmware exception diagnosis apparatus provided by an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to the embodiment shown in fig. 1, the present invention discloses a firmware exception diagnosis method based on interrupt, which includes the following steps:
s1, running firmware;
specifically, the firmware is SSD firmware. And running firmware to enable GPIO interruption and IPC interruption of the CPU.
S2, judging whether the running firmware enters a closed loop state;
specifically, whether the running firmware enters a loop-dead state is discriminated by judging whether the firmware responds to an external request.
Specifically, after the step S2, the method further includes: and if the running firmware does not enter the endless loop state, skipping to execute the step S1.
Specifically, the closed loop state is no longer in response to external requests.
S3, if the running firmware enters the endless loop state, triggering external interruption to enable the CPU to enter an interruption mode;
specifically, in step S3, an external interrupt is triggered by pulling low or high a GPIO (General Purpose Input/Output Port) or sending IPC (inter-processor communication module) information through another CPU.
S4, dumping a user call stack according to the interrupt mode;
specifically, after entering the interrupt mode, a stack pointer and stack contents of a user mode (user mode) are acquired and printed and saved through a serial port.
And S5, analyzing the call path according to the call stack to obtain an analysis result.
Specifically, according to the stack pointer and the stack content of the user mode, a firmware calling path and transmitted parameters are obtained through analysis, assistance is provided for firmware abnormity diagnosis, and firmware design defects are found out.
Specifically, after the step S5, the method further includes: and analyzing the reason of the firmware entering the endless loop according to the analysis result. For example: due to the deficiencies of firmware design, the firmware enters a state of dead cycling under certain command sequence triggers.
The invention stores the user call stack in the interrupt mode by triggering the interrupt, thereby analyzing and obtaining the call path and the transmitted parameters of the firmware and finding out the design defects of the firmware.
Referring to fig. 2, the present invention also discloses an interrupt-based firmware exception diagnosis apparatus, including: the system comprises an operation unit 10, a judgment unit 20, a trigger entering unit 30, a calling unit 40 and an analysis unit 50;
the running unit 10 is used for running firmware;
the judging unit 20 is configured to judge whether the running firmware enters a loop death state;
the trigger entering unit 30 is configured to trigger external interrupt if the running firmware enters an endless loop state, so that the CPU enters an interrupt mode;
the calling unit 40 is configured to dump a user call stack according to the interrupt mode;
the analysis unit 50 is configured to analyze the call path according to the call stack to obtain an analysis result.
Wherein, the device still includes: and the skipping unit is used for skipping to execute the running firmware if the running firmware does not enter the endless loop state.
In the trigger entry unit 30, external interrupt is triggered by pulling GPIO low or high, or by sending IPC information through another CPU.
Wherein, the device still includes: and the analysis unit is used for analyzing the reason of the firmware entering the endless loop according to the analysis result.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation processes of the firmware abnormality diagnosis apparatus based on interrupt and each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and conciseness of description, no further description is provided herein.
The above-described firmware abnormality diagnosis apparatus based on an interrupt may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 3.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application; the computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 3, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032 include program instructions that, when executed, cause the processor 502 to perform an interrupt-based firmware exception diagnostic method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute an interrupt-based firmware abnormality diagnosis method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 3 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
step S1, running firmware;
s2, judging whether the running firmware enters a loop death state or not;
s3, if the running firmware enters a dead cycle state, triggering external interruption to enable the CPU to enter an interruption mode;
s4, dumping a user call stack according to the interrupt mode;
and S5, analyzing the call path according to the call stack to obtain an analysis result.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program comprises program instructions that, when executed by a processor, implement the interrupt-based firmware exception diagnostic method described above. The storage medium stores a computer program comprising program instructions which, when executed by a processor, implement the method described above. The program instructions include the steps of:
step S1, running firmware;
s2, judging whether the running firmware enters a loop death state or not;
step S3, if the running firmware enters the endless loop state, external interruption is triggered to enable the CPU to enter an interruption mode;
s4, dumping a user call stack according to the interrupt mode;
and S5, analyzing the call path according to the call stack to obtain an analysis result.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
The above embodiments are preferred implementations of the present invention, and the present invention can be implemented in other ways without departing from the spirit of the present invention.

Claims (10)

1. The firmware abnormity diagnosis method based on the interrupt is characterized by comprising the following steps:
running the firmware;
judging whether the running firmware enters a loop death state or not;
if the running firmware enters the endless loop state, triggering external interruption to enable the CPU to enter an interruption mode;
dumping a user call stack according to the interrupt mode;
and analyzing the call path according to the call stack to obtain an analysis result.
2. The interrupt-based firmware exception diagnosis method according to claim 1, wherein after the step of determining whether the running firmware enters the loop-death state, the method further comprises: and if the running firmware does not enter the endless loop state, skipping to execute the running firmware.
3. The interrupt-based firmware exception diagnosis method as claimed in claim 1, wherein the step of triggering external interrupt to make CPU enter interrupt mode triggers external interrupt by pulling GPIO low or high, or by other CPUs sending IPC information.
4. The interrupt-based firmware exception diagnosis method according to claim 1, wherein after the step of analyzing the call path according to the call stack to obtain the analysis result, the method further comprises: and analyzing the reason of the firmware entering the endless loop according to the analysis result.
5. An interrupt-based firmware abnormality diagnosis apparatus, comprising: the operation unit, the judgment unit, the triggering entry unit, the calling unit and the analysis unit;
the running unit is used for running the firmware;
the judging unit is used for judging whether the running firmware enters a closed loop state;
the trigger entering unit is used for triggering external interruption if the running firmware enters a dead cycle state so as to enable the CPU to enter an interruption mode;
the call unit is used for dumping a user call stack according to the interrupt mode;
and the analysis unit is used for analyzing the call path according to the call stack to obtain an analysis result.
6. The interrupt-based firmware abnormality diagnostic apparatus according to claim 5, characterized by further comprising: and the skipping unit is used for skipping to execute the running firmware if the running firmware does not enter a dead loop state.
7. The interrupt-based firmware abnormality diagnosis device according to claim 5, characterized in that the trigger entering unit triggers external interrupt by pulling GPIO low or high, or by other CPU sending IPC information.
8. The interrupt-based firmware abnormality diagnostic apparatus according to claim 5, characterized by further comprising: and the analysis unit is used for analyzing the reason of the firmware entering the endless loop according to the analysis result.
9. A computer device comprising a memory having a computer program stored thereon and a processor that, when executing the computer program, implements the interrupt-based firmware exception diagnostic method of any one of claims 1-4.
10. A storage medium storing a computer program comprising program instructions which, when executed by a processor, implement the interrupt-based firmware exception diagnostic method of any one of claims 1-4.
CN202210880287.6A 2022-07-25 2022-07-25 Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium Pending CN115185734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210880287.6A CN115185734A (en) 2022-07-25 2022-07-25 Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210880287.6A CN115185734A (en) 2022-07-25 2022-07-25 Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115185734A true CN115185734A (en) 2022-10-14

Family

ID=83520386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210880287.6A Pending CN115185734A (en) 2022-07-25 2022-07-25 Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115185734A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115495275A (en) * 2022-11-16 2022-12-20 合肥康芯威存储技术有限公司 Storage system and control method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115495275A (en) * 2022-11-16 2022-12-20 合肥康芯威存储技术有限公司 Storage system and control method thereof

Similar Documents

Publication Publication Date Title
CA2856268C (en) Methods of detection of software exploitation
WO2019161619A1 (en) Automatic interface test method and apparatus, and device and computer-readable storage medium
US7783865B2 (en) Conditional data watchpoint management
CN111862187B (en) Cup-to-tray ratio determining method, device, equipment and storage medium based on neural network
US7793160B1 (en) Systems and methods for tracing errors
CN110995539A (en) Business system monitoring method and device and computer equipment
CN115185734A (en) Firmware abnormity diagnosis method and device based on interruption, computer equipment and storage medium
WO2019134223A1 (en) Log generation method and apparatus, computer device and storage medium
CN111176987A (en) Method and device for uniformly outputting front-end log, computer equipment and storage medium
CN106445698B (en) Method and device for acquiring step counting data
CN112257106B (en) Data detection method and device
CN116414632A (en) Fault positioning method of system-on-chip, equipment and storage medium
CN110727537A (en) Method and device for uniformly processing response message, computer equipment and storage medium
CN113886490A (en) Method and system for realizing high availability of stateless computing instances in distributed database
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN112052054A (en) Function calling method and device, electronic equipment and storage medium
CN112817922A (en) Log dynamic printing method and device, computer equipment and storage medium
CN115687159B (en) Debugging method, debugging device and computer readable storage medium
CN113886186B (en) Processor exception tracking system and method
CN112416695B (en) Global variable monitoring method, device, equipment and storage medium
CN112989289B (en) Software license checking method and device, electronic equipment and readable storage medium
CN113094082B (en) Method, device and storage medium for determining micro-service dependency relationship
CN115827287A (en) Statistical method and device for SSD long-stability test result, computer equipment and storage medium
CN114153684A (en) Component monitoring method, device and medium
JPH11143789A (en) Bus tracing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination