Chip monitoring method and device

The chip monitoring method uses a shared memory to store access information, enabling the secondary processing unit to determine failure types in primary cores, addressing inefficiencies in existing solutions by simplifying the process and improving monitoring accuracy.

JP7537805B2Active Publication Date: 2024-08-21HORIZON JOURNEY (HANGZHOU) ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023142755
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2022-11-02
Filing Date
2023-09-04
Publication Date
2024-08-21
Estimated Expiration
2043-09-04

AI Technical Summary

Technical Problem

Current chip monitoring solutions are inefficient in determining the cause of failures in primary cores when switching between secure and non-secure areas, often requiring complex debugging and unable to accurately identify the type of failure.

Method used

A chip monitoring method and apparatus that utilizes a shared memory to store access information, including an access state and service type identifier, allowing a secondary processing unit to determine the type of failure by comparing execution time with a preset relationship, eliminating the need for debugging and improving monitoring efficiency.

Benefits of technology

Enables accurate determination of failure types in primary processing units, reducing the complexity and time required for monitoring, and enhancing the efficiency of chip monitoring processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007537805000008
    Figure 0007537805000008
  • Figure 0007537805000002
    Figure 0007537805000002
  • Figure 0007537805000009
    Figure 0007537805000009
Patent Text Reader

Abstract

To provide a chip monitoring method and apparatus.SOLUTION: A method is applied to a chip including a first processing unit, a second processing unit, and a shared memory, and the method includes: storing access information in the shared memory when the first processing unit accesses a secure area of the first processing unit; starting, by the second processing unit, time measurement when it is determined that the first processing unit accesses the secure area; reading the access information from the shared memory; determining, by the second processing unit, a preset magnitude relationship which is satisfied with time of the time measurement and execution time required for current access; and determining a service type in which a failure occurs in the first processing unit based on a service type identifier when it is determined that the access state identifier in the access information is a first identifier.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to the field of chip technology, and in particular to chip monitoring methods and devices. [Background technology]

[0002] With the progress of science and technology, the architecture of chips becomes more and more complex. In the current architecture, a chip not only contains a high-performance primary core (also called a primary processing unit), but also contains a secondary core (also called a secondary processing unit) with auxiliary processing effects. In addition, to enhance the security of the chip, the primary core in this architecture can support Trustzone technology, and the primary core that supports this Trustzone technology usually adopts a dedicated firmware that can switch between non-secure and secure areas.

[0003] However, when the primary core switches from the non-secure world to the secure world to perform the corresponding service, a failure may occur. Therefore, how to provide a method to monitor the chip is an urgent issue. Summary of the Invention [Problem to be solved by the invention]

[0004] The present disclosure has been made to solve the above technical problems. The embodiments of the present disclosure provide a chip monitoring method and device. [Means for solving the problem]

[0005] A chip monitoring method according to an embodiment of the present disclosure, which is applied to a chip including a first processing unit and a second processing unit, includes: a step of storing access information in a shared memory between the first processing unit and the second processing unit when the first processing unit accesses a secure area of ​​the first processing unit, the access information including an access state identifier and a service type identifier of the current access, the access state identifier being a first identifier indicating that the first processing unit is initiating an access to the secure area or a second identifier indicating that the first processing unit has completed access to the secure area; the second processing unit starting a timer when it is determined that the first processing unit has accessed the secure area; the second processing unit reading the access information from the shared memory; The second processing unit determines a predetermined magnitude relationship that is satisfied between the measured time and the execution time required for the current access, and if it is determined that the access state identifier in the access information is a first identifier, determines a service type in which a failure has occurred in the first processing unit based on the service type identifier in the access information.

[0006] According to another aspect of the present disclosure, a chip monitoring device is applied to a chip including a first processing unit and a second processing unit, a storage module for storing access information in a shared memory between the first processing unit and the second processing unit when the first processing unit accesses a secure area of ​​the first processing unit, the access information including an access state identifier and a service type identifier of the current access, the access state identifier being a first identifier indicating that the first processing unit has initiated an access to the secure area or a second identifier indicating that the first processing unit has completed an access to the secure area; a timing module for initiating a timing when it is determined that the first processing unit has accessed the secure domain; a read module for reading the access information stored in the storage module from the shared memory; and a determination module for determining a preset magnitude relationship that is satisfied between the time measured by the timing module and the execution time required for the current access, and, if it is determined that the access state identifier read by the reading module is a first identifier, for determining the service type that causes a failure of the first processing unit based on the service type identifier read by the reading module.

[0007] A computer-readable storage medium according to another aspect of the embodiments of the present disclosure stores a computer program for executing the chip monitoring method according to any of the above embodiments of the present disclosure.

[0008] According to another aspect of the present disclosure, there is provided an electronic device comprising: A processor; a storage means for storing instructions executable by said processor; The processor reads the executable instructions from the memory and executes the executable instructions to implement the chip monitoring method according to any of the above embodiments of the present disclosure.

[0009] An embodiment of the present disclosure provides a chip monitoring method and device, the method being applied to a chip including a first processing unit and a second processing unit, the chip being provided with a shared memory between the first processing unit and the second processing unit. In the method, when the first processing unit accesses a secure area of ​​the first processing unit, access information is stored in the shared memory, the access information includes an access state identifier capable of indicating whether the first processing unit has completed access to the secure area and a service type identifier of the current access, when it is determined that the first processing unit has accessed the secure area, the second processing unit starts a timekeeping and reads the access information from the shared memory, the second processing unit determines a preset magnitude relationship between the timekeeping time and an execution time required for the current access, when it is determined that the access state identifier in the access information is the first identifier, the service type in which the first processing unit has a failure is determined based on the service type identifier in the access information. Effect of the Invention

[0010] According to the solution of the embodiments of the present disclosure, when a failure occurs in the first processing unit, the type of failure of the first processing unit can be determined, thereby solving the problem of the prior art in which it was not possible to determine the cause of the failure, and thus realizing monitoring of the chip. [Brief description of the drawings]

[0011] [Figure 1] FIG. 1 is a configuration diagram of a chip to which the present disclosure is applied. [Diagram 2] FIG. 2 is a diagram showing a flow of a chip monitoring method according to an exemplary embodiment of the present disclosure. [Diagram 3] FIG. 13 is a diagram showing a flow of a chip monitoring method according to another exemplary embodiment of the present disclosure. [Figure 4] FIG. 13 is a diagram showing a flow of a chip monitoring method according to another exemplary embodiment of the present disclosure. [Diagram 5]FIG. 13 is a diagram showing a flow of a chip monitoring method according to another exemplary embodiment of the present disclosure. [Figure 6] FIG. 1 is a schematic diagram of a chip architecture according to an exemplary embodiment of the present disclosure. [Figure 7(a)] FIG. 2 is a schematic diagram of an interaction between a first processing unit and a second processing unit according to an exemplary embodiment of the present disclosure. [Figure 7(b)] FIG. 4 is a schematic diagram of an interaction between a first processing unit and a second processing unit according to another exemplary embodiment of the present disclosure. [Figure 8] FIG. 13 is a diagram showing a flow of a chip monitoring method according to another exemplary embodiment of the present disclosure. [Figure 9] FIG. 1 is a block diagram of a chip monitoring device according to an exemplary embodiment of the present disclosure. [Figure 10] FIG. 2 is a block diagram of a chip monitoring device according to another exemplary embodiment of the present invention. [Figure 11] FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] Hereinafter, exemplary embodiments according to the present disclosure will be described in detail with reference to the drawings. Obviously, the described embodiments are merely some embodiments of the present disclosure, but are not all embodiments of the present disclosure, and the present disclosure is not limited to the exemplary embodiments described herein.

[0013] It should be noted that the relative arrangement of parts and steps, numerical expressions and values ​​described in these examples do not limit the scope of the present disclosure unless specifically stated otherwise. [Application Summary]

[0014] With the progress of science and technology, the architecture of chips becomes more and more complex. In the current architecture, the chip not only includes a high-performance primary core, but also includes a secondary core with auxiliary processing effects. In addition, to enhance the security of the chip, the primary core of this architecture can support Trustzone technology, in which case the primary core usually includes a secure area and a non-secure area. In addition, the primary core that supports Trustzone technology usually adopts a dedicated firmware that can switch between the secure area and the non-secure area. When access to the secure area is required, the primary core can call a Secure Monitor Call (SMC), and this SMC instruction includes multiple types and can realize multiple types of services accordingly, such as key generation, key deletion, encryption / decryption, signing, and signature verification.

[0015] However, the primary core may experience failures (e.g. hangs) as it performs each type of service, and is typically monitored to ensure that the next function the chip needs to perform after the primary core hangs is not affected.

[0016] In the current chip monitoring solution, a debugger is used to debug the primary core, during debugging, the primary core re-executes the operation corresponding to each type of service, the debugger determines the problem that occurs in the process of the primary core executing the operation corresponding to each type of service, and determines the cause of the primary core hanging up based on the problem that occurs. However, since the realization of this solution requires the deployment of a debugger and the primary core re-executes the operation corresponding to each type of service, the implementation method is complicated and time-consuming, so it is not widely used, and currently, the second solution is usually adopted to monitor the chip.

[0017] The second solution for chip monitoring is to monitor the primary core by querying the logs written in the log system or by installing monitoring software called watchdog on the secondary core. In this solution, it is possible to determine whether the primary core has failed by monitoring the logs written or the watchdog.

[0018] However, the log usually only records whether a failure has occurred in the primary core, and the watchdog can only monitor whether a failure has occurred in the primary core, which means that the chip monitoring solution in the related art can only determine whether a failure has occurred in the primary core, but cannot determine the cause of the failure of the primary core. [Example System]

[0019] The embodiments of the present disclosure can be applied to application scenarios where chip monitoring is required. Referring to the schematic diagram of the configuration shown in Figure 1, the chip includes a primary core and a secondary core, the primary core includes a secure domain and a non-secure domain, and the primary core can access the secure domain by calling an instruction (e.g., an SMC instruction).

[0020] The chip also includes a shared memory for the primary core and the secondary core, and both the primary core and the secondary core can access the shared memory.

[0021] Here, when the primary core accesses the secure area, it can store access information in the shared memory, including an access state identifier and a service type identifier for the current access, and the access state identifier is used to characterize whether the primary core has completed access to the secure area for the current access.

[0022] The secondary core can realize chip monitoring by accessing the shared memory, reading the access information stored in the shared memory, and determining whether a fault has occurred in the primary core and the type of the fault based on the access information. [Exemplary Method]

[0023] 2 is a flow diagram of a chip monitoring method according to an exemplary embodiment of the present disclosure, which can be applied to a chip including a first processing unit and a second processing unit, where the first processing unit includes a secure domain and a non-secure domain.

[0024] In one possible design, the first processing unit is a primary core of the chip and the second processing unit is a secondary core of the chip. Of course, the first processing unit and the second processing unit may each be other modules within the chip, and this disclosure is not limited in this respect.

[0025] As shown in FIG. 2, this chip monitoring method includes the following steps S201 to S204.

[0026] In step S201, when the first processing unit accesses the secure area of ​​the first processing unit, access information is stored in a shared memory between the first processing unit and the second processing unit.

[0027] Here, the access information includes an access state identifier and a service type identifier of the current access, the access state identifier being a first identifier indicating that the first processing unit initiates an access to the secure area or a second identifier indicating that the first processing unit has completed an access to the secure area.

[0028] In this case, the access state identifier in the access information makes it possible to determine whether the first processing unit has completed access to the secure area.

[0029] In one example, the first identifier is "1" and the second identifier is "2", and accordingly, the first processing unit stores the first identifier "1" in the shared memory after initiating an access to the secure region, and after the first processing unit completes the access to the secure region, the first processing unit modifies the access state identifier stored in the shared memory to the second identifier "2". In this case, the access state identifier stored in the shared memory can indicate whether or not there has been an access to the secure region of the first processing unit.

[0030] The access information also includes a service type identifier. In the present disclosure, the first processing unit can realize a plurality of types of services by accessing the secure area, and a corresponding service type identifier can be set in advance for each type of service. In this case, the corresponding service type when the first processing unit accesses the secure area this time can be determined based on the service type identifier.

[0031] In step S202, the second processing unit starts timing when it is determined that the first processing unit has accessed the secure area.

[0032] When the first processing unit accesses the secure domain, the second processing unit can start a timer to count time, where the timer may be located within the second processing unit or may be located separately from the second processing unit in the chip, and the present disclosure is not limited thereto.

[0033] In step S203, the second processing unit reads the access information from the shared memory.

[0034] In this disclosure, a shared memory is a memory shared between a first processing unit and a second processing unit, where the second processing unit can access the shared memory to read access information stored in the first processing unit.

[0035] In step S204, the second processing unit determines a preset magnitude relationship that is satisfied between the measured time and the execution time required for the current access, and if it is determined that the access state identifier in the access information is the first identifier, determines the service type in which the failure has occurred in the first processing unit based on the service type identifier in the access information.

[0036] In the present disclosure, the preset magnitude relationship that is satisfied between the measured time and the execution time required for the current access can be such that the measured time is longer than the execution time required for the current access.

[0037] When the access state identifier in the access information is the first identifier, it indicates that the first processing unit has not completed access to the secure area, and in this case, when the measured time is longer than the execution time required for the current access, it indicates that the time during which the first processing unit accessed the secure area exceeded the execution time required for the current access but the access to the secure area has not yet been completed, and further indicates that a failure has occurred in the first processing unit. Therefore, based on the service type identifier in the access information, the service type in which the failure has occurred in the first processing unit can be determined, thereby enabling monitoring of the chip.

[0038] An embodiment of the present disclosure provides a chip monitoring method applied to a chip including a first processing unit and a second processing unit, the chip being provided with a shared memory between the first processing unit and the second processing unit, in which the first processing unit stores access information in the shared memory when accessing a secure area of ​​the first processing unit, the access information including an access state identifier capable of indicating whether the first processing unit has completed access to the secure area and a service type identifier of the current access, the second processing unit starts a time measurement and reads the access information from the shared memory when it is determined that the first processing unit has accessed the secure area, the second processing unit determines a magnitude relationship between the time measurement time and an execution time required for the current access, and when it is determined that the access state identifier in the access information is the first identifier, determines a service type in which a failure has occurred in the first processing unit based on the service type identifier in the access information.

[0039] According to the method of the embodiment of the present disclosure, when a failure occurs in the first processing unit, the type of failure of the first processing unit can be determined, thereby solving the problem of the prior art in which the cause of the failure could not be determined.

[0040] Furthermore, the solution of the present disclosure determines the type of service in which a failure has occurred in the first processing unit based on the access information stored in the shared memory, and does not require debugging using a debugger. Therefore, compared with the conventional solution that uses a debugger to perform debugging, there is no need to install a debugger, and the time required for monitoring the chip is shortened, thereby improving the efficiency of chip monitoring.

[0041] In step S204 of the present disclosure, the second processing unit needs to determine a preset magnitude relationship between the measured time and the execution time required for the current access, where the second processing unit can determine the execution time required for the current access in a number of different ways.

[0042] In one possible implementation, the execution time required for the current access is the execution time required for the current access included in the access information.

[0043] In this implementation, the first processing unit includes the execution time required for the current access in the access information stored in the shared memory, and in this case, the second processing unit can obtain the access information stored in the shared memory by accessing the shared memory, and further determine the execution time required for the current access based on this access information.

[0044] In one possible design, a correspondence between the execution time and the service information corresponding to each type of service executed by the first processing unit can be predefined, and the correspondence can be stored in the first processing unit or a storage module accessible by the first processing unit. In this case, when the first processing unit accesses the secure area, the first processing unit determines the execution time required for the current access based on the service information executed by the first processing unit and the correspondence, and stores the execution time required for the current access in the shared memory, so that the access information stored in the shared memory by the first processing unit can also include the execution time required for the current access.

[0045] Here, in this possible design, the service information in the correspondence can distinguish different types of services performed by the first processing unit, for example, the service information can include a service type identifier.

[0046] In this implementation, the second processing unit can determine the execution time required for the current access by reading the access information in the shared memory, thereby more efficiently determining the execution time required for the current access.

[0047] In another possible implementation form, the execution time required for the current access is an execution time determined by the second processing unit based on a preset protocol and the service type identifier included in the access information, where the preset protocol includes a correspondence between at least one service type identifier and the execution time.

[0048] In this implementation, a preset protocol can be stored in the second processing unit, and the second processing unit can read the service type identifier stored in the shared memory and then determine the execution time required for the current access based on the correspondence contained in the preset protocol and the service type identifier.

[0049] In this implementation, the first processing unit does not need to store the execution time required for the current access in the shared memory, and correspondingly, the second processing unit does not need to determine the execution time required for the current access in the manner of accessing the shared memory, thereby reducing the amount of data that the first processing unit and the second processing unit each interact with the shared memory.

[0050] In the solution of the present disclosure, in step S201, the first processing unit stores access information including an access state identifier and a service type identifier of the current access in the shared memory. In addition, the access information may further include a core identifier of the first processing unit called in the current access, or the access information may further include a core identifier and a thread identifier of the first processing unit called in the current access.

[0051] Accordingly, as shown in FIG. 3, a chip monitoring method according to another embodiment of the present disclosure further includes the following step S205 in addition to the embodiment shown in FIG.

[0052] In step S205, if the access information further includes a core identifier of the first processing unit, the second processing unit determines the service type in which the failure has occurred in the first processing unit based on the service type identifier, and then the second processing unit determines the first processing unit in which the failure has occurred based on the core identifier.

[0053] A plurality of first processing units may be included in the same chip. In this case, a corresponding core identifier may be assigned in advance to each first processing unit in the chip, and the core identifiers of different first processing units are different from each other. In addition, the access information stored in the shared memory by the first processing unit further includes the core identifier of the first processing unit. In this case, the second processing unit can determine the first processing unit in which a failure has occurred based on the core identifier stored in the shared memory after determining a preset magnitude relationship that is satisfied between the measured time and the execution time required for the current access, thereby further realizing monitoring of the chip.

[0054] Alternatively, as shown in FIG. 4, a chip monitoring method according to another embodiment of the present disclosure further includes the following step S206 in addition to the embodiment shown in FIG.

[0055] In step S206, if the access information further includes a core identifier and a thread identifier of the first processing unit called in the current access, the second processing unit determines the service type in which the failure has occurred in the first processing unit based on the service type identifier, and then the second processing unit determines the first processing unit in which the failure has occurred and the thread in which the failure has occurred based on the core identifier and the thread identifier.

[0056] Here, the second processing unit can realize the corresponding operation in the manner of calling a thread. In this embodiment, a corresponding thread identifier can be pre-assigned to each thread, and the thread identifiers of different threads are different from each other. In addition, the access information stored in the shared memory by the first processing unit further includes a core identification and a thread identification of the first processing unit. In this case, after the second processing unit determines a preset magnitude relationship between the measured time and the execution time required for the current access, the second processing unit determines the first processing unit in which a failure has occurred and the thread in which a failure has occurred in the first processing unit based on the core identifier and the thread stored in the shared memory, thereby realizing more accurate chip monitoring.

[0057] In step S203 of the present disclosure, the second processing unit reads the access information from the shared memory. In the actual monitoring process, this step can be realized in several kinds of manners.

[0058] In one executable implementation, the step of the second processing unit reading the access information from the shared memory includes the second processing unit periodically reading the access information from the shared memory based on a predetermined first period.

[0059] In this implementation, the second processing unit may include or be connected to a timer, which generates a corresponding trigger signal for each first period, and the second processing unit reads the access information from the shared memory after obtaining the trigger signal.

[0060] With this implementation, the second processing unit can read the access information in the shared memory in a manner of periodically accessing the shared memory, thereby determining in a timely manner whether a failure has occurred in the first unit.

[0061] In another possible implementation, the step of the second processing unit reading the access information from the shared memory comprises: determining a target time for the second processing unit to read the access information based on an execution time required for the current access and a storage time of the access information in the shared memory; a second processing unit reading the access information from the shared memory at a target time; Includes.

[0062] In this implementation, the second processing unit can access the shared memory to determine the storage time of the access information in the shared memory, then determine a target time based on the execution time required for the current access and the storage time of the access information in the shared memory, and access the shared memory again at the target time to read the access information in the shared memory.

[0063] Here, the time between the target time and the time when the access information is stored in the shared memory can be equal to or longer than the execution time required for the current access. In other words, if no failure occurs when the first processing unit executes the current service, the first processing unit completes the current access at the target time, and in this case, the access stored in the shared memory is indicated as a second identifier.

[0064] In one possible design, the time between the target time and the time the access information is stored in the shared memory is equal to the execution time required for the current access. For example, if the execution time required for the current access is "a" and the time the access information is stored in the shared memory is a first time, the difference between the target time and the time before the first time is "a".

[0065] Since the difference between the target time and the time before the first time is "a", the elapsed time from the first time to the target time indicates the execution time required for this access, and in this case, the first processing unit completed this access at the target time without any failures during the execution of the current service.

[0066] In another possible design, the time between the target time and the time when the access information is stored in the shared memory is longer than the execution time required for the current access. In this case, if the time "b" is preset, the time between the target time and the time when the access information is stored in the shared memory is equal to the sum of the execution time "a" required for the current access and the time "b", that is, if the time when the access information is stored in the shared memory is the first time, the difference between the target time and the time before the first time is the sum of "a" and "b".

[0067] In this case, if the difference between the target time and the first time is greater than "a", this indicates that the elapsed time from the first time to the target time is longer than the execution time required for the current access, in which case the first processing unit completed the current access at the target time without any failures during the execution of the current service.

[0068] In addition, in this design, in order to timely monitor whether a failure occurs in the first processing unit, “b” is usually set as a short time, that is, the time between the target time and the time when the access information is stored in the shared memory is close to the execution time required for this access, so that the second processing unit can timely determine whether a failure occurs in the first processing unit.

[0069] If no failure occurs when the first processing unit executes the current service, the first processing unit completes the current access at the target time, and the access stored in the shared memory is accordingly indicated as a second identifier. If a failure occurs when the first processing unit executes the current service, the first processing unit cannot complete the current access at the target time, and the access stored in the shared memory is accordingly indicated as a first identifier. Therefore, it is possible to determine whether a failure occurs when the first processing unit executes the current service based on the access information read from the shared memory at the target time by the second processing unit.

[0070] In this implementation, the second processing unit reads the access information in the shared memory less often, thereby reducing the power consumption of the chip.

[0071] In the above embodiment, in step S201, the first processing unit stores access information in the shared memory between the first processing unit and the second processing unit. As shown in Fig. 5, step S201 can include the following steps S2011 to S2012 in addition to the embodiment shown in Fig. 2.

[0072] In step S2011, when the first processing unit initiates the current access, the service type identifier and the first identifier of the current access are stored in the shared memory.

[0073] In other words, each time the first processing unit initiates a current access, it stores the service type identifier of the current access and the first identifier in the shared memory, and indicates, using this first identifier, that it has initiated access to the secure area of ​​the first processing unit and that the first processing unit has not completed the current access.

[0074] In step S2012, after the first processing unit completes the current access, the first processing unit updates the first identifier in the shared memory to the second identifier.

[0075] In this case, the second identifier can indicate that the first processing unit has completed the current access.

[0076] By the operations of steps S2012 and S2012, the first processing unit stores a corresponding access identifier in the shared memory depending on whether or not it has completed its current access, and the second processing unit can determine whether or not the first processing unit has completed its current access based on the access identifier stored in the shared memory.

[0077] In the present disclosure, in step S202, the second processing unit starts timing when it is determined that the first processing unit has accessed the secure area. This operation can be realized in a variety of ways.

[0078] In one possible implementation, the step of initiating a time count by the second processing unit when it is determined that the first processing unit has accessed the secure domain comprises: A second processing unit obtains a trigger command generated when the first processing unit accesses the secure domain; In response to the trigger command, the second processing unit initiates timing; Includes.

[0079] In this implementation, the first processing unit generates a trigger command when the secure region is accessed, and transmits the trigger command to the second processing unit, which starts a time count upon receiving the trigger command.

[0080] According to this implementation, the second processing unit can initiate timing based on a trigger command generated by the first processing unit.

[0081] Alternatively, in another implementation, the second processing unit can monitor the state of the first processing unit and start timing when it monitors the first processing unit accessing the secure area.

[0082] Alternatively, the state of the first processing unit can be monitored by other processing units in the chip, and when it is monitored that the first processing unit has accessed the secure area, a trigger command can be generated and transmitted to the second processing unit so that the second processing unit starts timing.

[0083] Of course, the second processing unit can start timing when it is determined that the first processing unit has accessed the secure area in other ways, and the present disclosure is not limited thereto.

[0084] According to the chip monitoring method of the present disclosure, it is possible to determine whether a fault occurs when a first processing unit accesses the secure area of ​​the first processing unit, and to determine the type of the faulty service when a fault occurs, where the type of the service accessed by the first processing unit in the secure area includes, but is not limited to, any one of key generation, key deletion, key import, key export, symmetric encryption / decryption, hashing, asymmetric encryption / decryption, asymmetric signature, and signature verification.

[0085] In this case, a corresponding service type identifier is preset for each of the above types of service, and when the first processing unit executes the corresponding service, the corresponding service type identifier is stored in the shared memory, and the second processing unit can determine the service type for which the first processing unit executes the service based on the service type identifier stored in the shared memory.

[0086] Of course, the service type may be other types, and the present disclosure is not limited thereto.

[0087] To clarify the chip monitoring method according to the present disclosure, a schematic diagram of a chip architecture is disclosed in Fig. 6. Referring to Fig. 6, the chip includes a first processing unit, a second processing unit, and a shared memory. Both the first processing unit and the second processing unit can access the shared memory.

[0088] The first processing unit includes a secure area and a non-secure area, and the first processing unit can access the secure area by calling an instruction, and the instruction can be an SMC instruction for example. In the process of accessing the secure area, referring to Fig. 6, the non-secure area of ​​the first processing unit can send an instruction of service request to the secure area, and after completing this access, the secure area can send an instruction of feedback to the non-secure area.

[0089] Furthermore, when the first processing unit accesses the secure area, the solutions according to the above embodiments of the present disclosure can store access information in the shared memory. The access information can include an access state identifier and a service type identifier of the current access. The access information can further include an execution time required for the current access. The access information can further include a core identifier of the first processing unit called in the current access, or can further include a core identifier and a thread identifier of the first processing unit called in the current access.

[0090] The second processing unit can read the access information from the shared memory. Specifically, referring to Fig. 6, when it is determined that the first processing unit accesses the secure area, the application of the second processing unit starts the timing, reads the access information from the shared memory, and monitors the fault status of the first processing unit through the chip monitoring method according to the above embodiments of the present disclosure.

[0091] In one possible embodiment, the first processing unit can store the access information in the shared memory in the form of an information list, where the information list can set corresponding fields and store the corresponding access information by each field. In this case, if the access information includes an access state identifier, a service type identifier of the current access, an execution time required for the current access, and a core identifier and a thread identifier of the first processing unit called in the current access, the fields included in the information list can include a field for storing the service type identifier of the current access (e.g., Command id field), a field for storing the execution time required for the current access (e.g., Execution Time field), a field for storing the core identifier of the first processing unit called in the current access (e.g., Core id field), and a field for storing the thread identifier of the first processing unit called in the current access (e.g., Thread id field).

[0092] Referring to FIG. 7(a), if no failure occurs during the current access of the first processing unit, when the first processing unit accesses the secure area, the non-secure area transmits a service request command (which may be an SMC command) to the secure area, and after completing the current access, the secure area transmits a feedback command to the non-secure area.

[0093] In FIG. 7(a), the access information is displayed in a list, which is called a Message index, and which includes a Command id field, an Execution Time field, a Core id field, and a Thread id field, which are used to store the corresponding access information, respectively.

[0094] In addition, the access state identifier in the access information changes depending on the access state of the first processing unit. In FIG. 7(a), when access to the secure area of ​​the first processing unit is initiated, the access state identifier stored in the shared memory by the first processing unit is the first identifier, and when access to the secure area of ​​the first processing unit is completed, the access state identifier stored in the shared memory by the first processing unit is the second identifier.

[0095] In this case, the second processing unit can periodically read the access information from the shared memory according to a preset first period, or can read the access information from the shared memory at a target time. If the measured time is equal to or less than the execution time required for the current access, the access state identifier in the shared memory is read as the second identifier, and it is determined that the first processing unit has no failure during the current access.

[0096] Referring to FIG. 7(b), if there is a fault in the first processing unit during the current access process, when the first processing unit accesses the secure area, the non-secure area transmits a service request command to the secure area; due to the occurrence of the fault, the current access cannot be completed, and the secure area does not transmit a feedback command to the non-secure area; accordingly, the first processing unit does not adjust the first identifier in the shared memory to the second identifier.

[0097] In this case, the second processing unit cannot read the second identifier at all after accessing the shared memory to read the first identifier, so that the second processing unit can determine the service type in which the failure occurred in the first processing unit based on the service type identifier stored in the Command id field, determine the first processing unit in which the failure occurred based on the core identifier stored in the Core id field, and determine the thread in which the failure occurred based on the thread identifier stored in the Thread id field.

[0098] In order to clarify the chip monitoring method of the present disclosure, another embodiment is disclosed, which discloses operations performed by a first processing unit and a second processing unit, respectively. Referring to Fig. 8, in this embodiment, the first processing unit performs the following steps S301 to S304.

[0099] In step S301, the first processing unit initiates an access to the secure area of ​​the first processing unit.

[0100] Here, when a first processing unit sends an SMC instruction to a secure region, it can be considered that the first processing initiates an access to this secure region.

[0101] In step S302, the first processing unit stores the access information in the shared memory.

[0102] In this case, the access identifier in this access information is the first identifier.

[0103] In step S303, the first processing unit executes the current service.

[0104] In step S304, if the first processing unit has no failure, the current service is completed within the execution time required for the current access, and after the current service is completed, the first processing unit adjusts the access identifier in the shared memory from the first identifier to the second identifier.

[0105] Moreover, the second processing unit can execute the following steps S401 to S4054.

[0106] In step S401, the second processing unit starts timing when it is determined that the first processing unit has accessed the secure area.

[0107] Here, when the first processing unit starts accessing the secure area, it transmits a trigger command to the second processing unit, and after receiving the trigger command, the second processing unit can determine that the first processing unit has accessed the secure area and start timing.

[0108] In step S402, the second processing unit reads the access information from the shared memory.

[0109] In step S403, the second processing unit judges whether the access identifier in the access information is the first identifier, and if not, performs the operation of step S404.

[0110] Furthermore, if the second processing unit determines that the access identifier in the access information is not the first identifier (i.e., it is the second identifier), it can return to step S401 to indicate that the first processing unit has completed this access and to restart the timer when the first processing unit accesses the secure area again.

[0111] In step S404, if the access information is a first identifier and the measured time and the execution time required for the current access satisfy a predetermined magnitude relationship, the second processing unit determines the service type for which the failure has occurred in the first processing unit based on the service type identifier in the access information.

[0112] If the access identifier is the first identifier and the measured time and the execution time required for the current access satisfy a preset magnitude relationship, this indicates that the first processing unit was unable to complete the current access within the execution time required for the current access, and since a failure has occurred in the first processing unit during the current access, the service type in which the failure has occurred in the first processing unit can be determined based on the service type identifier in the access information.

[0113] In step S405, if the access information further includes a core identifier of the first processing unit, the second processing unit determines the first processing unit in which the failure has occurred based on the core identifier, or, if the access information further includes a core identification and a thread identification of the first processing unit called in the current access, the second processing unit determines the first processing unit in which the failure has occurred and the thread in which the failure has occurred in the first processing unit based on the core identifier and the thread identification.

[0114] According to the operation of the above steps, it is possible to monitor whether a failure has occurred in the first processing unit, and when a failure occurs, it is possible to determine the service type in which the failure has occurred in the first processing unit, and further, it is possible to realize monitoring of the chip by determining the first processing unit in which the failure has occurred and the thread in which the failure has occurred in the first processing unit. [Example Device]

[0115] 9 is a block diagram of a chip monitoring device according to an exemplary embodiment of the present disclosure. The chip monitoring device is installed in an electronic device such as a terminal device or a server, and can execute the chip monitoring method according to any of the above embodiments of the present disclosure. A chip is installed in the electronic device, and the chip includes a first processing unit and a second processing unit.

[0116] As shown in FIG. 9, the chip monitoring device includes a storage module 201, a timing module 202, a reading module 203 and a determination module 204.

[0117] The storage module 201 is used to store access information in a shared memory between a first processing unit and the second processing unit when a first processing unit accesses a secure area of ​​the first processing unit, where the access information includes an access state identifier and a service type identifier of the current access, and the access state identifier is a first identifier indicating that the first processing unit has initiated an access to the secure area, or a second identifier indicating that the first processing unit has completed an access to the secure area; The timekeeping module 202 is used to start a timekeeping when it is determined that the first processing unit has accessed the secure area; The read module 203 is used to read the access information stored in the storage module from the shared memory; The determination module 204 determines a predetermined magnitude relationship between the time measured by the timing module 202 and the execution time required for the current access, and is used to determine the service type that causes the failure of the first processing unit based on the service type identifier read by the reading module 203 when it is determined that the access state identifier read by the reading module 203 is the first identifier.

[0118] In one possible example, the execution time required for the current access is an execution time determined by the second processing unit based on a preset protocol and a service type identifier included in the access information, where the preset protocol includes a correspondence between at least one service type identifier and the execution time, or the execution time required for the current access is the execution time required for the current access included in the access information.

[0119] In one executable example, the access information further includes a core identifier of a first processing unit invoked in the current access, or the access information further includes a core identifier and a thread identifier of the first processing unit invoked in the current access.

[0120] Furthermore, when the access information further includes a core identifier of the first processing unit, the determination module 204 is used to determine the first processing unit in which the failure has occurred based on the core identifier after the second processing unit determines the service type in which the failure has occurred in the first processing unit based on the service type identifier.

[0121] Alternatively, when the access information further includes a core identifier and a thread identifier of the first processing unit, the determination module 204 is used to determine the first processing unit in which the failure occurred and the thread in which the failure occurred after the second processing unit determines the service type in which the failure occurred in the first processing unit based on the service type identifier.

[0122] In one possible example, the reading module 203 includes a first reading unit 2031, as shown in Fig. 10. The first reading unit 2031 is used to periodically read the access information from the shared memory based on a preset first period.

[0123] Or, in another possible example, the reading module 203 includes a target time determining unit 2032 and a second reading unit 2033 .

[0124] Here, the target time determination unit 2032 is used to determine a target time for the second processing unit to read the access information based on the execution time required for this access and the storage time of the access information in the shared memory; The second reading unit 2033 is used to read the access information from the shared memory at a target time.

[0125] In one possible example, the storage module 201 includes a first storage unit 2011 and a second storage unit 2012 .

[0126] Wherein, the first storage unit 2011 is used to store the service type identifier and the first identifier of the current access in the shared memory when the first processing unit initiates the current access; The second storage unit 2012 is used to update the first identifier in the shared memory to a second identifier after the first processing unit completes the current access.

[0127] In one possible example, the timing module 202 includes an instruction acquisition unit 2021 and a timing initiation unit 2022 .

[0128] Here, the instruction acquisition unit 2021 is used to acquire a trigger instruction generated when the first processing unit accesses the secure area; The timing initiation unit 2022 is used for initiating timing in response to the trigger command.

[0129] In one possible design of the present disclosure, the service types for which the first processing unit accesses the secure area include, but are not limited to, any one of key generation, key deletion, key import, key export, symmetric encryption / decryption, hashing, asymmetric encryption / decryption, asymmetric signing, and signature verification.

[0130] According to a chip monitoring device of an embodiment of the present disclosure, it is possible to monitor whether a failure has occurred in a first processing unit, and if a failure has occurred, it is possible to determine the type of service in which the failure has occurred in the first processing unit, and further to determine the first processing unit in which the failure has occurred and the thread in which the failure has occurred in the first processing unit, thereby enabling monitoring of the chip. [Examples of electronic devices]

[0131] Hereinafter, with reference to FIG. 11, an electronic device according to an embodiment of the present disclosure will be described, in which a chip of the electronic device includes a first processing unit and a second processing unit.

[0132] 11 is a block diagram of an electronic device according to an embodiment of the present invention. As shown in FIG. 11, the electronic device 11 includes one or more processors 111 and a storage unit 112.

[0133] The processor 111 may be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities and may control other components of the electronic device 10 to perform desired functions.

[0134] The storage means 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored in the computer-readable storage medium, and the processor 111 may execute the program instructions to realize the chip monitoring method and / or other desired functions in each embodiment of the present disclosure described above. Various types of content, such as access information, may be stored in the computer-readable storage medium.

[0135] In one example, electronic device 11 may further include input device(s) 113 and output device(s) 114 connected to each other via a bus system and / or other form of connection mechanism (not shown).

[0136] The input device 113 may include, for example, a keyboard and a mouse.

[0137] The output device 114 can output various types of information to the outside, including a service type determined to have caused a failure in the first processing unit, a core identifier of the first processing unit where the failure has occurred, and / or a thread identifier where the failure has occurred, etc. The output device 114 can include, for example, a display, a speaker, a printer, a communication network, and remote output devices connected thereto.

[0138] Of course, for the sake of simplicity, Fig. 10 only shows some of the components related to the present disclosure in the electronic device 11, and omits components such as buses and input / output interfaces. Besides, the electronic device 11 may further include any other suitable components according to specific application situations. [Exemplary Computer Program Products and Computer-Readable Storage Media]

[0139] In addition to the methods and apparatus described above, embodiments of the present disclosure may be a computer program product that includes computer program instructions that, when executed by a processor, cause the processor to perform steps in the chip monitoring methods according to various embodiments of the present disclosure described in the "Exemplary Methods" section above of this specification.

[0140] Program code for carrying out operations of embodiments of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as general procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed as follows: entirely on the user computing device, partially on the user equipment, as a separate software package, partly on the user computing device and partly on a remote computing device, or entirely on a remote computing device or a server.

[0141] The embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, can cause the processor to perform steps in the chip monitoring methods according to various embodiments of the present disclosure described in the "Exemplary Methods" section above of this specification.

[0142] The computer-readable storage medium may be any combination of one or more types of readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0143] Although the basic principles of the present disclosure have been described above with reference to specific embodiments, the advantages, merits, effects, etc. mentioned in the present disclosure are merely illustrative and not limiting. Various embodiments of the present disclosure do not necessarily have those advantages, merits, effects. In addition, the specific details of the above disclosure are merely for illustrative and easy-to-understand functions and are not limiting, and the above details do not necessarily limit the present disclosure to be realized by the above specific details.

[0144] The above description is provided for purposes of illustration and description. Moreover, the description is not intended to limit the embodiments of the present disclosure to the form disclosed herein. Although a number of exemplary aspects and embodiments have been described above, those skilled in the art may recognize certain variations, modifications, variations, additions, and subcombinations thereof.

Claims

1. 1. A chip monitoring method applied to a chip including a first processing unit and a second processing unit, comprising: a step of storing access information in a shared memory between the first processing unit and the second processing unit when the first processing unit accesses a secure area of ​​the first processing unit, the access information including an access state identifier and a service type identifier of the current access, the access state identifier being a first identifier indicating that the first processing unit is initiating an access to the secure area or a second identifier indicating that the first processing unit has completed access to the secure area; the second processing unit starting a timer when it is determined that the first processing unit has accessed the secure area; the second processing unit reading the access information from the shared memory; the second processing unit determines a preset magnitude relationship between the measured time and the execution time required for the current access, and when it is determined that the access state identifier in the access information is a first identifier, determines a service type in which a failure has occurred in the first processing unit based on the service type identifier in the access information. A chip monitoring method comprising:

2. The execution time required for the current access is an execution time determined by the second processing unit based on a preset protocol and the service type identifier included in the access information, where the preset protocol includes a correspondence between at least one service type identifier and an execution time, or the execution time required for the current access is the execution time required for the current access included in the access information; 2. The method of claim 1 .

3. The access information further includes a core identifier of the first processing unit that is invoked in the current access, or The access information further includes a core identifier and a thread identifier of the first processing unit that is invoked in the current access.

2. The method of claim 1 .

4. After the second processing unit determines the service type in which the failure occurs in the first processing unit based on the service type identifier, When the access information further includes a core identifier of the first processing unit, the second processing unit determines the first processing unit in which a failure has occurred based on the core identifier; or If the access information further includes a core identifier and a thread identifier of the first processing unit called in the current access, the second processing unit determines the first processing unit in which a failure has occurred and the thread in which a failure has occurred based on the core identifier and the thread identifier.

4. The method according to claim 3 .

5. The step of the second processing unit reading the access information from the shared memory includes: The second processing unit periodically reads the access information from the shared memory based on a preset first period; or determining a target time for the second processing unit to read the access information based on an execution time required for the current access and a storage time of the access information in the shared memory, and reading the access information from the shared memory at the target time by the second processing unit; The method according to any one of claims 1 to 4.

6. The step of storing the access information in a shared memory between the first processing unit and the second processing unit includes: storing a service type identifier of the current access and the first identifier in the shared memory when the first processing unit initiates the current access; and after the first processing unit completes the current access, the first processing unit updates the first identifier in the shared memory to the second identifier. The method according to any one of claims 1 to 4.

7. The step of starting the timer by the second processing unit when it is determined that the first processing unit has accessed the secure area includes: The second processing unit obtains a trigger command generated when the first processing unit accesses the secure domain; and the second processing unit initiating the timing in response to the trigger command. The method according to any one of claims 1 to 4.

8. The type of service for which the first processing unit accesses the secure area is Includes any one of the following: key generation, key deletion, key import, key export, symmetric encryption / decryption, hashing, asymmetric encryption / decryption, asymmetric signing and signature verification; The method according to any one of claims 1 to 4.

9. A chip monitoring device applied to a chip including a first processing unit and a second processing unit, a storage module for storing access information in a shared memory between the first processing unit and the second processing unit when the first processing unit accesses a secure area of ​​the first processing unit, the access information including an access state identifier and a service type identifier of the current access, the access state identifier being a first identifier indicating that the first processing unit has initiated an access to the secure area or a second identifier indicating that the first processing unit has completed an access to the secure area; a timing module for initiating a timing when it is determined that the first processing unit has accessed the secure domain; a read module for reading the access information stored in the storage module from the shared memory; a determination module for determining a preset magnitude relationship between the time measured by the time measuring module and the execution time required for the current access, and for determining a service type causing a failure of the first processing unit based on the service type identifier read by the read module when it is determined that the access state identifier read by the read module is a first identifier; A chip monitoring device comprising:

10. Storing a computer program for executing the chip monitoring method according to claim 1; A computer-readable storage medium comprising:

11. A processor; a storage means for storing instructions executable by said processor; The processor implements the chip monitoring method of claim 1 by reading the executable instructions from the storage means and executing the executable instructions.

1. An electronic device comprising:

Citation Information

Patent Citations

  • Electronic control unit and electronic control system

    JP2019185130A

  • Program, information processing device, and monitoring method

    WO2012147176A1

  • Detecting anomalous latent communications in an integrated circuit chip

    WO2021110529A1