ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,761 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

hedeleg

T1 riscv register register
Hypervisor Exception Delegation
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (H)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeS
ExtensionsH

Summary

Controls exception delegation from HS-mode to VS-mode.

Syntax / Encoding

CSR 0x602 (S-mode, RW)

Bitfields (22)

BitsFieldDescription
23SGPF*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.
22VI*Virtual Instruction* Virtual Instruction exceptions _cannot be delegated to VS-mode_, so this field is read-only 0. See medeleg.VI for details.
21LGPF*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.
20IGPF*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.
19HWE*Hardware Error* Controls delegation of Hardware Error exceptions to VS-mode.
18SWC*Software Check* Controls delegation of Software Check exceptions to VS-mode.
16DT*Double Trap* Double Trap exceptions _cannot be delegated to VS-mode_, so this field is read-only 0.
15SPF*Store/AMO Page Fault* Controls delegation of Store/AMO Page Fault exceptions to VS-mode. See medeleg.SPF for details.
13LPF*Load Page Fault* Controls delegation of Load Page Fault exceptions to VS-mode. See medeleg.LPF for details.
12IPF*Instruction Page Fault* Controls delegation of Instruction Page Fault exceptions to VS-mode. See medeleg.IPF for details.
11EM*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.
10EVS*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.
9ES*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.
8EU*Environment Call from VU-mode* Controls delegation of Environment Call from VU-mode exceptions to VS-mode. See medeleg.EU for details.
7SAF*Store/AMO Access Fault* Controls delegation of Store/AMO Access Fault exceptions to VS-mode. See medeleg.SAF for details.
6SAM*Store/AMO Address Misaligned* Controls delegation of Store/AMO Address Misaligned exceptions to VS-mode. See medeleg.SAM for details.
5LAF*Load Access Fault* Controls delegation of Load Access Fault exceptions to VS-mode. See medeleg.LAF for details.
4LAM*Load Address Misaligned* Controls delegation of Load Address Misaligned exceptions to VS-mode. See medeleg.LAM for details.
3B*Breakpoint* Controls delegation of Breakpoint exceptions to VS-mode. See medeleg.B for details.
2II*Illegal Instruction* Controls delegation of Illegal Instruction exceptions to VS-mode. See medeleg.II for details.
1IAF*Instruction Access Fault* Controls delegation of Instruction Access Fault exceptions to VS-mode. See medeleg.IAF for details.
0IAM*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.

Reference Notes

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.