Upper 32 bits of Hypervisor State Enable 0 Register
For RV64 harts, the Smstateen/Ssstateen extension adds four new 64-bit CSRs at machine level: `mstateen0` (Machine State Enable 0), `mstateen1`, `mstateen2`, and `mstateen3`. If supervisor mode is implemented, another four CSRs are defined at supervisor level: `sstateen0`, `sstateen1`, `sstateen2`, and `sstateen3`. And if the hypervisor extension is implemented, another set of CSRs is added: `hstateen0`, `hstateen1`, `hstateen2`, and `hstateen3`.
For RV32, the registers listed above are 32-bit, and for the machine-level and hypervisor CSRs there is a corresponding set of high-half CSRs for the upper 32 bits of each register: `mstateen0h`, `mstateen1h`, `mstateen2h`, `mstateen3h`, `hstateen0h`, `hstateen1h`, `hstateen2h`, and `hstateen3h`.
| 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SE0 | ENVCFG | — | CSRIND | AIA | IMSIC | CONTEXT | — | CTR | — | ||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| [31] | SE0 | hstateen0.SE0 | The SE0 bit in `hstateen0h` controls access to the `sstateen0` CSR. | RW | UNDEFINED_LEGAL |
| [30] | ENVCFG | hstateen0.ENVCFG | The ENVCFG bit in `hstateen0h` controls access to the `senvcfg` CSRs. | RW | UNDEFINED_LEGAL |
| [28] | CSRIND | hstateen0.CSRIND | The CSRIND bit in `hstateen0h` controls access to the `siselect` and the `sireg*`, (really `vsiselect` and `vsireg*`) CSRs provided by the Sscsrind extensions. | RW | UNDEFINED_LEGAL |
| [27] | AIA | hstateen0.AIA | The AIA bit in `hstateen0h` controls access to all state introduced by the Ssaia extension and is not controlled by either the CSRIND or the IMSIC bits of `hstateen0`. | RW | UNDEFINED_LEGAL |
| [26] | IMSIC | hstateen0.IMSIC | The IMSIC bit in `hstateen0h` controls access to the guest IMSIC state, including CSRs `stopei` (really `vstopei`), provided by the Ssaia extension. Setting the IMSIC bit in `hstateen0h` to zero prevents a virtual machine from accessing the hart’s IMSIC the same as setting `hstatus.`VGEIN = 0. | RW | UNDEFINED_LEGAL |
| [25] | CONTEXT | hstateen0.CONTEXT | The CONTEXT bit in `hstateen0h` controls access to the `scontext` CSR provided by the Sdtrig extension. | RW | UNDEFINED_LEGAL |
| [22] | CTR | hstateen0.CTR | If the H extension is implemented and `mstateen0.CTR=1`, the `hstateen0.CTR` bit controls access to supervisor CTR state when V=1. This state includes `sctrctl` (really `vsctrctl`), `sctrstatus`, and `sireg*` (really `vsireg*`) when `siselect` (really `vsiselect`) is in 0x200..0x2FF. `hstateen0.CTR` is read-only 0 when `mstateen0.CTR=0`. | RW | 0 |
return CSR[hstateen0].sw_read()[63:32];
Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.