hideleg
Hypervisor Interrupt Delegation Register
Register hideleg is an HSXLEN-bit read/write register. 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. An interrupt that has been delegated to HS-mode (using mideleg) is further delegated to VS-mode if the corresponding hideleg bit is set. Among bits 15:0 of hideleg, bits 10, 6, and 2 (corresponding to the standard VS-level interrupts) are writable, and bits 12, 9, 5, and 1 (corresponding to the standard S-level interrupts) are read-only zeros.
Attributes
Requirement |
|||
|---|---|---|---|
Defining extensions |
|
||
CSR Address |
0x603 |
||
Length |
* 32 when CSR[mstatus].SXL == 0 * 64 when CSR[mstatus].SXL == 1 |
||
Privilege Mode |
S |
Format
This CSR format changes dynamically.
Field Summary
| Name | Location | Type | Reset Value |
|---|---|---|---|
1 |
RO |
0 |
|
2 |
RW |
UNDEFINED_LEGAL |
|
5 |
RO |
0 |
|
6 |
RW |
UNDEFINED_LEGAL |
|
9 |
RO |
0 |
|
10 |
RW |
UNDEFINED_LEGAL |
|
12 |
RO |
0 |
|
13 |
RW |
UNDEFINED_LEGAL |
Fields
Software write
This CSR may store a value that is different from what software attempts to write.
When a software write occurs (e.g., through csrrw), the following determines the written value:
SSI = csr_value.SSI
VSSI = if (CSR[mideleg].VSSI == 0) {
return 0;
}
if (csr_value.VSSI == 0) {
CSR[vsip].SSIP = 0;
CSR[vsie].SSIE = 0;
}
return csr_value.VSSI;
STI = csr_value.STI
VSTI = if (CSR[mideleg].VSTI == 0) {
return 0;
}
if (csr_value.VSTI == 0) {
CSR[vsip].STIP = 0;
CSR[vsie].STIE = 0;
}
return csr_value.VSTI;
SEI = csr_value.SEI
VSEI = if (CSR[mideleg].VSEI == 0) {
return 0;
}
if (csr_value.VSEI == 0) {
CSR[vsip].SEIP = 0;
CSR[vsie].SEIE = 0;
}
return csr_value.VSEI;
SGEI = csr_value.SGEI
LCOFI = if (CSR[mideleg].LCOFI == 0) {
return 0;
}
if (csr_value.LCOFI == 0) {
CSR[vsip].LCOFIP = 0;
CSR[vsie].LCOFIE = 0;
}
return csr_value.LCOFI;