hstatus
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
SHSummary
The hstatus register tracks and controls a VS-mode guest.
Syntax / Encoding
CSR 0x600 (S-mode, RW)
Bitfields (11)
| Bits | Field | Description |
|---|---|---|
33:32 | VSXL | [{'text': 'Determines the effective XLEN in VS-mode. Valid values are:\n\n[separator="!"]\n!===\n! Value ! VSXLEN\n\n! 0 ! 32\n! 1 ! 64\n!===\n', 'when()': 'return $array_size(VSXLEN) > 1;'}, {'text': 'Because the implementation only supports a single VSXLEN == 32, this field is read-only-0.\n', 'when()': 'retu |
24 | HUKTE | If the Svukte extension is implemented, the HUKTE field determines whether the HLV, HLVX, and HSV instructions, when executed in U-mode, are Svukte-qualified. When one of these instructions is executed in U-mode, it behaves as though senvcfg.UKTE were set to the value of HUKTE. If Svukte is not implemented, HUKTE is re |
22 | VTSR | When hstatus.VTSR is set, executing the sret instruction in VS-mode raises a Virtual Instruction exception. When hstatus.VTSR is clear, an sret instruction in VS-mode returns control to the mode stored in vsstatus.SPP. |
21 | VTW | When hstatus.VTW is set, a wfi instruction executed in VS-mode raises a Virtual Instruction exception after waiting an implementation-defined amount of time (which can be 0). When both hstatus.VTW and mstatus.TW are clear, a wfi instruction executes in VS-mode without a timeout period. The wfi instruction is also aff |
20 | VTVM | When set, a 'Virtual Instruction trap occurs when executing an sfence.vma, sinval.vma, or an explicit CSR access of the satp (really vsatp) register when in VS-mode. When clear, the instructions execute as normal in VS-mode. Notably, hstatus.VTVM does *not* cause hfence.vvma, sfence.w.inval, or sfence.inval.ir to tra |
17:12 | VGEIN | Selects the guest external interrupt source for VS-level external interrupts. When hstatus.VGEIN == 0, no external interrupt source is selected. When hstatus.VGEIN != 0, it selects which bit of hgeip is currently active in VS-mode. |
9 | HU | When set, the hypervisor load/store instructions (hlv, hlvx, and hsv) can be executed in U-mode. When clear, the hypervisor load/store instructions cause an Illegal Instruction trap. |
8 | SPVP | Written by hardware: * When taking a trap into HS-mode from VS-mode or VU-mode, hstatus.SPVP is written with the nominal privilege mode Notably, unlike its analog mstatus.SPP, hstatus.SPVP is *not* cleared when returning from a trap. Can also be written by software without immediate side-effect. Affects execution b |
7 | SPV | Written by hardware: * On a trap into HS-mode, hardware writes 1 when the prior mode was VS-mode or VU-mode, and 0 otherwise. Can also be written by software without immediate side-effect. Affects execution by: * When an sret instruction in executed in HS-mode or M-mode, control returns to VS-mode or VU-mode (as |
6 | GVA | Written by hardware whenever a trap is taken into HS-mode: * Writes 1 when a trap causes a guest virtual address to be written into stval (Breakpoint, * Address Misaligned, * Access Fault, * Page Fault, or * Guest-Page Fault). * Writes 0 otherwise Does not affect execution. |
5 | VSBE | [{'text': 'Controls the endianness of data VS-mode (0 = little, 1 = big).\nInstructions are always little endian, regardless of the data setting.\n'}, {'text': 'Since the CPU does not support big endian in VS-mode, this is hardwired to 0.\n', 'when()': 'return VS_MODE_ENDIANNESS == "little";'}, {'text': 'Since the CPU |