Fault positioning method and device, electronic equipment and storage medium

By analyzing the SMMU system log, acquiring event information and determining event identification, automatic positioning of SMMU faults is realized, solving the problem of low positioning efficiency in the prior art, and improving fault positioning efficiency and information acquisition.

CN119690717APending Publication Date: 2025-03-25PHYTIUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411736495.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, SMMU fault location efficiency is low, manual needs to view system logs and compare them with SMMU feature documents, and there is a lack of tools specifically for SMMU fault location.

Method used

Provide a fault location method, which realizes automatic positioning by obtaining the SMMU system log, parsing the data after the event keyword, obtaining event information, determining the event identification, and outputting the SMMU fault information based on the event identification, realizing automatic positioning.

Benefits of technology

It significantly improves the SMMU fault location efficiency, simplifies the user's positioning process, and provides strong technical support for the memory management of I/O devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690717A_ABST
    Figure CN119690717A_ABST
Patent Text Reader

Abstract

The invention provides a fault positioning method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method is applied to a system of an ARM architecture, the system of the ARM architecture comprises IO equipment, a processor and a physical memory, the processor comprises a system memory management unit, the IO equipment accesses the physical memory through the system memory management unit, and the method comprises the following steps: acquiring a system log of the system memory management unit; analyzing data behind the event keyword in the system log to obtain event information; analyzing the event information, and determining an event identifier; and outputting fault information of the system memory management unit according to the event identifier. According to the invention, the SMMU fault can be automatically positioned, and the fault positioning efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a fault location method, device, electronic device and storage medium. Background Art

[0002] SMMU (System Memory Management Unit) is a system-level memory management unit in the ARM architecture, which is mainly responsible for handling memory management tasks of I / O devices.

[0003] When an SMMU fails, the system automatically prints the current error information to the system log. However, when checking manually, it is difficult to understand the SMMU error information from the log because the error information is stored in a specific format.

[0004] The existing technology locates the error information by manually checking the log and comparing it with the SMMU feature document, but the fault location efficiency is very low. Summary of the invention

[0005] The purpose of the present application is to provide a fault location method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to automatically locate SMMU faults and improve fault location efficiency.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides a fault location method, which is applied to an ARM architecture system, wherein the ARM architecture system includes: an IO device, a processor, and a physical memory, wherein the processor includes a system memory management unit, and the IO device accesses the physical memory through the system memory management unit, and the method includes:

[0008] Obtaining a system log of the system memory management unit;

[0009] Parsing the data after the event keyword in the system log to obtain event information;

[0010] Parsing the event information to determine the event identifier;

[0011] According to the event identifier, fault information of the system memory management unit is output.

[0012] Optionally, obtaining the system log of the system memory management unit includes:

[0013] Determine whether the input parsing path is received;

[0014] If the input parsing path is received, obtaining the system log from the parsing path;

[0015] If the input parsing path is not received, the system log is obtained from a default path.

[0016] Optionally, parsing the data after the event keyword of the system log to obtain event information includes:

[0017] Determining whether the system log has the matching event keyword;

[0018] If the system log has the matching event keyword, the data after the event keyword is parsed line by line to obtain the event information.

[0019] Optionally, parsing the data after the event keyword line by line to obtain the event information includes:

[0020] Parsing each line of string data after the event keyword in sequence;

[0021] Store each line of string data in an array of character type;

[0022] If the number of parsed lines is a preset number of lines, the data in the character type array is converted into a preset number of long integer data which is the same as the preset number of lines, and the event information includes: the preset number of long integer data.

[0023] Optionally, parsing the event information to determine the event identifier includes:

[0024] The first preset number of bits of data are obtained from the first long integer data to obtain the event identifier.

[0025] Optionally, the sequentially parsing each line of string data after the event keyword includes:

[0026] Determine whether the number of data of a preset number of digits after the event keyword is within a preset range;

[0027] If the preset number of digits of data after the event keyword is within a preset range, each line of character string data after the event keyword is parsed in sequence.

[0028] Optionally, the sequentially parsing each line of string data after the event keyword includes:

[0029] Perform binary keyword matching on each line of data after the event keyword;

[0030] If a preset base keyword is matched, the character string data after the preset base keyword is obtained.

[0031] Optionally, outputting the fault information of the system memory management unit according to the event identifier includes:

[0032] According to the event identifier, obtaining other event parameters from the preset number of long integer data;

[0033] Outputting the fault information of the system memory management unit according to the event identifier and the other event parameters.

[0034] In a second aspect, an embodiment of the present application further provides a fault location device, which is applied to an ARM architecture system, wherein the ARM architecture system includes: an IO device, a processor, and a physical memory, wherein the processor includes a system memory management unit, and the IO device accesses the physical memory through the system memory management unit, and the device includes:

[0035] An acquisition module, used for acquiring a system log of the system memory management unit;

[0036] A parsing module, used to parse the data after the event keyword in the system log to obtain event information;

[0037] The analysis module is further used to analyze the event information and determine the event identifier;

[0038] An output module is used to output the fault information of the system memory management unit according to the event identifier.

[0039] Optionally, the acquisition module is specifically used to determine whether an input parsing path is received; if the input parsing path is received, obtain the system log from the parsing path; if the input parsing path is not received, obtain the system log from a default path.

[0040] Optionally, the parsing module is specifically used to determine whether the system log has a matching event keyword; if the system log has a matching event keyword, parse the data after the event keyword line by line to obtain the event information.

[0041] Optionally, the parsing module is specifically used to parse each line of string data after the event keyword in sequence; store each line of string data in an array of character type; if the number of parsed lines is a preset number of lines, convert the data in the array of character type into a preset number of long integer data which is the same as the preset number of lines, and the event information includes: a preset number of long integer data.

[0042] Optionally, the parsing module is further used to obtain data of a first preset number of digits from the first long integer data to obtain the event identifier.

[0043] Optionally, the parsing module is further used to determine whether the preset number of digits of data after the event keyword is within a preset range; if the preset number of digits of data after the event keyword is within the preset range, parse each line of string data after the event keyword in turn.

[0044] Optionally, the parsing module is further used to perform base keyword matching on each line of data after the event keyword; if a preset base keyword is matched, obtain the character string data after the preset base keyword.

[0045] Optionally, the parsing module is further used to obtain other event parameters from the preset number of long integer data according to the event identifier;

[0046] The output module is further used to output the fault information of the system memory management unit according to the event identifier and the other event parameters.

[0047] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the fault location method as described in any one of the first aspects.

[0048] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the fault location method as described in any one of the first aspects are executed.

[0049] The beneficial effects of this application are:

[0050] The fault location method, device, electronic device and storage medium provided in the present application parse the system log of the SMMU to obtain event information about the fault event, parse the event identifier representing the fault event from the event information, and directly output the fault information of the SMMU corresponding to the event identifier, thereby realizing automatic location of the SMMU fault, which can significantly improve the SMMU fault location efficiency and the acquisition of fault information, and provide strong technical support for the memory management of I / O devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 An architectural diagram of the ARM architecture system provided in an embodiment of the present application;

[0053] Figure 2 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 1 ;

[0054] Figure 3 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 2 ;

[0055] Figure 4 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 3 ;

[0056] Figure 5 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 4 ;

[0057] Figure 6 A schematic diagram of a long integer data provided in an embodiment of the present application;

[0058] Figure 7 A flowchart of a fault location method provided in an embodiment of the present application;

[0059] Figure 8 A schematic diagram of the structure of a fault location device provided in an embodiment of the present application;

[0060] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0062] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0063] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0064] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0065] SMMU is a system-level memory management unit in the ARM architecture, which is mainly responsible for handling memory management tasks of I / O devices. It is similar to the memory management unit MMU in the central processing unit (CPU). SMMU is specifically used for I / O devices. SMMU is to solve the remapping problem of direct memory access (DAM) under the virtualization platform. SMMU converts virtual addresses into hardware addresses through hardware support, allowing I / O devices to access memory resources safely and efficiently.

[0066] When an SMMU fails, the system automatically prints the current error information to the system log. However, when checking manually, it is difficult to understand the SMMU error information from the log because the error information is stored in a specific format and other related information may be hidden in the information and needs to be parsed.

[0067] The existing technology locates the error information by manually checking the log and comparing it with the SMMU feature document, but the fault location efficiency is very low. In addition, there is a lack of tools specifically for locating SMMU problems on the market.

[0068] Based on the problems existing in the above-mentioned prior art, the present application intends to provide a fault location method, device, electronic device and storage medium, which uses a software program as a user-mode operation mechanism to locate the fault of the SMMU. The system log of the SMMU is parsed by the software program to obtain event information, and the event identifier is parsed from the event information. Based on the event identifier, the fault information of the SMMU is output, and the automatic location of the SMMU fault is realized, which simplifies the user's process of locating the SMMU fault, improves the fault location efficiency of the SMMU, and provides strong technical support for the memory management of I / O devices.

[0069] Before introducing the fault location method, device, electronic device and storage medium provided in the present application, in order to better understand the present solution, the ARM architecture system used in the present application is first introduced.

[0070] The SMMU fault location method of the present application is applied to an ARM architecture system, such as an ARM architecture embedded system or a server environment.

[0071] Figure 1 The architecture diagram of the ARM architecture system provided in the embodiment of the present application is as follows: Figure 1 As shown, the ARM architecture system may include: an IO device, a processor and a physical memory, the processor includes an SMMU, and the IO device accesses the physical memory through the SMMU.

[0072] Among them, SMMU, as the memory management unit in the system, is responsible for processing memory access requests and jointly maintaining the event queue (Event Queue), command queue (Conmmand Queue) and configuration registers with the driver.

[0073] The processor executes the fault location method of the present application, parses the system log, locates the SMMU fault, and outputs the cause of the fault and a solution.

[0074] I / O devices access memory through DMA components and are the initiators of I / O address access. I / O virtual addresses (IOVA) are translated into real physical addresses by SMMU, thereby limiting the I / O devices' ability to access the entire system memory in a virtualized environment. SMMU constraints improve system security and limit the access scope of I / O devices in each virtual machine.

[0075] If a failure occurs during the process of SMMU translating I / O virtual addresses into real physical addresses, the SMMU hardware writes error information into the event queue of the physical memory. The SMMU driver records this information into the system log. The software program reads the system log, parses it, and outputs fault information to help developers quickly locate the problem.

[0076] Based on the above-mentioned ARM architecture system, the specific implementation of the fault location method, device, electronic device and storage medium provided in this application is described below.

[0077] Figure 2 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 1 ,like Figure 2 As shown, the method may include:

[0078] S101. Obtain a system log of a system memory management unit.

[0079] In this embodiment, when SMMU translates I / O virtual addresses into real physical addresses, if a fault occurs, the fault information will be written into the event queue of the physical memory. The SMMU driver will record the fault information into the system log, execute the fault location software program, and obtain the system log.

[0080] S102: Parse the data following the event keyword in the system log to obtain event information.

[0081] In this embodiment, the system log records the event keywords and event information corresponding to the fault events generated by the SMMU hardware. The fault location software program locates the event keywords from the system log. After locating the event keywords, the data after the event keywords is parsed to determine the event information related to the fault event.

[0082] It should be noted that the event information does not directly describe the content of the fault event, but is a series of character strings. The content of the fault event cannot be intuitively understood based on the character strings.

[0083] S103: Analyze event information and determine event identifier.

[0084] In this embodiment, the event information is parsed according to the predefined structure of the event information, character string data related to the event identifier is obtained from the event information, and the character string data is converted into integer data to obtain the event identifier.

[0085] In some embodiments, the event information recorded in the system log when the SMMU fails is analyzed in advance to determine the structure of the event information, which indicates the position of the string data representing the event identifier in the event information. The position of the string data of the event identifier in the event information is set in the fault locating software program, so that during the running of the fault locating software program, the string data corresponding to the event identifier can be parsed from the event information, and the string data can be converted to obtain the event identifier.

[0086] S104: Outputting fault information of the system memory management unit according to the event identifier.

[0087] In the present invention, a correspondence between a predefined event identifier and fault information is obtained, and after the event identifier is parsed from the event information, the fault information corresponding to the event identifier is determined according to the correspondence between the event identifier and the fault information, and the fault information is output to the user, so that the user can locate and check the fault of the SMMU according to the fault information.

[0088] In some embodiments, the above fault location method can be run in the form of a small program, avoiding the complexity and risk of kernel state operations, thereby simplifying the process of locating SMMU faults for users.

[0089] The fault location method provided in the above embodiment parses the system log of the SMMU to obtain event information about the fault event, parses the event identifier representing the fault event from the event information, and directly outputs the SMMU fault information corresponding to the event identifier, thereby realizing automatic location of the SMMU fault. This can significantly improve the SMMU fault location efficiency and the acquisition of fault information, and provide strong technical support for the memory management of I / O devices.

[0090] In a possible implementation, the process of obtaining the system log of the system memory management unit in S101 may include:

[0091] Determine whether the input parsing path is received; if the input parsing path is received, obtain the system log from the parsing path; if the input parsing path is not received, obtain the system log from the default path.

[0092] In this embodiment, the fault location software program supports online fault location and offline fault location. Specifically, the fault location software program provides a command line interaction interface for the user through the graphical user interface of the computer device, and the user can choose to input the parsing path through the command line interaction interface.

[0093] If the parsing path input by the user through the command line interactive interface is not received, the system log is obtained from the default path / var / log / syslog. If the parsing path input by the user through the command line interactive interface is received, the offline system log is obtained from the parsing path.

[0094] In some embodiments, if the parsed path entered by the user through the command line interactive interface is not received, it is determined whether the default path / var / log / syslog exists. If it exists, the system log is obtained from the default path / var / log / syslog. If the default path / var / log / syslog does not exist, the fault location software program reports an error to the user.

[0095] In other embodiments, if a parsing path is received from a user via a command line interface, it is determined whether the parsing path exists. If so, a system log is obtained from the parsing path. If the parsing path does not exist, the fault location software program reports an error to the user.

[0096] The fault location method provided in the above embodiment can obtain offline system logs based on the parsing path input by the user, and can also obtain online system logs from the default path to meet the user's error analysis needs in different application scenarios, such as fault location during virtualization system startup or driver debugging, to help designers quickly locate SMMU fault information.

[0097] In one possible implementation, Figure 3 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 2 ,like Figure 3 As shown, the process of parsing the data after the event keyword in the system log in S102 to obtain event information may include:

[0098] S201: Determine whether the system log has a matching event keyword.

[0099] S202: If the system log has a matching event keyword, parse the data after the event keyword line by line to obtain event information.

[0100] In this embodiment, in order to quickly locate whether fault information is recorded in the system log, the system log can be first matched with keywords. If an event keyword about the fault event is matched, it is determined that a new fault event is recorded in the system log. In this case, the system log is parsed to obtain the event information. If the event keyword of the fault event is not matched, it is determined that no new fault event is recorded in the system log. In this case, the system log does not need to be parsed.

[0101] In some embodiments, the event keyword includes: indication information of the SMMU and a fault event keyword, and the indication information of the SMMU indicates that the fault event keyword is a fault event keyword of the SMMU.

[0102] For example, the event keyword may be "iommu:event", iommu indicates that the fault event keyword event is related to the SMMU, the information in the system log is parsed line by line, and the event keyword "iommu:event" is matched. If the event keyword "iommu:event" is matched, it is determined that the SMMU hardware has generated a new fault event, and the data after the event keyword is parsed line by line to obtain the event information.

[0103] The fault location method provided in the above embodiment determines whether to parse the system log by judging whether there is a matching event keyword in the system log. Only when there is a matching event keyword in the system log is the event information parsed and obtained, thereby improving the parsing efficiency and avoiding invalid parsing and wasting system resources.

[0104] In one possible implementation, Figure 4 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 3 ,like Figure 4 As shown, the process of parsing the data after the event keyword line by line in S202 to obtain event information may include:

[0105] S301, parse each line of string data after the event keyword in sequence.

[0106] S302. Store each line of string data in an array of character type.

[0107] S303: If the number of parsed lines is a preset number of lines, convert the data in the character type array into a preset number of long integer data which is the same as the preset number of lines, and the event information includes: the preset number of long integer data.

[0108] In this embodiment, the event information exists in the system log in the form of a character string. In order for the fault location software program to parse the event identifier from the event information, the character string data needs to be converted into integer data first.

[0109] The complete event information has a preset number of lines in the system log. Therefore, when parsing the string data after the event keyword, it is necessary to parse the preset number of lines of string data to ensure that the data parsing is complete. Each time a line of string data is parsed, the string data is stored in an array of character type, and then the array of character type is converted to a preset number of integer data corresponding to the preset number of lines. Since each line of string data is an 8-byte number, the array of character type needs to be converted to long integer data to complete the data saving.

[0110] In some embodiments, after converting the character type array into a preset number of long integer data, the preset number of long integer data is stored in an internal data structure so that the long integer data can be parsed from the internal data structure to obtain the event identifier.

[0111] In some embodiments, if a preset number of lines of character string data are not parsed, a parsing error is determined and a parsing error prompt message is output to the user.

[0112] In a possible implementation, the process of parsing the event information and determining the event identifier in S103 may include:

[0113] Get the first preset number of digits of data from the first long integer data to obtain the event identifier.

[0114] In this embodiment, the data stored in the first preset number of digits of the first long integer data among the preset number of long integer data is the event identifier, and the data in the first preset number of digits of the first long integer data is parsed to obtain the event identifier.

[0115] For example, the event information includes four 64-bit long integer data. The first 8 bits are taken from the first 64-bit data to parse out the event identifier eventID.

[0116] The fault location method provided in the above embodiment parses each string data after the event keyword and stores it in a character type array, and then converts it into long integer data so that the event identifier can be identified, thereby realizing automatic identification of fault information using a software program and improving fault location efficiency.

[0117] In one possible implementation, Figure 5 Schematic diagram of the process of the fault location method provided in the embodiment of the present application Figure 4 ,like Figure 5 As shown, the process of sequentially parsing each line of string data after the event keyword in S301 may include:

[0118] S401: Determine whether the data of a preset number of digits after the event keyword is within a preset range.

[0119] S402: If the preset number of digits of data after the event keyword is within a preset range, parse each line of character string data after the event keyword in sequence.

[0120] In this embodiment, in order to improve the parsing efficiency and avoid parsing erroneous event information, it is possible to first determine whether the data recorded in the event information is within a preset range. If the data is within the preset range, it means that a valid fault event is recorded in the event information. If the data is not within the preset range, it means that a valid fault event is not recorded in the event information. There is no need to further parse the event information to avoid wasting system resources.

[0121] Specifically, the preset number of digits is the effective number of digits of the event identifier representing the fault event, the preset range is the event identifier representing the valid fault event, the preset range includes multiple event identifiers of fault events, and the data of the preset number of digits after the event keyword is actually the data corresponding to the event identifier. It is judged whether the data of the preset number of digits is within the preset range to determine whether a valid fault event is recorded in the event information. If the data of the preset number of digits is within the preset range, it is determined that a valid fault event is recorded in the event information, and the string data recorded in the event information can be further parsed and converted into long integer data to obtain the event identifier. If the data of the preset number of digits is not within the preset range, it is determined that no valid fault event is recorded in the event information, and the prompt information can be directly output.

[0122] In some embodiments, the event information is stored in the form of hexadecimal numbers, and it can be determined whether the hexadecimal number with a preset number of digits after the event keyword is within a preset range.

[0123] For example, 0x0 to 0x25 are the data corresponding to the valid fault event.

[0124] The fault location method provided in the above embodiment determines whether the data of the preset number of digits after the event keyword is within the preset range, and parses the string data only when the data of the preset number of digits is within the preset range, so as to determine whether a valid fault event is recorded in the event information before parsing the event information, avoid the waste of system resources caused by parsing when no valid fault event is recorded, and improve the robustness of the software program in parsing event information.

[0125] In a possible implementation, the process of sequentially parsing each line of string data after the event keyword in S301 may include:

[0126] A base keyword match is performed on each line of data after the event keyword; if a preset base keyword is matched, the string data after the preset base keyword is obtained.

[0127] In this embodiment, event information in the system log starts with a binary keyword. In order to accurately extract event information from the system log, each line of data after the event keyword can be matched with the binary keyword. If the preset binary keyword is matched, the character string after the binary keyword is stored in a character array and converted into long integer data and stored in the memory data structure.

[0128] In some embodiments, the base keyword includes: indication information of the SMMU and the base keyword, and the indication information of the SMMU indicates that data after the base keyword is data related to the SMMU.

[0129] For example, the base keyword may be “iommu:0x”, where iommu indicates that the data after the base keyword 0x is related to the SMMU.

[0130] The fault location method provided in the above embodiment uses binary keywords to locate data related to event information in the system log, and can quickly extract character string data corresponding to the event information from the system log, thereby improving the speed and efficiency of fault location.

[0131] In a possible implementation, the process of outputting the fault information of the system memory management unit according to the event identifier in S104 may include:

[0132] According to the event identifier, other event parameters are obtained from a preset number of long integer data; according to the event identifier and other event parameters, fault information of the system memory management unit is output.

[0133] In this embodiment, the event identifier indicates the type of fault that occurs in the SMMU, and the fault information includes the fault type.

[0134] In addition to the fault type, the fault information also includes associated information corresponding to the fault type. The associated information is used to indicate the specific fault cause corresponding to the fault type, such as faulty equipment, fault list, etc. In order to obtain the associated information corresponding to the fault type, this embodiment determines the position information of other event parameters indicating the associated information in the long integer data according to the fault type corresponding to the event identifier, and obtains other event parameters from a preset number of long integer data according to the position information, so as to determine the specific fault cause based on the other event parameters, and output the fault type and the specific fault cause.

[0135] In some embodiments, troubleshooting suggestions are generated based on the fault type and specific fault cause, and the troubleshooting suggestions are output to the user. Troubleshooters can perform troubleshooting based on the fault information and the troubleshooting suggestions.

[0136] For example, Figure 6 A schematic diagram of a long integer data provided in an embodiment of the present application, such as Figure 6 As shown, the event information includes four 64-bit long integer data. The event identifier, eventID 0x08, is obtained from the first 8 bits of the first 64-bit long integer data. According to the event identifier 0x08, the SubstreamID is obtained from the 13th to 32nd bits of the first 64-bit long integer data, and the StreamID is obtained from the 33rd to 64th bits of the first 64-bit long integer data. The StreamID indicates the identifier of the peripheral IO device, and the SubstreamID indicates the process ID of the peripheral IO device. According to the StreamID and SubstreamID, the peripheral device that has failed and the process that operates the peripheral device can be defined.

[0137] The fault location software program analyzes the system log and outputs the following:

[0138] EventID:0x08(BAD_SubstreamID)

[0139] SubstreamID:0x02

[0140] StreamID: 0x600

[0141] Reason:

[0142] ·Stage 1translation disabled(STE.Config[0]==0).

[0143] ·Substreams disabled(STE.S1CDMax==0).

[0144] SubstreamID>=STE.S1CDMax.

[0145] ·A two-level CD fetch encounters an L1CD structure with V==0,or anL1CD

[0146] structure that contains an L2Ptr that is out of range(see3.4.3Address sizes of

[0147] SMMU-originated accesses).

[0148] Suggestion:

[0149] Use phytium_dump_pte tools to dump the SMMU config and pagetableinfo.Refer to the configuration described in the aforementioned reasons andcheck each item one by one.

[0150] The output content includes: fault event identifier (EventID: 0x08), EventID: 0x08 indicates that the fault type is SubstreamID error, the wrong SubstreamID is 0x02, the corresponding streamID is 0x600, the fault cause (Reason) and troubleshooting suggestions (Suggestion).

[0151] The fault location method provided in the above embodiment determines other event parameters according to the event identifier, and can locate the fault more accurately, so as to quickly troubleshoot the fault problem.

[0152] For example, Figure 7 A flowchart of a fault location method provided in an embodiment of the present application is shown in FIG. Figure 7 As shown in FIG. 1 , the fault location process includes:

[0153] S501, determine whether there is an input parsing path parameter, if yes, execute S502, if not, execute S503;

[0154] S502, determine whether there is an offline system log, if yes, execute S504, if not, the software reports an error;

[0155] S503, determine whether there is a default path, if yes, execute S505, if not, the software reports an error;

[0156] S504, open the offline system log and obtain the file handle;

[0157] S505, open the current system log and obtain the file handle;

[0158] S506, parsing line by line, matching the event keyword "iommu:event";

[0159] S507, determine whether the event keyword "iommu:event" is matched, if so, execute S508, if not, execute S506;

[0160] S508, parsing line by line, matching the binary keyword "iommu:0x";

[0161] S509, determine whether the binary keyword "iommu:0x" is matched, if so, execute S510, if not, execute S508;

[0162] S510, convert the character string after 0x into long integer data, and store it into a memory data structure;

[0163] S511, determine whether the cumulative parsing is 4 times, if so, execute S512, if not, execute S508;

[0164] S512, parsing the four 64-bit data stored in the data structure;

[0165] S513, parse the eventID from the first 64-bit data, and parse other event parameters according to the eventID;

[0166] S514: Output fault cause and troubleshooting suggestions.

[0167] The present application adopts a fault location software program to execute the above-mentioned fault location method, which greatly improves the efficiency and accuracy of fault troubleshooting and provides users with higher operational flexibility. Users can perform real-time checks through the software program, or use offline system logs to perform preliminary problem troubleshooting on other platforms, thereby realizing more diverse fault diagnosis methods.

[0168] In view of the wide application of ARM architecture chips and the fact that ARM architecture-based processors designed by many manufacturers all contain SMMU components, this solution has excellent versatility and adaptability, can adapt to different processors, and provide a unified and efficient solution for SMMU fault location on different platforms.

[0169] As the ARM architecture continues to evolve, the functionality of the SMMU component will increase. The fault location software program of this application is highly flexible and can seamlessly adapt to new hardware features and requirements through software upgrades, ensuring long-term technological advancement and application value.

[0170] The fault location software program of the present application is compatible with existing system monitoring and management tools, can quickly locate the problem when an SMMU operation failure is detected, and work in conjunction with the existing system to provide a more efficient and comprehensive system monitoring solution.

[0171] Based on the above method embodiments, the embodiments of the present application also provide a fault location device, which is applied to an ARM architecture system. The ARM architecture system includes: an IO device, a processor and a physical memory. The processor includes a system memory management unit, and the IO device accesses the physical memory through the system memory management unit. Figure 8 A schematic diagram of the structure of a fault location device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device may include:

[0172] An acquisition module 601 is used to acquire a system log of a system memory management unit;

[0173] The parsing module 602 is used to parse the data after the event keyword in the system log to obtain event information;

[0174] The parsing module 602 is further used to parse the event information and determine the event identifier;

[0175] The output module 603 is used to output the fault information of the system memory management unit according to the event identifier.

[0176] Optionally, the acquisition module 601 is specifically used to determine whether an input parsing path is received; if the input parsing path is received, obtain the system log from the parsing path; if the input parsing path is not received, obtain the system log from the default path.

[0177] Optionally, the parsing module 602 is specifically used to determine whether the system log has a matching event keyword; if the system log has a matching event keyword, the data after the event keyword is parsed line by line to obtain event information.

[0178] Optionally, the parsing module 602 is specifically used to parse each line of string data after the event keyword in sequence; store each line of string data in an array of character type; if the number of parsed lines is a preset number of lines, convert the data in the array of character type into a preset number of long integer data which is the same as the preset number of lines, and the event information includes: a preset number of long integer data.

[0179] Optionally, the parsing module 602 is further configured to obtain data of a first preset number of digits from the first long integer data to obtain an event identifier.

[0180] Optionally, the parsing module 602 is further used to determine whether the preset number of digits of data after the event keyword is within a preset range; if the preset number of digits of data after the event keyword is within the preset range, parse each line of string data after the event keyword in sequence.

[0181] Optionally, the parsing module 602 is further configured to perform base keyword matching on each line of data following the event keyword; if a preset base keyword is matched, obtain the character string data following the preset base keyword.

[0182] Optionally, the parsing module 602 is further configured to obtain other event parameters from a preset number of long integer data according to the event identifier;

[0183] The output module 603 is further used to output the fault information of the system memory management unit according to the event identifier and other event parameters.

[0184] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0185] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0186] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application, such as Fig. 9 As shown, the electronic device 700 includes: a processor 701, a storage medium 702 and a bus, the storage medium 702 stores program instructions executable by the processor 701, when the electronic device 700 is running, the processor 701 and the storage medium 702 communicate through the bus, and the processor 701 executes the program instructions to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0187] Optionally, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method embodiment is executed.

[0188] In the several embodiments provided in the present 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 units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0190] 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 hardware plus software functional units.

[0191] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

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

Claims

1. A fault location method, characterized in that: A system applied to an ARM architecture, the ARM architecture system comprising: an IO device, a processor and a physical memory, the processor comprising a system memory management unit, the IO device accessing the physical memory through the system memory management unit, the method comprising: Obtaining a system log of the system memory management unit; Parsing the data after the event keyword in the system log to obtain event information; Parsing the event information to determine the event identifier; According to the event identifier, fault information of the system memory management unit is output.

2. The method according to claim 1, characterized in that The obtaining of the system log of the system memory management unit comprises: Determine whether the input parsing path is received; If the input parsing path is received, obtaining the system log from the parsing path; If the input parsing path is not received, the system log is obtained from a default path.

3. The method according to claim 1, characterized in that The parsing of the data after the event keyword of the system log to obtain event information includes: Determining whether the system log has the matching event keyword; If the system log has the matching event keyword, the data after the event keyword is parsed line by line to obtain the event information.

4. The method according to claim 3, characterized in that The step of parsing the data after the event keyword line by line to obtain the event information includes: Parsing each line of string data after the event keyword in sequence; Store each line of string data in an array of character type; If the number of parsed lines is a preset number of lines, the data in the character type array is converted into a preset number of long integer data which is the same as the preset number of lines, and the event information includes: the preset number of long integer data.

5. The method according to claim 4, characterized in that The step of parsing the event information and determining the event identifier includes: The first preset number of bits of data are obtained from the first long integer data to obtain the event identifier.

6. The method according to claim 4, characterized in that The step of sequentially parsing each line of string data after the event keyword includes: Determine whether the number of data of a preset number of digits after the event keyword is within a preset range; If the preset number of digits of data after the event keyword is within a preset range, each line of character string data after the event keyword is parsed in sequence.

7. The method according to claim 4, characterized in that The step of sequentially parsing each line of string data after the event keyword includes: Perform binary keyword matching on each line of data after the event keyword; If a preset base keyword is matched, the character string data after the preset base keyword is obtained.

8. The method according to claim 4, characterized in that Outputting the fault information of the system memory management unit according to the event identifier includes: According to the event identifier, obtaining other event parameters from the preset number of long integer data; Outputting the fault information of the system memory management unit according to the event identifier and the other event parameters.

9. A fault location device, characterized in that: A system applied to an ARM architecture, the ARM architecture system comprising: an IO device, a processor and a physical memory, the processor comprising a system memory management unit, the IO device accessing the physical memory through the system memory management unit, the apparatus comprising: An acquisition module, used for acquiring a system log of the system memory management unit; A parsing module, used to parse the data after the event keyword in the system log to obtain event information; The analysis module is further used to analyze the event information and determine the event identifier; An output module is used to output the fault information of the system memory management unit according to the event identifier.

10. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the fault location method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the fault location method according to any one of claims 1 to 8 are executed.