hashstp

Hash Store Privileged

hashstp RA

Privileged version of hash store.

Details

The hashstp instruction stores a doubleword into memory at an effective address calculated from registers RA and RB, using a privileged operation. It checks if the stored value matches a previously computed hash; if not, it triggers a trap.

Pseudocode Operation

DW ←32×DX + D
d ←EXTS(0b111_1111 || DW || 0b000)
EA ←(RA) + d
temp ←HashDigest((RA),(RB),(HASHPKEYR))
temp1 ←MEM(EA, 8)
if (temp ≠ temp1) then TRAP

Programming Note

The hashstp instruction is used for storing a doubleword into memory while verifying its integrity against a previously computed hash. It requires privileged access and must be executed in a context where the MSR register allows such operations. Ensure that the effective address (EA) is correctly calculated and aligned to avoid exceptions. If the stored value does not match the expected hash, a trap will occur, necessitating proper error handling.

Example

hashstp r4

Encoding

Binary Layout
31
0
/
6
RA
11
/
16
723
21
/
31
 
Format X-form
Opcode 0x7C0005A3
Extension Privileged
Registers Altered MSR

Operands

  • RA
    Address