Skip to content
Open
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7baf0bf
docs(ssp): shadow stack pointer - issue #560
sudo-apt-abdullah Aug 4, 2025
274f590
docs(ssp): improved it a bit
sudo-apt-abdullah Aug 4, 2025
7687c4e
docs(ssp): addressed the concerns
sudo-apt-abdullah Aug 5, 2025
0bf9bf3
docs(ssp): modified the file to increase readablity
sudo-apt-abdullah Aug 5, 2025
dc30397
docs(ssp): fixed the indentation
sudo-apt-abdullah Aug 5, 2025
cc23c1d
docs(ssp): fixed issue with CI check
sudo-apt-abdullah Aug 5, 2025
aacade9
fix: handle dynamic csr field locations when csr length is XLEN
dhower-qc Aug 5, 2025
46c47ad
Merge branch 'main' into issues
sudo-apt-abdullah Aug 6, 2025
076dce1
docs(ssp): added sse field in menvcfg csr
sudo-apt-abdullah Aug 7, 2025
8267051
docs(ssp): merged aacade9
sudo-apt-abdullah Aug 7, 2025
0b60f08
docs(ssp): added see field in senvcfg and henvcfg
sudo-apt-abdullah Aug 8, 2025
f676a67
Merge branch 'main' into issues
sudo-apt-abdullah Aug 8, 2025
f745105
docs(ssp): addressed the concerns so far
sudo-apt-abdullah Aug 11, 2025
9e451f9
Merge branch 'main' into issues
sudo-apt-abdullah Aug 11, 2025
0c5e4f8
Merge branch 'main' into issues
sudo-apt-abdullah Aug 18, 2025
86cfc3e
docs(ssp): addressed the concerns so far
sudo-apt-abdullah Aug 18, 2025
266196f
docs(ssp): added sw_write for xenvcfg.sse
sudo-apt-abdullah Aug 18, 2025
1c6ce38
Merge branch 'main' into issues
sudo-apt-abdullah Aug 21, 2025
33ea676
Merge branch 'main' into issues
sudo-apt-abdullah Aug 25, 2025
756dc6d
docs(ssp): Used the exact suggested syntax for definedBy
sudo-apt-abdullah Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions spec/std/isa/csr/ssp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright (c) Katherine Hsu
# SPDX-License-Identifier: BSD-3-Clause-Clear

# yaml-language-server: $schema=../../../schemas/csr_schema.json

$schema: "csr_schema.json#"
kind: csr
name: ssp
long_name: Shadow Stack Pointer
address: 0x011
description:
- id: csr-ssp-purpose
normative: true
text: |
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.
priv_mode: U
length: XLEN
definedBy: Zicfiss
fields:
VALUE:
location_rv64: 63-3
location_rv32: 31-2
description: |
The value in ssp points to the top of the shadow stack, which is the address
of the last element stored on the shadow stack.
type: RW
reset_value: UNDEFINED_LEGAL
sw_write(csr_value): |
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 {
return csr_value.VALUE
}
sw_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);
}