Webcentive RISC-V Reference

henvcfgh

Upper 32 bits of henvcfg, RV32 only

Address
0x61A
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
XLEN
RV32 only
Name in riscv-unified-db
most-significant 32 bits of Hypervisor Environment Configuration

Privileged spec: Upper 32 bits of henvcfg, RV32 only

Description

The henvcfgh CSR is a 32-bit read/write register for the most-significant 32 bits of henvcfg.

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
STCE31

STimecmp Enable

When set, stimecmp is operational in VS-mode if menvcfg.STCE is also set.

When menvcfg.STCE is zero:

  • henvcfg.STCE reads-as-zero
  • vstimecmp access raises an IllegalInstruction exception.
  • hip.VSTIP reverts to its defined behavior as if Sstc is not implemented.
  • VS-mode timer interrupts will not be generated

When menvcfg.STCE is one and henvcfg.STCE is zero:

  • Accessing stimecmp in VS-mode or VU-mode (really vstimecmp) raises a VirtualInterrupt exception
  • hip.VSTIP reverts to its defined behavior as if Sstc is not implemented.
  • VS-mode timer interrupts will not be generated
PBMTE30

Page Based Memory Type Enable

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.

henvcfg.PBMTE is read-as-zero if menvcfg.PBMTE is zero.

If the setting of the PBMTE bit in menvcfg is changed, an hfence.gvma instruction with rs1=x0 and rs2=x0 suffices to synchronize with respect to the altered interpretation of G-stage and VS-stage PTEs' PBMT fields.

By contrast, if the PBMTE bit in henvcfg is changed, executing an hfence.vvma with rs1=x0 and rs2=x0 suffices to synchronize with respect to the altered interpretation of VS-stage PTEs' PBMT fields for the currently active VMID.

Note

No mechanism is provided to atomically change vsatp and hgatp together. Hence, to prevent speculative execution causing one guest's VS-stage translations to be cached under another guest's VMID, world-switch code should zero vsatp, then swap hgatp, then finally write the new vsatp value. Similarly, if henvcfg.PBMTE need be world-switched, it should be switched after zeroing vsatp but before writing the new vsatp value, obviating the need to execute an hfence.vvma instruction.

ADUE29

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.

Furthermore, for implementations with the hypervisor extension, henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero.

Fields from riscv-unified-db; field types computed by IDL functions there are not shown.

Specification and related pages