CSR Bit Fields

RISC-V mstatush CSR Register

Address 0x310Privilege MachineAccess RW / 32-bit (RV32 only)Machine status, trap, and interrupt CSRs

Additional machine status register (RV32 only); holds extra fields of mstatus that don't fit in 32 bits.

Field Map

Understand mstatush By Bit Fields

9 key fields
31:11

WPRI

WPRI

Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

WPRI (bits 31:11) — Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

What This Field Controls

  • - Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

Common Values

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

10

MDT

WARL-H

M-mode-disable-trap bit (Smdbltrp); in RV32 corresponds to RV64 mstatus[42].

MDT (bit 10) — M-mode-disable-trap bit (Smdbltrp); in RV32 corresponds to RV64 mstatus[42].

What This Field Controls

  • - M-mode-disable-trap bit (Smdbltrp); in RV32 corresponds to RV64 mstatus[42].

Common Values

00

Machine double-trap guard is not set.

11

Machine double-trap guard is set; later M-mode traps follow Smdbltrp rules.

9

MPELP

RW-H (Zicfilp)

Machine Previous Expected Landing Pad state defined by Zicfilp; on RV32 this corresponds to RV64 mstatus[41].

MPELP (bit 9) — Machine Previous Expected Landing Pad state defined by Zicfilp; on RV32 this corresponds to RV64 mstatus[41].

What This Field Controls

  • - Machine Previous Expected Landing Pad state defined by Zicfilp; on RV32 this corresponds to RV64 mstatus[41].

Common Values

00

No landing-pad instruction is expected.

11

A landing-pad instruction is expected.

8

WPRI

WPRI

Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

WPRI (bit 8) — Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

What This Field Controls

  • - Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

Common Values

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

7

MPV

RW-H

Previous virtualization mode defined by the Hypervisor extension; in RV32 corresponds to RV64 mstatus[39]. This field does not exist without the Hypervisor extension.

MPV (bit 7) — Previous virtualization mode defined by the Hypervisor extension; in RV32 corresponds to RV64 mstatus[39]. This field does not exist without the Hypervisor extension.

What This Field Controls

  • - Previous virtualization mode defined by the Hypervisor extension; in RV32 corresponds to RV64 mstatus[39]. This field does not exist without the Hypervisor extension.

Common Values

00

Execution before the M-mode trap was not virtualized.

11

Execution before the M-mode trap was virtualized.

6

GVA

RW-H

Defined by the Hypervisor extension; indicates whether mtval contains a guest virtual address and corresponds to RV64 mstatus[38]. This field does not exist without the Hypervisor extension.

GVA (bit 6) — Defined by the Hypervisor extension; indicates whether mtval contains a guest virtual address and corresponds to RV64 mstatus[38]. This field does not exist without the Hypervisor extension.

What This Field Controls

  • - Defined by the Hypervisor extension; indicates whether mtval contains a guest virtual address and corresponds to RV64 mstatus[38]. This field does not exist without the Hypervisor extension.

Common Values

00

The address in mtval is not a guest virtual address.

11

The address in mtval is a guest virtual address.

5

MBE

WARL

Controls non-instruction-fetch M-mode memory-access endianness when MPRV=0; in RV32 corresponds to RV64 mstatus[37].

MBE (bit 5) — Controls non-instruction-fetch M-mode memory-access endianness when MPRV=0; in RV32 corresponds to RV64 mstatus[37].

What This Field Controls

  • - Controls non-instruction-fetch M-mode memory-access endianness when MPRV=0; in RV32 corresponds to RV64 mstatus[37].

Common Values

0Little-endian

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

1Big-endian

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

4

SBE

WARL/RO0/RO-copy

S-mode explicit memory-access endianness control; read-only zero if S-mode is not implemented and may be a read-only copy of MBE; in RV32 corresponds to RV64 mstatus[36].

SBE (bit 4) — S-mode explicit memory-access endianness control; read-only zero if S-mode is not implemented and may be a read-only copy of MBE; in RV32 corresponds to RV64 mstatus[36].

What This Field Controls

  • - S-mode explicit memory-access endianness control; read-only zero if S-mode is not implemented and may be a read-only copy of MBE; in RV32 corresponds to RV64 mstatus[36].

Common Values

0Little-endian

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

1Big-endian

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

3:0

WPRI

WPRI

Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

WPRI (bits 3:0) — Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

What This Field Controls

  • - Reserved WPRI bits; software should preserve their values on writes and ignore their values on reads.

Common Values

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

Official Basis & Search Notes

mstatush exists only for RV32 and carries high-order mstatus fields. The official specification states that SD, SXL, and UXL do not exist in mstatush.

The official CSR table and Machine chapter define mstatush as a 32-bit Machine RW CSR that exists only on RV32, at address 0x310.
mstatush bits 30:4 generally correspond to RV64 mstatus bits 62:36; the field map also identifies the WPRI regions explicitly.
SD, SXL, and UXL do not exist in mstatush; MPELP is bit 9 and MDT is bit 10.

What To Check First When Reading This CSR

  • - mstatush exists only on RV32 at address 0x310; accessing this high-half CSR address on RV64 raises an illegal-instruction exception.
  • - It carries several fields corresponding to RV64 mstatus[62:36], but does not contain SD, SXL, or UXL.
  • - Interpret extension-dependent fields according to the implemented Zicfilp, Smdbltrp, and Hypervisor extensions.

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 mstatush 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 mstatush 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 mstatush as Machine. Access with insufficient privilege or to an unimplemented CSR raises an illegal-instruction exception.

What is easiest to miss when writing mstatush?

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.