hashst

Hash Store

hashst RA

Stores the computed doubleword hash value to a doubleword storage location.

Details

Computes and stores a 64-bit hash value derived from the contents at the memory address RA. The hash is calculated based on the address and associated data, then written to the doubleword storage location at RA. This is a privileged instruction used for Return-Oriented Programming (ROP) protection.

Pseudocode Operation

hash_addr ← RA
hash_value ← ComputeHash(hash_addr)
[hash_addr] ← hash_value

Programming Note

The EA specified by the Hash instructions — (RA) + EXTS(0b111_1111 || DW || 0b000) — can be expressed as (RA) −(64−DW)×8. Therefore the Hash instructions can only access one of the 64 doublewords preceding the address provided by RA.

Example

hashst r4

Encoding

Binary Layout
0
0
D
6
RA
11
RB
16
DX
21
754
26
 
Format X-form
Opcode 0x7C0005A4
Extension Base
Registers Altered HASHKEYR

Operands

  • RA
    Address
  • RB
    Source General Purpose Register
  • offset
    Offset to be added to the base address in RA
  • offset
    Offset to be added to the base address in RB