CSR Bit Fields

RISC-V sstatus CSR Register

Address 0x100Privilege SupervisorAccess RW / XLENSupervisor status, trap, and interrupt CSRs

Supervisor status register; a restricted view of mstatus containing S-mode-relevant fields.

The sstatus (Supervisor Status) CSR at address 0x100 is a restricted S-mode view of mstatus. It provides SIE (bit 1) for S-mode interrupt enable, SPIE (bit 5) to save pre-trap interrupt state, and SPP (bit 8) to record the privilege level before a trap. Additional fields include SUM (bit 18) for permitting supervisor access to user memory and MXR (bit 19) for making executable pages readable. S-mode interrupt delivery is controlled by S-mode privilege state plus sip/sie pending and enable bits.

Bit Overview
bit 3 = only bit 3; bits 12..11 = bits 12 down to 11
MSBLSB
SD63ROReserved0
Field Map

Understand sstatus By Bit Fields

11 key fields
63

SD

RO

State-dirty summary bit; set when FS, VS, or XS is Dirty. In RV32 this appears at bit 31.

SD (bit 63) — State-dirty summary bit; set when FS, VS, or XS is Dirty. In RV32 this appears at bit 31.

What This Field Controls

  • - State-dirty summary bit; set when FS, VS, or XS is Dirty. In RV32 this appears at bit 31.

Common Values

00

No FS, VS, or XS field is Dirty.

11

At least one of FS, VS, or XS is Dirty.

33:32

UXL

RW

Effective XLEN encoding for U-mode on RV64.

UXL (bits 33:32) — Effective XLEN encoding for U-mode on RV64.

What This Field Controls

  • - Effective XLEN encoding for U-mode on RV64.

Common Values

132-bit

Effective XLEN is 32.

264-bit

Effective XLEN is 64.

3Reserved

Reserved encoding; portable software must not write or depend on it.

19

MXR

RW

Allows loads from executable pages.

MXR (bit 19) — Allows loads from executable pages.

What This Field Controls

  • - Allows loads from executable pages.

Common Values

0Disabled

Loads read only readable pages; MXR has no effect when paged virtual memory is not active.

1Enabled

Loads may read from readable or executable pages; MXR has no effect when paged virtual memory is not active.

18

SUM

RW

Allows S-mode to access U-mode pages.

SUM (bit 18) — Allows S-mode to access U-mode pages.

What This Field Controls

  • - Allows S-mode to access U-mode pages.

Common Values

0Disabled

S-mode accesses to pages with U=1 fault; SUM has no effect when paged virtual memory is not active.

1Enabled

S-mode loads/stores may access pages with U=1; S-mode still cannot execute instructions from user pages.

16:15

XS

RW

Additional user-extension state status.

XS (bits 16:15) — Additional user-extension state status.

What This Field Controls

  • - Additional user-extension state status.

Common Values

0Off

The extension state is off; using the associated extension state traps or is unavailable.

1Initial

The extension state is in its initial state.

2Clean

The extension state matches the saved context in memory.

3Dirty

The extension state may have been modified and typically must be saved on context switch.

14:13

FS

RW

Floating-point state status.

FS (bits 14:13) — Floating-point state status.

What This Field Controls

  • - Floating-point state status.

Common Values

0Off

The extension state is off; using the associated extension state traps or is unavailable.

1Initial

The extension state is in its initial state.

2Clean

The extension state matches the saved context in memory.

3Dirty

The extension state may have been modified and typically must be saved on context switch.

10:9

VS

RW

Vector state status; S-mode view of mstatus.VS.

VS (bits 10:9) — Vector state status; S-mode view of mstatus.VS.

What This Field Controls

  • - Vector state status; S-mode view of mstatus.VS.

Common Values

0Off

The extension state is off; using the associated extension state traps or is unavailable.

1Initial

The extension state is in its initial state.

2Clean

The extension state matches the saved context in memory.

3Dirty

The extension state may have been modified and typically must be saved on context switch.

8

SPP

RW

Privilege mode before entering the S-mode trap.

SPP (bit 8) — Privilege mode before entering the S-mode trap.

What This Field Controls

  • - Privilege mode before entering the S-mode trap.

Common Values

0U

Previous privilege before the S-mode trap was User; SRET returns to U-mode.

1S

Previous privilege before the S-mode trap was Supervisor; SRET returns to S-mode.

6

UBE

RW

Controls endianness of explicit U-mode memory accesses.

UBE (bit 6) — Controls endianness of explicit U-mode memory accesses.

What This Field Controls

  • - Controls endianness of explicit U-mode memory accesses.

Common Values

0Little-endian

U-mode explicit memory accesses are little-endian; instruction fetch is not affected by this bit.

1Big-endian

U-mode explicit memory accesses are big-endian; instruction fetch is not affected by this bit.

5

SPIE

RW

Saved SIE value before entering an S-mode trap.

SPIE (bit 5) — Saved SIE value before entering an S-mode trap.

What This Field Controls

  • - Saved SIE value before entering an S-mode trap.

Common Values

00

SIE was 0 before the S-mode trap, or the saved post-return interrupt state is disabled.

11

SIE was 1 before the S-mode trap and SRET can restore it under the rules.

1

SIE

RW

Global interrupt enable for S-mode.

SIE (bit 1) — Global interrupt enable for S-mode.

What This Field Controls

  • - Global interrupt enable for S-mode.

Common Values

0Disabled

When currently running in S-mode, global supervisor interrupts are disabled.

1Enabled

When currently running in S-mode, global supervisor interrupts are enabled; delivery also depends on sie/sip.

Official Basis & Search Notes

sstatus is a RW CSR in supervisor status, trap, and interrupt csrs at 0x100. Check privilege and implemented extensions before interpreting its bit fields.

sstatus address, lowest access privilege, and access class are checked against the official CSR table: 0x100, Supervisor, RW.
Read it as part of supervisor status, trap, and interrupt csrs before interpreting the bit-field table on this page.
Modify only target fields and preserve unchanged bits; interpret WPRI and reserved fields only as the official specification and implementation define them.

Assembly Operation Examples

Read/write sstatus using csrr/csrw/csrs/csrc instructions. Ref: RISC-V Privileged Architecture §2.8

csrr t0, sstatus
Read sstatus (restricted view) from S-mode
csrs sstatus, t0
Set enable bits in sstatus (e.g., enable SIE)
li t0, 0x00000002; csrs sstatus, t0
Enable SIE(bit1) — allow S-mode interrupts

Relationship With Other CSRs

sstatus is the restricted view of S-mode-relevant mstatus fields. S-mode interrupt delivery depends on the current privilege mode, sstatus.SIE, and the corresponding pending/enabled bits in sip/sie; do not reduce it to mstatus.MIE control. On trap entry, hardware saves SIE to SPIE and clears SIE; sret restores SIE from SPIE.

Key Bit Field Reference

SIE(bit1) S-mode interrupt enable | SPIE(bit5) saved SIE before trap | SPP(bit8) pre-trap privilege (0=U,1=S) | SUM(bit18) permit S-mode access to U-mode memory | MXR(bit19) make executable pages readable

What To Check First When Reading This CSR

  • - First confirm that the current hart implements sstatus; unimplemented or insufficiently privileged accesses raise an illegal-instruction exception.
  • - Use address 0x100 and the lowest access privilege (Supervisor) to decide whether software may read it directly.
  • - Do not assume fixed values for reserved, WARL, or WLRL bits; interpret the value according to the specification and implementation.

Risk Checks Before Writing

  • - Preserve bits that are not being changed so reserved or implementation-defined fields are not written with invalid values.
  • - Prefer CSRRS/CSRRC for local set/clear operations to avoid CSRRW overwriting concurrently updated status bits.

Put It Back Into A Real Flow

1

During initialization or the relevant privileged flow, software reads sstatus to observe the current state.

2

Modify only the target fields while preserving all other bits.

3

Read back the CSR or validate through later trap, interrupt, or context-switch behavior that the setting took effect.

FAQ

Can sstatus be accessed from any privilege level?

Do not decide from the CSR name alone. The official CSR address encoding and tables define the lowest access privilege; this entry records sstatus as Supervisor. Access with insufficient privilege or to an unimplemented CSR raises an illegal-instruction exception.

What is easiest to miss when writing sstatus?

Do not overwrite the whole CSR as if it were an ordinary integer. Modify only target fields, preserve unchanged bits, and follow the specification for WARL, WLRL, WPRI, or reserved fields.