henvcfg
Hypervisor environment configuration register
- Address
0x60A- Group
- Hypervisor and VS CSRs
- Privilege
HRW(privileged spec CSR listing, Hypervisor Configuration)- Access
- read/write; lowest privilege H (hypervisor, including VS CSRs)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Hypervisor Environment Configuration
Privileged spec: Hypervisor environment configuration register
Description
The henvcfg CSR is a 64-bit read/write register that controls certain characteristics of the execution environment when virtualization mode V=1.
If bit henvcfg.FIOM (Fence of I/O implies Memory) is set to one in henvcfg, fence
instructions executed when V=1 are modified so the requirement to order accesses to device I/O
implies also the requirement to order main memory accesses.
henvcfg FIOM details the modified interpretation of FENCE instruction bits PI, PO, SI, and SO when FIOM=1 and V=1.
Similarly, when henvcfg.FIOM=1 and V=1, if an atomic instruction that accesses a
region ordered as device I/O has its aq and/or rl bit set, then that
instruction is ordered as though it accesses both device I/O and memory.
Modified interpretation of FENCE predecessor and successor sets when FIOM=1 and virtualization mode V=1.
| Instruction bit | Meaning when set |
|---|---|
| PI + PO | |
| Predecessor device input and memory reads (PR implied) + Predecessor device output and memory writes (PW implied) | |
| SI + SO | |
| Successor device input and memory reads (SR implied) + Successor device output and memory writes (SW implied) |
The PBMTE bit controls whether the Svpbmt extension is available for use in VS-stage address translation. When PBMTE=1, Svpbmt is available for VS-stage address translation. When PBMTE=0, the implementation behaves as though Svpbmt were not implemented for VS-stage address translation. If Svpbmt is not implemented, PBMTE is read-only zero.
If the Svadu extension is implemented, the ADUE bit controls whether hardware updating of PTE A/D bits is enabled for VS-stage address translation. When ADUE=1, hardware updating of PTE A/D bits is enabled during VS-stage address translation, and the implementation behaves as though the Svade extension were not implemented for VS-mode address translation. When ADUE=0, the implementation behaves as though Svade were implemented for VS-stage address translation. If Svadu is not implemented, ADUE is read-only zero.
The definition of the STCE field is furnished by the Sstc extension.
The definition of the CBZE field is furnished by the Zicboz extension.
The definitions of the CBCFE and CBIE fields are furnished by the Zicbom extension.
The definition of the PMM field will be furnished by the forthcoming
Ssnpm extension. Its allocation within henvcfg may change prior to the
ratification of that extension.
The Zicfilp extension adds the LPE field in henvcfg. When the LPE field
is set to 1, the Zicfilp extension is enabled in VS-mode. When the LPE field
is 0, the Zicfilp extension is not enabled in VS-mode and the following rules
apply to VS-mode:
- The hart does not update the
ELPstate; it remains asNO_LP_EXPECTED. - The
LPADinstruction operates as a no-op.
The Zicfiss extension adds the SSE field in henvcfg. If the SSE field is
set to 1, the Zicfiss extension is activated in VS-mode. When the SSE field is
0, the Zicfiss extension remains inactive in VS-mode, and the following rules
apply when V=1:
- 32-bit Zicfiss instructions will revert to their behavior as defined by Zimop.
- 16-bit Zicfiss instructions will revert to their behavior as defined by Zcmop.
- The
pte.xwr=010bencoding in VS-stage page tables becomes reserved. - The
senvcfg.SSEfield will read as zero and is read-only. - When
menvcfg.SSEis one,SSAMOSWAP.W/Draises a virtual instruction exception.
The Ssdbltrp extension adds the double-trap-enable (DTE) field in henvcfg.
When henvcfg.DTE is zero, the implementation behaves as though Ssdbltrp is not
implemented for VS-mode and the vsstatus.SDT bit is read-only zero.
When XLEN=32, henvcfgh is a
32-bit read/write register that aliases bits 63:32
of henvcfg. Register henvcfgh does not exist when
XLEN=64.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
STCE | 63 | STimecmp Enable When set, When
When
| |||||||
PBMTE | 62 | Page Based Memory Type Enable The PBMTE bit controls whether the When PBMTE=1, Svpbmt is available for VS-stage address translation. When PBMTE=0, the implementation behaves as though If
If the setting of the PBMTE bit in By contrast, if the PBMTE bit in Note No mechanism is provided to atomically change | |||||||
ADUE | 61 | If the When ADUE=1, hardware updating of PTE A/D bits is enabled during VS-stage address translation, and the implementation behaves as though the Svade extension were not implemented for VS-mode address translation. When ADUE=0, the implementation behaves as though Svade were implemented for VS-stage address translation. If Svadu is not implemented, ADUE is read-only zero. Furthermore, for implementations with the hypervisor extension, henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero. | |||||||
CBZE | 7 | RW | Cache Block Zero instruction Enable Enables the execution of the cache block zero instruction, When S is implemented: in S-mode Otherwise, when U is implemented: in U-mode .
| ||||||
CBCFE | 6 | RW | Cache Block Clean and Flush instruction Enable Enables the execution of the cache block clean instruction, When S is implemented: in S-mode Otherwise, when U is implemented: in U-mode .
| ||||||
CBIE | 5-4 | RW-R | Cache Block Invalidate instruction Enable Enables the execution of the cache block invalidate instruction, When S is implemented: in S-mode Otherwise, when U is implemented: in U-mode .
| ||||||
SSE | 3 | RW | Shadow Stack Enable If the SSE field is set to 1, the Zicfiss extension is activated in VS-mode. When the SSE field is 0, the Zicfiss extension remains inactive in VS-mode, and the following rules apply when V=1 :
| ||||||
LPE | 2 | RW | Landing Pad Enable When the LPE field is set to 1, the Zicfilp extension is enabled in VS-mode. When the LPE field is 0, the Zicfilp extension is not enabled in VS-mode and the following rules apply to VS-mode:
| ||||||
FIOM | 0 | RW | Fence of I/O implies Memory When
Similarly, for modes less privileged than M when FIOM=1, if an atomic instruction that accesses a region ordered as device I/O has its aq and/or rl bit set, then that instruction is ordered as though it accesses both device I/O and memory. |
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/H/henvcfg.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)