RDSSPD, RDSSPQ

Read Shadow Stack Pointer

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
F3 0F 1E /1 (mod=11)RDSSPD r32RValidValidCopy low 32 bits of shadow stack pointer (SSP) to r32.
F3 REX.W 0F 1E /1 (mod=11)RDSSPQ r64RValidNot encodableCopies shadow stack pointer (SSP) to r64.

Operand encoding

Each mode is a value of the Op/En column above. It says which field of the encoded instruction carries each operand, in the order they are written, and whether the instruction reads it, writes it or both.

R

  1. modrm.rm escrituraModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them

Measured cost

Loading measurements from arch-data...

Description

Copies the current shadow stack pointer (SSP) register to the register destination. This opcode is a NOP when CET shadow stacks are not enabled and on processors that do not support CET.

Operation

IF CPL = 3
    IF CR4.CET & IA32_U_CET.SH_STK_EN
          IF (operand size is 64 bit)
                THEN
                      Dest := SSP;
                ELSE
                      Dest := SSP[31:0];
          FI;
    FI;

ELSE
    IF CR4.CET & IA32_S_CET.SH_STK_EN
          IF (operand size is 64 bit)
                THEN
                      Dest := SSP;
                ELSE
                      Dest := SSP[31:0];
          FI;
    FI;

FI;

Flags affected

None.

C/C++ Compiler Intrinsic Equivalent

RDSSPD__int32 _rdsspd_i32(void); RDSSPQ__int64 _rdsspq_i64(void);

Exceptions

Real address mode
#UDIf the LOCK prefix is used.
Protected mode
#UDIf the LOCK prefix is used.
Virtual-8086 mode
#UDIf the LOCK prefix is used.
Compatibility mode
#UDIf the LOCK prefix is used.
64-bit mode
#UDIf the LOCK prefix is used.

Sources