Skip to content

Commit

Permalink
Split off ENDBR32/64 from CHESS branch (#2533)
Browse files Browse the repository at this point in the history
Seeing as they're fancy NOP's, I don't think there's any reason not to merge them into `master`, and thus avoid aggressively concretizing the state in order to emulate them under Unicorn.
  • Loading branch information
Eric Hennenfent committed Feb 16, 2022
1 parent 2e2258c commit a50b856
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions manticore/native/cpu/x86.py
Original file line number Diff line number Diff line change
Expand Up @@ -5571,6 +5571,35 @@ def NOP(cpu, arg0=None):
:param arg0: this argument is ignored.
"""

@instruction
def ENDBR32(cpu):
"""
The ENDBRANCH is a new instruction that is used to mark valid jump target
addresses of indirect calls and jumps in the program. This instruction
opcode is selected to be one that is a NOP on legacy machines such that
programs compiled with ENDBRANCH new instruction continue to function on
old machines without the CET enforcement. On processors that support CET
the ENDBRANCH is still a NOP and is primarily used as a marker instruction
by the processor pipeline to detect control flow violations.
This is the 32-bit variant.
:param cpu: current CPU.
"""
pass

@instruction
def ENDBR64(cpu):
"""
The ENDBRANCH is a new instruction that is used to mark valid jump target
addresses of indirect calls and jumps in the program. This instruction
opcode is selected to be one that is a NOP on legacy machines such that
programs compiled with ENDBRANCH new instruction continue to function on
old machines without the CET enforcement. On processors that support CET
the ENDBRANCH is still a NOP and is primarily used as a marker instruction
by the processor pipeline to detect control flow violations.
:param cpu: current CPU.
"""
pass

@instruction
def MOVD(cpu, op0, op1):
cpu._writeCorrectSize(op0, op1)
Expand Down

0 comments on commit a50b856

Please sign in to comment.