The invention discloses a processor
chip defense method for ghost
attack based on
control flow misprediction, and belongs to the field of computer
system structure security. The method comprises the following steps of: performing key security control in a
register renaming stage, an instruction transmitting stage and an execution finishing stage of a processor: firstly, dynamically allocating an NSESL level for each instruction, and judging whether to
label a target register according to the NSESL level; secondly, in an instruction transmitting stage, whether the transmission instruction is allowed to be transmitted is judged based on the NSESL and the
label state; finally, after the
branch instruction is analyzed, the NSESL of the instruction in the
reservation station is decreased progressively, and
label clearing operation is executed. The method is suitable for a processor architecture supporting out-of-order execution and
branch prediction, and on the premise that the performance is not obviously influenced, speculation execution security threats caused by ghost attacks based on
control flow misprediction are effectively resisted.