hashchk

Hash Check

hashchk RA

Checks the hash of the Return Address Stack (ROP Protection).

Details

The hashchk instruction compares the doubleword hash value computed from the contents of RA, RB, and the privileged SPR HASHKEYR with the doubleword in storage addressed by EA. If they are unequal, the system trap handler is invoked.

Pseudocode Operation

DW ← 32×DX + D
EA ← (RA) + d
temp ← HashDigest((RA), (RB), HASHKEYR)
temp1 ← MEM(EA, 8)
if (temp ≠ temp1) then TRAP

Programming Note

If RA=0, the instruction form is invalid. EA must be a multiple of 8.

Example

hashchk r4

Encoding

Binary Layout
31
0
/
6
RA
11
/
16
754
/
 
Format X-form
Opcode 0x7C0005E2
Extension Base
Registers Altered HASHKEYR

Operands

  • RA
    Address
  • RB
    Source General Purpose Register
  • offset
    Offset value
  • RT
    Target General Purpose Register