CSR Bit Fields

RISC-V mstatush CSR Register

Address 0x310Privilege MachineAccess RW / 32Machine status, trap, and interrupt CSRs

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

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

Understand mstatush By Bit Fields

0 key fields
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.

mstatush address, lowest access privilege, and access class are checked against the official CSR table: 0x310, Machine, RW.
On RV32, mstatush generally carries fields corresponding to RV64 mstatus bits 62:36.
The official Machine chapter states that SD, SXL, and UXL do not exist in mstatush; do not describe it as an RV32 SXL/UXL register.

What To Check First When Reading This CSR

  • - First confirm that the current hart implements mstatush; unimplemented or insufficiently privileged accesses raise an illegal-instruction exception.
  • - Use address 0x310 and the lowest access privilege (Machine) 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 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.