Hypervisor Exception Delegation
Controls exception delegation from HS-mode to VS-mode.
By default, all traps at any privilege level are handled in M-mode, though M-mode usually uses the `medeleg` and `mideleg` CSRs to delegate some traps to HS-mode. The `hedeleg` and `hideleg` CSRs allow these traps to be further delegated to a VS-mode guest; their layout is the same as `medeleg` and `mideleg`.
A synchronous trap that has been delegated to HS-mode (using `medeleg`) is further delegated to VS-mode if V=1 before the trap and the corresponding `hedeleg` bit is set. Each bit of `hedeleg` shall be either writable or read-only zero. Many bits of `hedeleg` are required specifically to be writable or zero. Bit 0, corresponding to instruction address misaligned exceptions, must be writable if IALIGN=32.
Note: Requiring that certain bits of `hedeleg` be writable reduces some of the burden on a hypervisor to handle variations of implementation.
When XLEN=32, `hedelegh` is a 32-bit read/write register that aliases bits 63:32 of `hedeleg`. Register `hedelegh` does not exist when XLEN=64.
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| — | SGPF | VI | LGPF | IGPF | HWE | SWC | — | DT | SPF | — | LPF | IPF | EM | EVS | ES | EU | SAF | SAM | LAF | LAM | B | II | IAF | IAM | |||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| [0] | IAM | *Instruction Address Misaligned* Controls delegation of Instruction Address Misaligned exceptions to VS-mode. See `medeleg.IAM` for details. This field must be writable if IALIGN=32. | if (implemented?(ExtensionName::Zca)) {
if (implemented?(ExtensionName::C) && MUTABLE_MISA_C && CSR[misa].C == 1'b0) {
return CsrFieldType::RW;
}
return HEDELEG_IAM_WRITABLE ? CsrFieldType::RW : CsrFieldType::RO;
}
return CsrFieldType::RW; | if (implemented?(ExtensionName::Zca)) {
if (implemented?(ExtensionName::C) && MUTABLE_MISA_C && CSR[misa].C == 1'b0) {
return UNDEFINED_LEGAL;
}
return HEDELEG_IAM_WRITABLE ? UNDEFINED_LEGAL : 0;
}
return UNDEFINED_LEGAL; | |
| [1] | IAF | *Instruction Access Fault* Controls delegation of Instruction Access Fault exceptions to VS-mode. See `medeleg.IAF` for details. | RW | UNDEFINED_LEGAL | |
| [2] | II | *Illegal Instruction* Controls delegation of Illegal Instruction exceptions to VS-mode. See `medeleg.II` for details. | RW | UNDEFINED_LEGAL | |
| [3] | B | *Breakpoint* Controls delegation of Breakpoint exceptions to VS-mode. See `medeleg.B` for details. | RW | UNDEFINED_LEGAL | |
| [4] | LAM | *Load Address Misaligned* Controls delegation of Load Address Misaligned exceptions to VS-mode. See `medeleg.LAM` for details. | RW | UNDEFINED_LEGAL | |
| [5] | LAF | *Load Access Fault* Controls delegation of Load Access Fault exceptions to VS-mode. See `medeleg.LAF` for details. | RW | UNDEFINED_LEGAL | |
| [6] | SAM | *Store/AMO Address Misaligned* Controls delegation of Store/AMO Address Misaligned exceptions to VS-mode. See `medeleg.SAM` for details. | RW | UNDEFINED_LEGAL | |
| [7] | SAF | *Store/AMO Access Fault* Controls delegation of Store/AMO Access Fault exceptions to VS-mode. See `medeleg.SAF` for details. | RW | UNDEFINED_LEGAL | |
| [8] | EU | *Environment Call from VU-mode* Controls delegation of Environment Call from VU-mode exceptions to VS-mode. See `medeleg.EU` for details. | RW | UNDEFINED_LEGAL | |
| [9] | ES | *Environment Call from HS-mode* Environment Call from HS-mode exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.ES` for details. | RO | 0 | |
| [10] | EVS | *Environment Call from VS-mode* Environment Call from VS-mode exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.EVS` for details. | RO | 0 | |
| [11] | EM | *Environment Call from M-mode* Environment Call from M-mode exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.EM` for details. | RO | 0 | |
| [12] | IPF | *Instruction Page Fault* Controls delegation of Instruction Page Fault exceptions to VS-mode. See `medeleg.IPF` for details. | RW | UNDEFINED_LEGAL | |
| [13] | LPF | *Load Page Fault* Controls delegation of Load Page Fault exceptions to VS-mode. See `medeleg.LPF` for details. | RW | UNDEFINED_LEGAL | |
| [15] | SPF | *Store/AMO Page Fault* Controls delegation of Store/AMO Page Fault exceptions to VS-mode. See `medeleg.SPF` for details. | RW | UNDEFINED_LEGAL | |
| [16] | DT | *Double Trap* Double Trap exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. | RO | 0 | |
| [18] | SWC | *Software Check* Controls delegation of Software Check exceptions to VS-mode. | RW | UNDEFINED_LEGAL | |
| [19] | HWE | *Hardware Error* Controls delegation of Hardware Error exceptions to VS-mode. | RW | UNDEFINED_LEGAL | |
| [20] | IGPF | *Instruction Guest Page Fault* Instruction Guest Page Fault exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.IGPF` for details. | RO | 0 | |
| [21] | LGPF | *Load Guest Page Fault* Load Guest Page Fault exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.LGPF` for details. | RO | 0 | |
| [22] | VI | *Virtual Instruction* Virtual Instruction exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.VI` for details. | RO | 0 | |
| [23] | SGPF | *Store/AMO Guest Page Fault* Store/AMO Guest Page Fault exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See `medeleg.SGPF` for details. | RO | 0 |
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.