CSR Bit Fields

RISC-V sstatus CSR Register

Address 0x100Privilege SupervisorAccess RW / SXLENSupervisor 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.

Field Map

Understand sstatus By Bit Fields

21 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

WARL

Effective XLEN encoding for U-mode on RV64; this field does not exist when SXLEN=32.

UXL (bits 33:32) — Effective XLEN encoding for U-mode on RV64; this field does not exist when SXLEN=32.

What This Field Controls

  • - Effective XLEN encoding for U-mode on RV64; this field does not exist when SXLEN=32.

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.

24

SDT

WARL/RO0

S-mode-disable-trap bit introduced by Ssdbltrp; explicitly writing 1 clears SIE, and SRET clears SDT. It is read-only zero when Ssdbltrp is not implemented.

SDT (bit 24) — S-mode-disable-trap bit introduced by Ssdbltrp; explicitly writing 1 clears SIE, and SRET clears SDT. It is read-only zero when Ssdbltrp is not implemented.

What This Field Controls

  • - S-mode-disable-trap bit introduced by Ssdbltrp; explicitly writing 1 clears SIE, and SRET clears SDT. It is read-only zero when Ssdbltrp is not implemented.

Common Values

0Normal S-mode trap entry

When Ssdbltrp is implemented and enabled, if SDT is 0 before a trap is taken into S-mode, hardware sets it to 1 and delivers the trap as expected.

1Unexpected-trap detection

When Ssdbltrp is implemented and enabled, if SDT is already 1 when a trap is to be taken into S-mode, the trap is an unexpected trap and a double-trap exception is delivered to M-mode as specified.

23

SPELP

RW (Zicfilp)

Previous expected landing pad state added by Zicfilp; accesses mstatus.SPELP when V=0 and vsstatus.SPELP when V=1.

SPELP (bit 23) — Previous expected landing pad state added by Zicfilp; accesses mstatus.SPELP when V=0 and vsstatus.SPELP when V=1.

What This Field Controls

  • - Previous expected landing pad state added by Zicfilp; accesses mstatus.SPELP when V=0 and vsstatus.SPELP when V=1.

Common Values

0NO_LP_EXPECTED

No landing-pad instruction is expected.

1LP_EXPECTED

A landing-pad instruction is expected.

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/RO0

Allows S-mode to access U-mode pages; SUM is read-only zero if satp.MODE is read-only zero.

SUM (bit 18) — Allows S-mode to access U-mode pages; SUM is read-only zero if satp.MODE is read-only zero.

What This Field Controls

  • - Allows S-mode to access U-mode pages; SUM is read-only zero if satp.MODE is read-only zero.

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

RO/derived

Summary of additional user-extension state; read-only zero when no additional user extensions require new state.

XS (bits 16:15) — Summary of additional user-extension state; read-only zero when no additional user extensions require new state.

What This Field Controls

  • - Summary of additional user-extension state; read-only zero when no additional user extensions require new state.

Common Values

0Off

All additional user-extension state is Off.

1Initial

No additional extension state is Clean or Dirty, and at least one is Initial.

2Clean

No additional extension state is Dirty, and at least one is Clean.

3Dirty

At least one additional extension state is Dirty.

14:13

FS

WARL/optional RO0

Floating-point state. It must not be read-only zero when F is implemented; with S-mode but no F, it may optionally be read-only zero, allowing or disallowing F emulation through invisible traps to M-mode.

FS (bits 14:13) — Floating-point state. It must not be read-only zero when F is implemented; with S-mode but no F, it may optionally be read-only zero, allowing or disallowing F emulation through invisible traps to M-mode.

What This Field Controls

  • - Floating-point state. It must not be read-only zero when F is implemented; with S-mode but no F, it may optionally be read-only zero, allowing or disallowing F emulation through invisible traps to M-mode.

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

WARL/optional RO0

Vector state. It must not be read-only zero when vector registers are implemented; with S-mode but no vector registers, it may optionally be read-only zero.

VS (bits 10:9) — Vector state. It must not be read-only zero when vector registers are implemented; with S-mode but no vector registers, it may optionally be read-only zero.

What This Field Controls

  • - Vector state. It must not be read-only zero when vector registers are implemented; with S-mode but no vector registers, it may optionally be read-only zero.

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

WARL

Privilege mode before entering the S-mode trap; SRET sets this bit to 0 after return.

SPP (bit 8) — Privilege mode before entering the S-mode trap; SRET sets this bit to 0 after return.

What This Field Controls

  • - Privilege mode before entering the S-mode trap; SRET sets this bit to 0 after return.

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

WARL/RO-copy

Controls endianness of explicit U-mode memory accesses; an implementation may make it a read-only copy of S-mode endianness.

UBE (bit 6) — Controls endianness of explicit U-mode memory accesses; an implementation may make it a read-only copy of S-mode endianness.

What This Field Controls

  • - Controls endianness of explicit U-mode memory accesses; an implementation may make it a read-only copy of S-mode endianness.

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; when running in U-mode, this bit is ignored and supervisor-level interrupts are globally enabled.

SIE (bit 1) — Global interrupt enable for S-mode; when running in U-mode, this bit is ignored and supervisor-level interrupts are globally enabled.

What This Field Controls

  • - Global interrupt enable for S-mode; when running in U-mode, this bit is ignored and supervisor-level interrupts are globally enabled.

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.

62:34

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bits 62:34) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

31:25

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bits 31:25) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

22:20

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bits 22:20) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

17

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bit 17) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

12:11

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bits 12:11) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

7

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bit 7) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

4:2

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bits 4:2) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

0

WPRI

WPRI

Reserved bits; writes preserve their values and software ignores values read.

WPRI (bit 0) — Reserved bits; writes preserve their values and software ignores values read.

What This Field Controls

  • - Reserved bits; writes preserve their values and software ignores values read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

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, WPRI, or WARL 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, WPRI, or reserved fields.