CN114610519A - Real-time recovery method and system for abnormal errors of processor register set - Google Patents

Real-time recovery method and system for abnormal errors of processor register set Download PDF

Info

Publication number
CN114610519A
CN114610519A CN202210262087.4A CN202210262087A CN114610519A CN 114610519 A CN114610519 A CN 114610519A CN 202210262087 A CN202210262087 A CN 202210262087A CN 114610519 A CN114610519 A CN 114610519A
Authority
CN
China
Prior art keywords
processor
register group
instruction
module
register
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210262087.4A
Other languages
Chinese (zh)
Other versions
CN114610519B (en
Inventor
周婉婷
李磊
袁世伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202210262087.4A priority Critical patent/CN114610519B/en
Publication of CN114610519A publication Critical patent/CN114610519A/en
Application granted granted Critical
Publication of CN114610519B publication Critical patent/CN114610519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The invention discloses a real-time recovery method and a real-time recovery system for abnormal errors of a processor register set, which are applied to the field of intrinsic safety of a processor and aim at the safety problems of soft errors, transient fault injection, malicious tampering and the like of the processor register set in the operation process, and the problems of large resource overhead, low real-time performance, lack of effective means for the error recovery of the register group and the like in the prior error recovery technology, the invention provides a real-time recovery method for the abnormal error of the register group of the processor based on the latch backup of the register group of the processor and the rollback replacement of the PC value corresponding to the error moment, the method can realize real-time recovery of the abnormal error according to the detection result of the abnormal error of the processor register group, according to the simulation test result, the method only needs a few clock cycles from the moment of detecting the error to the moment of completely recovering the abnormal error; the method provided by the invention ensures the reliability and safety of the processor hardware level to a certain extent.

Description

Real-time recovery method and system for abnormal errors of processor register set
Technical Field
The invention belongs to the field of processor endogenous safety, and particularly relates to a recovery technology of an abnormal state of a processor.
Background
Hardware-based fault injection attacks refer to: the effect of fault injection is achieved by changing environmental parameters, interfering hardware or changing the pin input of an integrated circuit chip; the hardware trojan refers to: a particular module, either deliberately implanted in a chip or electronic system or unintentionally left defective by a designer, can be utilized by an attacker to perform a destructive function under special conditions. An inserted hardware trojan may cause leakage of information, change of circuit function, or even destroy the circuit. The general purpose register set of a processor is a carrier of all intermediate data in the operation of the processor, and once the register set is attacked by a malicious attack, the attack on the processor is destructive. These attacks include: hardware trojans, hidden back doors, design holes, electromagnetic pulse injection, laser injection, and the like. In a safety processor, the real-time recovery of the fault can effectively ensure the stable and reliable operation of the system, which is as important as the abnormal state detection of the processor.
The existing recovery method for the abnormal state of the processor mainly comprises the following steps:
(1) the recovery method based on the checkpoint and rollback comprises the following steps: "X.Wang, et al.An M-Cache-Based Security Monitoring and Fault Recovery Architecture for Embedded Processor, IEEE Transactions on Version Large Scale Integration (VLSI) Systems, vol.28, No.11, pp.2314-2327, Nov.2020, (DOI: 10.1109/TVLSI.2020.3021533.) the Processor exception state is recovered by using function entry as checkpoint to perform backup and rollback techniques. The main disadvantages are: 1) the method is a recovery method for abnormal errors of processor instructions, and cannot be applied to recovery of abnormal states of a processor register set; 2) the method needs to back up a processor register, a data RAM, an instruction RAM and a memory in real time because the method is used for detecting and recovering in real time according to the divided program blocks, so that a large amount of resources need to be consumed, and the cost of chip area can be delayed and is very high; 3) the real-time nature of its recovery is not high enough.
(2) The method based on attack detection and error recovery comprises the following steps: "A. Chaudhari, et al. A frame for low overhead hard ware based control flow error detection and recovery, IEEE 31st VLSI Test Symposium (2013), (DOI: 10.1109/VTS.2013.6548908)" the main disadvantages are: 1) the method mainly aims to solve the problem of errors of a currently executed Basic Block (Basic Block), and ignores a non-executed Basic Block; 2) all the execution programs need to be analyzed in advance and the feature extraction of the basic blocks needs to be performed, which results in that the feature extraction needs to be performed again each time a different program is executed, and a large amount of workload is increased.
Disclosure of Invention
To solve the above technical problem, the present invention provides a real-time recovery method for abnormal errors of a processor register set,
one of the technical schemes adopted by the invention is as follows: a real-time recovery method for abnormal state of processor register set includes:
a1, acquiring the instruction stream of the processor entering the decoding stage at the instruction fetching stage, and reordering the acquired instruction stream to obtain the real execution sequence of the instruction stream at the execution stage;
a2, according to the reordered instruction stream of the step A1, latching the write channel signal of the register group of the processor;
a3, when finding the abnormal state of the processor register group, obtaining the instruction and PC value corresponding to the moment when the error occurs, and generating the corresponding error early warning signal;
and A4, restoring the abnormal state of the register set of the processor in real time according to the detection result of the abnormal state of the register set of the processor, the instruction and the PC value corresponding to the time when the abnormal state occurs and the latched backup register set.
The second scheme adopted by the invention is as follows: a system for real-time recovery of exception status of a register set of a processor, comprising: the device comprises a latch backup module, an instruction rearrangement module, a register group abnormal state detection module and a rollback recovery module;
the instruction rearrangement module collects the instruction stream entering the decoding stage at the instruction fetching stage of the processor, reorders the collected instruction stream to obtain the real execution sequence of the instruction stream at the execution stage, and finally sends the rearranged instruction stream to the register group abnormity detection module and the latch backup module;
the latch backup module is used for latching and backing up channel signals written into the register group by the processor, and then selecting write channel data sources entering the main register group and the secondary register group according to the real-time detection result of the register group abnormity detection module;
the register group abnormal state detection module finishes detecting the abnormal state of the register group in real time, then outputs an indication signal of a real-time detection result, and simultaneously outputs an instruction and an instruction PC value corresponding to the moment when the register group generates an abnormal error;
and the rollback recovery module recovers the abnormal state of the register group of the processor in real time according to the abnormal state detection result of the register group, the instruction and the PC value corresponding to the abnormal state occurrence moment and the latched backup register group so as to ensure the safe and reliable execution of the processor.
The invention has the beneficial effects that: the beneficial effects of the proposed method of the invention are mainly reflected in two aspects:
(1) the method realizes effective recovery of the abnormal state of the register group of the processor based on the latch backup of the register group of the processor and the rollback replacement of the PC value corresponding to the error moment, and verifies the reliability (100 percent of the real-time recovery of the abnormal state of the register group of the processor), the resource overhead (the function of completing the latch backup by using 38 registers) and the efficiency in the delay overhead (the abnormal state can be recovered by using 12 clock cycles) of the method. The processor abnormal state recovery method is superior to the existing processor abnormal state recovery method in both real-time performance and resource consumption;
(2) the real-time recovery module of the abnormal state of the register set designed according to the method provided by the invention can be easily embedded into the processor, the abnormal state can be recovered within 12 clock cycles only by slightly modifying the structure of the processor and combining the abnormal state detection module of the register set of the processor, the method is simple and efficient, and the reliability and the safety of the hardware level of the processor are ensured to a certain extent without occupying too many hardware resources.
Drawings
FIG. 1 is a flowchart illustrating a method for real-time recovery of abnormal states of a register set of a processor according to an embodiment of the present invention;
FIG. 2 is a block diagram of a system for real-time recovery of abnormal states of a processor register set according to the present invention;
FIG. 3 is a diagram of an indication of a malicious attack on a register set implanted to test the effectiveness of the present invention;
FIG. 4 is a simulation result of a portion of the real-time recovery of an abnormal condition resulting from an implanted malicious attack on a register set using the method of the present invention;
wherein (a) register x15 was tampered with for the implanted hardware trojan; (b) is the NOP instruction inserted in step S13; (c) the value of backup register set x15 used to roll back the PC address to the error occurrence time 0x420 at the recovery time.
Detailed Description
In order to facilitate the understanding of the technical contents of the present invention by those skilled in the art, the present invention will be further explained with reference to the accompanying drawings.
Example 1
The invention provides a real-time recovery method of abnormal states of a processor register set, which comprises the following steps:
s1, building a processor simulation execution environment for real-time recovery of abnormal errors of the processor register set;
s2, acquiring all signals of the write channel signals of the register group of the processor;
s3, according to the signal of the writing channel obtained in the step S2, delaying 3 clock cycles by adopting a trigger;
s4, sampling the instruction stream of the decoding stage of the processor in real time, and then performing rearrangement operation;
s5, according to the write channel signal with the delay of three cycles obtained in the step S3 and the rearranged instruction stream obtained in the step S4, the write channel signal is latched to ensure that the register value written into the spare register group corresponds to the last instruction of the actual execution instruction of the processor;
s6, obtaining a reference model of the state of the register group according to the instruction flow obtained in the step S4 and the architecture and instruction set information of the processor, then obtaining the state condition of the register group in real time, and finally comparing the state condition with the state of the register group of the reference model to achieve the purpose of detecting the abnormal state of the register group in real time; specifically, if the state of the register group acquired in real time is the same as that of the reference model, the state is indicated to be abnormal, otherwise, the state is abnormal;
s7, detecting the abnormal state of the register group in real time according to the step S6, acquiring the instruction and the PC value corresponding to the moment when the error occurs once the abnormal state of the register group of the processor is found, and generating a corresponding error early warning signal;
s8, if the processor register set exception error early warning signal generated in the step S7 is valid, pausing the pipeline of the fetch, decode, execute, write back stage of the processor to make the processor pause;
s9, selecting the values written into the main register group and the secondary register group according to the processor register group abnormal error early warning signal generated in the step S7, wherein the early warning signal is a selection signal input by the processor register group;
and S10, when the processor is started, the abnormal error early warning signal is invalid, the used register group is a main register group, and the data written in the Bypass mode of the register group write channel signal Bypass acquired in the S2 is written in the main register group.
And S11, when the processor is started, the abnormal error early warning signal is invalid, the register group for latch backup is a secondary register group, the write channel signal of the register group obtained in the step S2 is delayed, and the latch is performed according to the instruction stream rearranged in the step S5.
S12, selecting the data written into the register group of the processor according to the processor register group abnormal error early warning signal generated in the step S7, wherein the abnormal error early warning signal is invalid, selecting the 'main' register group of S10 as the output of the register group mux, and selecting the 'secondary' register group value generated in the step S11 as the output of the register group mux if the abnormal error early warning signal is valid and the pipeline finishes flushing.
S13, inserting a plurality of NOP instructions between the instruction fetching stage and the decoding stage;
s14, resuming the pipeline of the processor decode stage, execute stage and write-back stage, and suspending the pipeline of the fetch stage, so that the processor executes the NOP instruction inserted in step S13, but does not perform the instruction fetch operation;
s15, according to the command and the PC value corresponding to the error occurrence time acquired in the step S7, replacing the PC value of the command read from the command RAM in the instruction fetching stage with the PC value corresponding to the error occurrence time acquired in the step S7.
S16, when the abnormal error early warning signal is effective, processing the instruction in the prefetch finger FIFO in the instruction fetching stage as a subsequent instruction at the error moment, and for rollback recovery, the instruction is useless, and the prefetch finger FIFO needs to be emptied, so that when the processor is recovered in the abnormal state, the instruction stored in the prefetch finger FIFO before is not executed any more;
s17, restoring the pipeline of the processor fetch stage according to the completion of the step S12, the step S15 and the step S16;
s18, completing the real-time recovery of the abnormal error of the processor register group.
The purpose of delaying the register group write channel signal by 3 clock cycles by using the flip-flop in step S3 is to: the real-time detection technology of the abnormal error of the register group used by the invention can give the early warning signal of the error state generated by the register group after 2 clock cycles of the error occurrence time, so 3 clock cycles are delayed to ensure that the corresponding time of the backed-up register group value is earlier than the error occurrence time, and the error value of the backed-up register group is not existed.
Step S4 specifically includes: sampling an instruction stream in a decoding stage in real time; then, according to the relevant information of the instruction set and the structure of the processor, a rearrangement rule of the instruction stream in the decoding stage of the processor is formulated; and finally, rearranging the instruction stream in the decoding stage of the processor according to the established instruction stream rearrangement rule. The instruction rearrangement herein may refer to application No.: 202110162587.6 paragraphs 59-72 relate to the detailed description of command modification, and the present invention is not described in detail herein.
Step S5 specifically includes: collecting the rearranged instruction stream and delaying for one beat; comparing the instruction stream delayed by one beat with the instruction stream not delayed to obtain an indication signal indicating that the instruction changes, wherein when the signal is 1, the instruction execution of the current instruction by the processor is completed, the next instruction is started to be executed, and when the signal is 0, the instruction execution of the current instruction by the processor is still indicated; latching the register group write channel signal delayed by 3 beats according to an instruction signal of the processor for executing instruction change, wherein when the instruction signal is 1, the register group write channel signal delayed by 3 beats can be output to a backup register group, and when the instruction signal is 0, the register group write channel signal delayed by 3 beats is latched;
the pipeline suspended in step S8 includes: an instruction fetch stage, a decode stage, an execute stage, and a write back stage.
The input signal and the selection signal of the register set write channel signal MUX in step S9 include:
1) input signal 1: writing a channel signal by the processor corresponding to the step S2;
2) input signal 2: a signal obtained by delaying and latching the signal in step S5 in 1);
3) selecting a signal: the error early warning signal generated in step S7 is generated together with the register group label used by the processor, and when the processor is started, if the register group used is the "primary" register group, the signal written into the register group is selected as the signal in 1), and if the backup register group used is the "secondary" register group, the signal written into the register group is selected as the signal in 2);
when the early warning signal is 1 and the register bank used by the processor is a main register bank, the register bank used by the processor is switched to a backup register bank-a secondary register bank, and the signal written into the register bank is the signal in 1), at the moment, the backup register bank is the main register bank, and the signal written into the register bank is the signal in 2); when the early warning signal is 1 and the register bank used by the processor is a secondary register bank, the register bank used by the processor is switched to a backup register bank, namely a main register bank, the signal written into the register bank is selected to be the signal in 1), the backup register bank is the secondary register bank, and the signal written into the register bank is selected to be the signal in 2).
As will be known by those skilled in the art, the "abnormal error early warning signal is invalid" in the present invention, that is, no abnormality occurs in the register set, and the early warning signal is 0; the corresponding 'abnormal error early warning signal is effective', namely the abnormity of the register group occurs, and the early warning signal is 1.
The specific function of inserting the NOP instruction in step S13 includes: 1) pipeline flushing, which may clear the processor from invalid states and useless control caused by pausing the processor pipeline in step S8; 2) the time may be acquired for the processing of step S15, step S16.
Step S15 specifically includes: counting the number of NOP instructions inserted in step S13; generating an instruction PC address jump signal according to the count value of the number of the inserted NOP instructions, wherein the signal lasts for one beat; according to the generated instruction PC address jump signal, the PC address output to the instruction RAM in the instruction fetching stage of the processor is replaced by the PC address corresponding to the abnormal error moment of the register group, and meanwhile, the read request signal for reading the instruction RAM is set to be 1, so that the instruction of the PC address corresponding to the abnormal error moment of the register group can be correctly taken out after a clock cycle recovers an instruction fetching stage pipeline.
The pipeline time of the instruction fetch stage recovered in the step S16 is in the next clock cycle of the step S15, and the signal indicating the pipeline recovery of the instruction fetch stage is obtained by xoring the abnormal error warning signal and the PC replacement completion signal.
Step S17 specifically includes: acquiring the Depth FIFO _ Depth of the prefetch finger FIFO according to the architecture of the processor; starting counting with a counter while resuming the fetch stage pipeline at step S16, and stopping counting until the count value equals FIFO _ Depth; a strobe signal lasting FIFO _ Depth clock cycles is generated based on the resulting count value, so that instructions entering the decode stage are not temporarily provided by the prefetch finger FIFO, but are provided directly by the instruction output of the fetch RAM.
Example 2
The invention provides a real-time recovery system for abnormal state of processor register set, as shown in fig. 2, comprising: the device comprises a latch backup module, an instruction rearrangement module, a register group abnormal state detection module and a rollback recovery module;
the instruction rearrangement module collects the instruction stream entering the decoding stage in the instruction fetching stage, reorders the collected instruction stream to obtain the real execution sequence of the instruction stream in the execution stage, and finally sends the rearranged instruction stream to the register group abnormity detection module and the latch backup module;
the latch backup module is used for latching and backing up channel signals written into the register group by the processor, and then selecting whether write channel data entering the main register group and the secondary register group are from Bypass or the delay latch module according to the real-time detection result of the register group abnormity detection module;
the register group abnormal state detection module completes the task of detecting the abnormal state of the register group in real time, then outputs an indication signal of a real-time detection result, and simultaneously outputs an instruction and an instruction PC value corresponding to the moment when the register group generates an abnormal error.
And the rollback recovery module recovers the abnormal state of the register group of the processor in real time according to the abnormal state detection result of the register group, the instruction and the PC value corresponding to the abnormal state occurrence moment and the latched backup register group so as to ensure the safe and reliable execution of the processor.
As shown in FIG. 2, the processor pipeline includes four stages, respectively: an instruction fetch stage, a decode stage, an execute stage, and a write back stage.
The latch backup module in this embodiment specifically includes: the data source of a write channel entering the main register group is selected to be the first Bypass or the first delay latch module by the first multi-way switch according to the real-time detection result of the register group abnormity detection module; the second multi-way switch selects the data source entering the write channel of the secondary register group as a second Bypass or a second delay latch module according to the output result of the real-time detection result of the register group abnormity detection module after passing through the inverter; the third multi-way switch selects the register group to output as a main register group or a secondary register group according to the real-time detection result of the register group abnormity detection module;
the first delay latch module and the second delay latch module latch and release the write channel signal delayed for three clock cycles according to the instruction stream generated by the instruction rearrangement module.
The instruction rearrangement module in this embodiment is used for collecting an instruction stream entering a decoding stage from an instruction fetching stage, rearranging the instruction stream according to an instruction rearrangement rule to restore a real execution sequence of the instruction stream in an execution stage, and finally sending the rearranged instruction to the register group abnormality detection module and the delay latch module. The rules for rearrangement can be found in the patent application No. 202110162587.6. This block essentially provides an indication signal that latches the write channel signal.
The rollback recovery module in this embodiment specifically includes: the device comprises an NOP instruction insertion module, a PC address replacement module, a prefetch instruction FIFO processing module and an early warning signal resetting module;
(1) a NOP instruction insertion module: the module acts on the instruction fetching stage of the processor pipeline, and after the processor pipeline is suspended, a plurality of NOP instructions are inserted into an instruction output path of the instruction fetching stage, wherein the number of NOP instructions is determined by a pipeline flushing cycle and a PC (personal computer) address replacing cycle. When insertion of a NOP instruction is complete, enable signals are generated that restore the processor decode, execute, and write back stage pipelines. This module may clear the invalid state and useless control of the processor caused by pausing the processor pipeline while providing time for subsequent processing by the rollback recovery module.
(2) PC address replacement module: an instruction-indicative PC address jump signal is generated based on a count of the number of NOP instructions, the count being determined by the clock cycles consumed by the execution pipeline flush, the signal lasting one beat. And then replacing the PC address output to the instruction RAM by the processor prefetch module with the PC address corresponding to the abnormal error moment of the register group, and setting the read instruction request signal and the PC address effective signal of the read instruction to be 1, so as to ensure that the instruction of the PC address corresponding to the abnormal error moment of the register group can be correctly taken out after the instruction fetching stage is recovered in one clock period. The pipeline of the fetch stage is resumed immediately after instruction replacement is complete.
(3) Prefetch finger FIFO processing module: acquiring the Depth FIFO _ Depth of the prefetch finger FIFO according to the architecture of the processor; then, when the pipeline of the instruction fetching stage is recovered, a counter is used for starting counting, and the counting is stopped until the counting value is equal to FIFO _ Depth, so that the counting value generates a gating signal which lasts for FIFO _ Depth for a clock period; according to the signal, the instruction entering the decoding stage is temporarily not provided by the prefetch finger FIFO, but is directly provided by the instruction output of the fetch finger RAM.
(4) Resetting an abnormal signal: the module mainly detects whether the abnormal state of the processor register group is successfully recovered or not, and sends the abnormal state to the register group abnormal state detection module for resetting the early warning signal.
The method realizes effective recovery of the abnormal state of the register group of the processor based on the latch backup of the register group of the processor and the rollback replacement of the PC value corresponding to the error moment, and verifies the efficiency of the method in the aspects of reliability (100 percent of real-time recovery of the abnormal state of the register group of the processor), resource overhead (the function of completing the latch backup by using 38 registers) and delay overhead (the abnormal state can be recovered by using 12 clock cycles). The processor abnormal state recovery method is superior to the existing processor abnormal state recovery method in both real-time performance and resource consumption; the real-time recovery module of the abnormal state of the register set designed according to the method provided by the invention can be easily embedded into the processor, the abnormal state can be recovered within 12 clock cycles only by slightly modifying the structure of the processor and combining the abnormal state detection module of the register set of the processor, the method is simple and efficient, and the reliability and the safety of the hardware level of the processor are ensured to a certain extent without occupying too many hardware resources.
To verify the effectiveness of the present invention, an example is given in this embodiment in which the processor register set shown in fig. 3 is subjected to a malicious tampering attack. The inserted hardware trojan maliciously tampers x15 of the register set, so that the correct value is changed from 4 to 5, thereby causing the address error of the program entry, jumping to the wrong program entry and the function operation error. The abnormal state of the register set of the processor is then restored according to the method of the present invention, and the waveform of the restored result is shown in fig. 4. FIG. 4(a) shows that the inserted hardware trojan has maliciously tampered with the x15 value of the register set, so that the correct value is changed from 4 to 5, and the corresponding PC value is 0x420 of the previous cycle, and the x15 value of the backup register is correct; fig. 4(b) is a NOP instruction inserted in the recovery process in S13, with the backup register being the correct value; in fig. 4(c), the PC address is rolled back to the error occurrence time 0x420 at the recovery time, and the value of the backup register group x15 used is 4, which is a correct value.
It will be appreciated by those of ordinary skill in the art that the embodiments described herein are intended to assist the reader in understanding the principles of the invention and are to be construed as being without limitation to such specifically recited embodiments and examples. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A real-time recovery method for abnormal state of processor register set is characterized by comprising the following steps:
a1, acquiring the instruction stream of the processor entering the decoding stage at the instruction fetching stage, and reordering the acquired instruction stream to obtain the real execution sequence of the instruction stream at the execution stage;
a2, latching the writing channel signal of the processor according to the command stream reordered in the step A1;
a3, when finding the abnormal state of the processor register group, obtaining the instruction and PC value corresponding to the moment when the error occurs, and generating the corresponding error early warning signal;
and A4, restoring the abnormal state of the register group of the processor in real time according to the abnormal state detection result of the register group of the processor, the instruction and the PC value corresponding to the abnormal state occurrence time and the latched backup register group.
2. A method for real-time recovery of exception status of processor register set as claimed in claim 1, wherein step a2 comprises:
a21, two register sets are adopted, wherein one register set is used as a register set used by a processor, and the other register set is used as a backup register set;
a22, if the state of the register group used by the processor is normal at the present moment, writing the processor writing channel signal into the register group used by the processor in a Bypass mode, and writing the processor writing channel signal into the backup register group after delayed latching;
a23, if the state of the register group used by the processor is abnormal at the current moment, taking the backup register group at the previous moment as the register group used by the current processor, and writing the processor write channel signal into the register group used by the current processor in a Bypass mode; and taking the register group used by the processor at the previous moment as the current backup register group, and writing the write channel signal of the processor into the current backup register group after delaying and latching.
3. A method as claimed in claim 2, wherein step a4 includes:
a41, if the state of the register group used by the processor is abnormal at the current moment, acquiring the instruction and the PC value corresponding to the moment when the error occurs;
a42, pausing pipelines of a processor fetch stage, a decoding stage, an execution stage and a write-back stage;
a43, inserting a plurality of NOP instructions between the instruction fetching stage and the decoding stage;
a44, resuming the pipeline of the processor decode stage, execute stage, and write-back stage, such that the processor executes the NOP instruction inserted in step A43;
a45, replacing the instruction-fetching PC value of the instruction-fetching RAM in the instruction-fetching stage of the processor with the PC value corresponding to the error-occurring time according to the instruction and the PC value corresponding to the error-occurring time;
a46, restoring the pipeline of the instruction fetching stage of the processor;
a47, obtaining the Depth FIFO _ Depth of the prefetch finger FIFO, and generating a strobe signal lasting FIFO _ Depth for a clock cycle, so that the instruction entering the decode stage is directly provided by the instruction output of the fetch RAM.
4. The method as claimed in claim 2, wherein the delayed latching of the write channel signal of the processor is specifically: and delaying the signal of the writing channel of the processor for three cycles to carry out latch operation.
5. The method of claim 4, wherein the write channel signal delayed by three clock cycles is latched and released according to the rearranged instruction stream; specifically, the method comprises the following steps:
delaying the rearranged instruction stream by one beat; comparing the instruction stream delayed by one beat with the instruction stream not delayed, and releasing the write channel signal delayed by three clock cycles if the current instruction executed by the processor is completed; if the processor is still executing the current instruction, the write channel signal delayed by three clock cycles is latched.
6. A system for real-time recovery of exception status of a register set of a processor, comprising: the device comprises a latch backup module, an instruction rearrangement module, a register group abnormal state detection module and a rollback recovery module;
the instruction rearrangement module collects the instruction stream entering the decoding stage at the instruction fetching stage of the processor, reorders the collected instruction stream to obtain the real execution sequence of the instruction stream at the execution stage, and finally sends the rearranged instruction stream to the register group abnormity detection module and the latch backup module;
the latch backup module is used for carrying out latch backup on channel signals written into the register group by the processor and determining the output register group according to the real-time detection result of the register group abnormity detection module;
the register group abnormal state detection module finishes detecting the abnormal state of the register group in real time, then outputs a real-time detection result and simultaneously outputs an instruction and an instruction PC value corresponding to the moment when the register group generates an abnormal error;
and the rollback recovery module recovers the abnormal state of the register group of the processor in real time according to the abnormal state detection result of the register group, the instruction and the PC value corresponding to the abnormal state occurrence moment and the latched backup register group.
7. A system for real-time recovery of exception status of a register set of a processor as defined in claim 6, wherein said latch backup module comprises: the device comprises a first register group, a second register group, a first delay latch module, a second delay latch module, a first Bypass, a second Bypass, a first multi-way switch, a second multi-way switch, a third multi-way switch and a phase inverter, wherein the first multi-way switch selects a data source entering a write channel of the first register group as the first Bypass or the first delay latch module according to the real-time detection result of an abnormality detection module of the register group; the real-time detection result of the register group abnormity detection module is used as the input of the inverter, and the second multi-way switch selects the data source entering the write channel of the second register group as a second Bypass or a second delay latch module according to the output result of the inverter; and the third multi-way switch selects the register group to output as the first register group or the second register group according to the real-time detection result of the register group abnormity detection module.
8. A real-time recovery system for abnormal status of register sets of a processor as claimed in claim 7, wherein one of the first register set and the second register set is used as a register set for the processor, and the other one is used as a backup register set;
if the real-time detection result of the register group abnormity detection module is that the state of the register group is normal, the multi-way switch corresponding to the register group used by the processor selects the write channel data source of the register group used by the processor as Bypass corresponding to the register group used by the processor, and the multi-way switch corresponding to the backup register group selects the write channel data source of the register group used by the backup register group as the delay latch module corresponding to the backup register group;
if the real-time detection result of the register group abnormity detection module is that the state of the register group is abnormal, taking the backup register group at the previous moment as the register group used by the current processor, and selecting a write channel data source of the register group used by the current processor to be Bypass corresponding to the register group used by the current processor by a multi-way switch corresponding to the register group used by the current processor; and the register group used by the processor at the previous moment is used as the current backup register group, and the multi-way switch corresponding to the current backup register group selects the data source entering the write channel of the current backup register group as the delay latch module corresponding to the current backup register group.
9. The system of claim 7, wherein the first or second delayed latch module latches and releases the write channel signal delayed by three clock cycles according to the instruction stream generated by the instruction rearrangement module; specifically, the method comprises the following steps:
delaying the rearranged instruction stream by one beat; comparing the instruction stream delayed by one beat with the instruction stream not delayed, and if the current instruction executed by the processor is completed, releasing the write channel signal delayed by three clock cycles by the first delay latch module or the second delay latch module; if the processor is still executing the current instruction, the first delay latch module or the second delay latch module latches the write channel signal delayed by three clock cycles.
10. A system for real-time recovery of exception status of a register file of a processor as defined in claim 7, wherein the rollback recovery module comprises: the device comprises a NOP instruction insertion module, a PC address replacement module and a prefetch instruction FIFO processing module;
after the processor pipeline is suspended, the NOP instruction insertion module inserts a plurality of NOP instructions into an instruction output path of an instruction fetching stage of the processor pipeline; generating enable signals to resume the processor decode stage, execute stage, and write back stage pipelines when insertion of a NOP instruction is complete;
the PC address replacing module replaces the instruction fetching PC address of the instruction fetching RAM of the processor pre-instruction fetching module with the PC address corresponding to the moment when the abnormal error occurs in the register group, and the running water of the instruction fetching stage is immediately recovered after the instruction replacement is completed;
the prefetch finger FIFO processing module generates a strobe signal lasting FIFO _ Depth for a clock cycle length according to the Depth FIFO _ Depth of the prefetch finger FIFO.
CN202210262087.4A 2022-03-17 2022-03-17 Real-time recovery method and system for abnormal errors of processor register set Active CN114610519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210262087.4A CN114610519B (en) 2022-03-17 2022-03-17 Real-time recovery method and system for abnormal errors of processor register set

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210262087.4A CN114610519B (en) 2022-03-17 2022-03-17 Real-time recovery method and system for abnormal errors of processor register set

Publications (2)

Publication Number Publication Date
CN114610519A true CN114610519A (en) 2022-06-10
CN114610519B CN114610519B (en) 2023-03-14

Family

ID=81863794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210262087.4A Active CN114610519B (en) 2022-03-17 2022-03-17 Real-time recovery method and system for abnormal errors of processor register set

Country Status (1)

Country Link
CN (1) CN114610519B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328690A (en) * 2022-10-13 2022-11-11 北京登临科技有限公司 Exception handling method, computer readable medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4805095A (en) * 1985-12-23 1989-02-14 Ncr Corporation Circuit and a method for the selection of original data from a register log containing original and modified data
CN101313281A (en) * 2005-11-18 2008-11-26 罗伯特·博世有限公司 Apparatus and method for eliminating errors in a system having at least two execution units with registers
US20140136895A1 (en) * 2012-11-09 2014-05-15 International Business Machines Corporation Exposed-pipeline processing element with rollback
CN109215728A (en) * 2017-07-01 2019-01-15 英特尔公司 Memory circuit and method for distributed memory hazard detection and Fault recovery
CN112905995A (en) * 2021-02-05 2021-06-04 电子科技大学 Method and system for detecting abnormal behaviors of register group in processor in real time

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4805095A (en) * 1985-12-23 1989-02-14 Ncr Corporation Circuit and a method for the selection of original data from a register log containing original and modified data
CN101313281A (en) * 2005-11-18 2008-11-26 罗伯特·博世有限公司 Apparatus and method for eliminating errors in a system having at least two execution units with registers
US20140136895A1 (en) * 2012-11-09 2014-05-15 International Business Machines Corporation Exposed-pipeline processing element with rollback
CN109215728A (en) * 2017-07-01 2019-01-15 英特尔公司 Memory circuit and method for distributed memory hazard detection and Fault recovery
CN112905995A (en) * 2021-02-05 2021-06-04 电子科技大学 Method and system for detecting abnormal behaviors of register group in processor in real time

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LEIBO LIU等: "Jintide®: A Hardware Security Enhanced Server CPU with Xeon® Cores under Runtime Surveillance by an In-Package Dynamically Reconfigurable Processor", 《2019 IEEE HOT CHIPS 31 SYMPOSIUM (HCS)》 *
SHIWEI YUAN等: "Real-time detection of hardware trojan attacks on General-Purpose Registers in a RISC-V processor", 《IEICE ELECTRONICS EXPRESS》 *
赵宗民等: "基于寄存器级的动态信息流跟踪技术研究", 《信息技术与信息化》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328690A (en) * 2022-10-13 2022-11-11 北京登临科技有限公司 Exception handling method, computer readable medium and electronic device
CN115328690B (en) * 2022-10-13 2023-02-17 北京登临科技有限公司 Exception handling method, computer readable medium and electronic device

Also Published As

Publication number Publication date
CN114610519B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
US9619233B2 (en) Computer processor providing exception handling with reduced state storage
US7401273B2 (en) Recovery from errors in a data processing apparatus
Austin DIVA: A reliable substrate for deep submicron microarchitecture design
Sahoo et al. Using likely program invariants to detect hardware errors
TWI613588B (en) Method, microprocessor and computer program for synchronizing operations among cores
US7308607B2 (en) Periodic checkpointing in a redundantly multi-threaded architecture
US7827443B2 (en) Processor instruction retry recovery
US20100031084A1 (en) Checkpointing in a processor that supports simultaneous speculative threading
US20050050386A1 (en) Hardware recovery in a multi-threaded architecture
Austin DIVA: A dynamic approach to microprocessor verification
US8347066B2 (en) Replay instruction morphing
CN114610519B (en) Real-time recovery method and system for abnormal errors of processor register set
Papadimitriou et al. Avgi: Microarchitecture-driven, fast and accurate vulnerability assessment
Jones et al. Evaluating the effects of compiler optimisations on AVF
Valadimas et al. Timing error tolerance in small core designs for SoC applications
KR100508320B1 (en) Processor having replay architecture with fast and slow replay paths
Shankar et al. Control focused soft error detection for embedded applications
Shazli et al. Transient error detection and recovery in processor pipelines
Jeitler et al. Low latency recovery from transient faults for pipelined processor architectures
Maniatakos et al. Design and evaluation of a timestamp-based concurrent error detection method (CED) in a modern microprocessor controller
Gabor et al. Error-shielded register renaming sub-system for a dynamically scheduled out-of-order core
CN111581676B (en) Processor DPA attack resisting system under double-core lock step fault tolerance
US9645882B2 (en) Field repairable logic
Subramanyan Efficient fault tolerance in chip multiprocessors using critical value forwarding
Lee Fault sensitivity analysis of a 32-bit RISC microprocessor

Legal Events

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