hstatus
Hypervisor status register
- Address
0x600- Group
- Hypervisor and VS CSRs
- Privilege
HRW(privileged spec CSR listing, Hypervisor Trap Setup)- Access
- read/write; lowest privilege H (hypervisor, including VS CSRs)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Hypervisor Status
Privileged spec: Hypervisor status register
Description
The hstatus register tracks and controls a VS-mode guest.
Unlike fields in sstatus, which are all aliases of fields mstatus,
bits in hstatus are independent bits and do not have aliases.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VSXL | 33-32 | VS-mode XLen. Applies when the riscv-unified-db condition holds: Determines the effective XLEN in VS-mode. Valid values are:
Applies when the riscv-unified-db condition holds: Because the implementation only supports a single VSXLEN == 32, this field is read-only-0. Applies when the riscv-unified-db condition holds: Because the implementation only supports a single VSXLEN == 64, this field is read-only-1. | |||||||||||||||||||||||||||
HUKTE | 24 | RW | Hypervisor UKTE. 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
| ||||||||||||||||||||||||||
VTSR | 22 | RW | Virtual Trap SRET. When When | ||||||||||||||||||||||||||
VTW | 21 | RW | Virtual Trap WFI. When When both The
| ||||||||||||||||||||||||||
VTVM | 20 | RW | Virtual Trap Virtual Memory. When set, a 'Virtual Instruction` trap occurs when executing an When clear, the instructions execute as normal in VS-mode. Notably,
| ||||||||||||||||||||||||||
VGEIN | 17-12 | Virtual Guest External Interrupt Number. Selects the guest external interrupt source for VS-level external interrupts. When When | |||||||||||||||||||||||||||
HU | 9 | RW | Hypervisor in U-mode. When set, the hypervisor load/store instructions ( When clear, the hypervisor load/store instructions cause an | ||||||||||||||||||||||||||
SPVP | 8 | RW | Supervisor Previous Virtual Privilege. Written by hardware:
Notably, unlike its analog Can also be written by software without immediate side-effect. Affects execution by:
| ||||||||||||||||||||||||||
SPV | 7 | RW | Supervisor Previous Virtualization Mode. Written by hardware:
Can also be written by software without immediate side-effect. Affects execution by:
| ||||||||||||||||||||||||||
GVA | 6 | RW | Guest Virtual Address. Written by hardware whenever a trap is taken into HS-mode:
Does not affect execution. | ||||||||||||||||||||||||||
VSBE | 5 | VS-mode Big Endian. Controls the endianness of data VS-mode (0 = little, 1 = big). Instructions are always little endian, regardless of the data setting. Applies when the riscv-unified-db condition holds: Since the CPU does not support big endian in VS-mode, this is hardwired to 0. Applies when the riscv-unified-db condition holds: Since the CPU does not support little endian in VS-mode, this is hardwired to 1. |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/hstatus.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)