medeleg
Machine Exception Delegation
Controls exception delegation from M-mode to (H)S-mode or, in conjunction with hedeleg, to VS-mode .
An exception cause is delegated to (H)S-mode when all of the following hold:
An exception cause is delegated to VS-mode when all of the following hold:
Otherwise, an exception cause is handled by M-mode.
See interrupt documentation for more details.
Field Summary
Name | Location | Type | Reset Value |
---|---|---|---|
0 |
RW |
UNDEFINED_LEGAL |
|
1 |
RW |
UNDEFINED_LEGAL |
|
2 |
RW |
UNDEFINED_LEGAL |
|
3 |
RW |
UNDEFINED_LEGAL |
|
4 |
RW |
UNDEFINED_LEGAL |
|
5 |
RW |
UNDEFINED_LEGAL |
|
6 |
RW |
UNDEFINED_LEGAL |
|
7 |
RW |
UNDEFINED_LEGAL |
|
8 |
RW |
UNDEFINED_LEGAL |
|
9 |
RW |
UNDEFINED_LEGAL |
|
10 |
RW |
UNDEFINED_LEGAL |
|
11 |
RO |
0 |
|
12 |
RW |
UNDEFINED_LEGAL |
|
13 |
RW |
UNDEFINED_LEGAL |
|
15 |
RW |
UNDEFINED_LEGAL |
|
20 |
RW |
UNDEFINED_LEGAL |
|
21 |
RW |
UNDEFINED_LEGAL |
|
22 |
RW |
UNDEFINED_LEGAL |
|
23 |
RW |
UNDEFINED_LEGAL |
Fields
IAM
- Location
-
medeleg[0]
- Description
-
Instruction Address Misaligned
Delegates Instruction Address Misaligned exceptions to (H)S-mode. Instruction Address Misaligned exceptions may be futher delegated to VS-mode if hedeleg.IAM is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
IAF
- Location
-
medeleg[1]
- Description
-
Instruction Access Fault
Delegates Instruction Access Fault exceptions to (H)S-mode. Instruction Access Fault exceptions may be futher delegated to VS-mode if hedeleg.IAM is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
II
- Location
-
medeleg[2]
- Description
-
Illegal Instruction
Delegates Illegal Instruction exceptions to (H)S-mode. Illegal Instruction exceptions may be futher delegated to VS-mode if hedeleg.II is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
B
- Location
-
medeleg[3]
- Description
-
Breakpoint
Delegates Breakpoint exceptions to (H)S-mode. Breakpoint exceptions may be futher delegated to VS-mode if hedeleg.B is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
LAM
- Location
-
medeleg[4]
- Description
-
Load Address Misaligned
Delegates Load Address Misaligned exceptions to (H)S-mode. Load Address Misaligned exceptions may be futher delegated to VS-mode if hedeleg.LAM is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
Note that because this implementation supports misaligned loads, this exception will never occur. However, the writeable bit should be presented anyway.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
LAF
- Location
-
medeleg[5]
- Description
-
Load Access Fault
Delegates Load Access Fault exceptions to (H)S-mode. Load Access Fault exceptions may be futher delegated to VS-mode if hedeleg.LAF is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
SAM
- Location
-
medeleg[6]
- Description
-
Store/AMO Address Misaligned
Delegates Store/AMO Address Misaligned exceptions to (H)S-mode. Store/AMO Address Misaligned exceptions may be futher delegated to VS-mode if hedeleg.SAM is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
Note that beause the implementation supports misaligned stores and misaligned AMOs (or no AMOs), this exception will never occur. Even so, the writeable bit should be presented anyway.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
SAF
- Location
-
medeleg[7]
- Description
-
Store/AMO Access Fault
Delegates Store/AMO Access Fault exceptions to (H)S-mode. Store/AMO Access Fault exceptions may be futher delegated to VS-mode if hedeleg.SAM is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
EU
- Location
-
medeleg[8]
- Description
-
Environment Call from U-Mode
Delegates Environment Call from U-mode exceptions to (H)S-mode. Enviornment Call from U-mode exceptions may be futher delegated to VS-mode if hedeleg.EU is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
ES
- Location
-
medeleg[9]
- Description
-
Environment Call from S-Mode
Delegates Environment Call from S-mode exceptions to (H)S-mode. Enviornment Call from S-mode exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
(H)S
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
EVS
- Location
-
medeleg[10]
- Description
-
Environment Call from VS-Mode
Delegates Environment Call from VS-mode exceptions to (H)S-mode. Enviornment Call from S-mode exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
(H)S
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
EM
- Location
-
medeleg[11]
- Description
-
Environment Call from M-Mode
An Environment Call from M-mode cannot be delegated, so this is a read-only field.
All Enviornment Call from M-mode exceptions are taken by M-mode.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
0
IPF
- Location
-
medeleg[12]
- Description
-
Instruction Page Fault
Delegates Instruction Page Fault exceptions to (H)S-mode. Instruction Page Fault exceptions may be futher delegated to VS-mode if hedeleg.IPF is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
LPF
- Location
-
medeleg[13]
- Description
-
Load Page Fault
Delegates Load Page Fault exceptions to (H)S-mode. Load Page Fault exceptions may be futher delegated to VS-mode if hedeleg.LPF is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
SPF
- Location
-
medeleg[15]
- Description
-
Store/AMO Page Fault
Delegates Store/AMO Page Fault exceptions to (H)S-mode. Store/AMO Page Fault exceptions may be futher delegated to VS-mode if hedeleg.SPF is also set.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
HS-mode
VS-mode
VU-mode
+0
0
M
M
M
M
0
1
M
M
M
M
1
0
M
HS
HS
HS
1
1
M
HS
VS
VS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
IGPF
- Location
-
medeleg[20]
- Description
-
Instruction Guest Page Fault
Delegates Instruction Guest Page Fault exceptions to (H)S-mode. Instruction Guest Page Fault exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
HS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
LGPF
- Location
-
medeleg[21]
- Description
-
Load Guest Page Fault
Delegates Load Guest Page Fault exceptions to (H)S-mode. Load Guest Page Fault exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
HS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
VI
- Location
-
medeleg[22]
- Description
-
Virtual Instruction
Delegates Virtual Instruction exceptions to (H)S-mode. Virtual Instruction exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
HS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
SGPF
- Location
-
medeleg[23]
- Description
-
Store/AMO Guest Page Fault
Delegates Store/AMO Guest Page Fault exceptions to (H)S-mode. Store/AMO Guest Page Fault exceptions cannot be delegated to VS-mode.
Exceptions are never taken into a less-privileged mode, regardless of medeleg.
The handling mode is determined as follows:
Current Mode
M-mode
(H)S-mode
+0
M
M
1
M
HS
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL