RDSSPD/RDSSPQ—Read Shadow Stack Pointer

Opcode/

Op/

64/32

CPUID

Description

Instruction En bit Mode Support Feature Flag
F3 0F 1E /1 (mod=11) RDSSPD r32 R V/V CET_SS Copy low 32 bits of shadow stack pointer (SSP) to r32.
F3 REX.W 0F 1E /1 (mod=11) RDSSPQ r64 R V/N.E. CET_SS Copies shadow stack pointer (SSP) to r64.

Instruction Operand Encoding

Op/En Operand 1 Operand 2 Operand 3 Operand 4
R ModRM:r/m (w) NA NA NA

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);

Protected Mode Exceptions

None.

Real-Address Mode Exceptions

None.

Virtual-8086 Mode Exceptions

None.

Compatibility Mode Exceptions

None.

64-Bit Mode Exceptions

None.