← Home

ssp

Shadow Stack Pointer

Address: 0x011 (17) · Privilege: U · Length: XLEN · Writable · Defined by: Zicfiss

The `ssp` CSR is an unprivileged read-write (URW) CSR that reads and writes XLEN low order bits of the shadow stack pointer. The `ssp` is always as wide as the XLEN of the current privilege mode. The bits 1:0 of ssp are read-only zero. If the UXLEN or SXLEN may never be 32, then the bit 2 is also read-only zero.

Fields

RV32

31:2423:1615:87:0
VALUE—

RV64

63:5655:4847:4039:3231:2423:1615:87:0
VALUE—
BitsFieldAliasDescriptionTypeReset
RV32 [31:2]
RV64 [63:3]
VALUEThe value in ssp points to the top of the shadow stack, which is the address of the last element stored on the shadow stack.RWUNDEFINED_LEGAL

Software read

if ((mode() < PrivilegeMode::M && CSR[menvcfg].SSE == 0) ||
    (mode() == PrivilegeMode::U && CSR[senvcfg].SSE == 0)) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if ((mode() == PrivilegeMode::VS && CSR[henvcfg].SSE == 0) ||
           (mode() == PrivilegeMode::VU && (CSR[henvcfg].SSE == 0 || CSR[senvcfg].SSE == 0))) {
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
} else if (xlen() == 32) {
  return ($bits(CSR[ssp]) & ~MXLEN'3);
}
return ($bits(CSR[ssp]) & ~MXLEN'7);

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.