Skip to content

Commit b5efdb6

Browse files
clarify exception priorities
1 parent d724167 commit b5efdb6

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/cheri-pte-ext.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ and the capability read from memory optionally has its tag set^1^.
164164
It is legal for the implementation to fault even if the tag is not set since this behavior is only an optimization for software.
165165
This means it is also legal to only check the tag under certain conditions and conservatively fault otherwise.
166166
Taking a trap when the tag is not set will introduce additional traps during revocation sweeps.
167+
Checking the loaded tag affects the exception priority, see <<exception-priority>>.
167168

168169
^2^ See <<section_hardware_pte_updates>>.
169170

src/riscv-integration.adoc

+12-5
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ _Reserved_
698698

699699
[[exception-priority]]
700700
.Synchronous exception priority in decreasing priority order. Entries added in {cheri_base_ext_name} are in *bold*
701-
[%autowidth,float="center",align="center",cols="<,>,<",options="header"]
701+
[float="center",align="center",cols="<1,>1,<8",options="header"]
702702
|===
703703
|Priority |Exc.Code |Description
704704
|_Highest_ |3 |Instruction address breakpoint
@@ -729,14 +729,21 @@ Load/store/AMO address breakpoint
729729
Optionally: +
730730
Load/store/AMO address misaligned
731731
| .>|13, 15, 5, 7 .<|During address translation for an explicit memory access: +
732-
First encountered page fault or access fault
732+
First encountered *CHERI PTE page fault*^12^, page fault or access fault
733733
| .>|5,7 .<|With physical address for an explicit memory access: +
734734
Load/store/AMO access fault
735-
.>|_Lowest_ .>|4,6 .<|If not higher priority: +
736-
Load/store/AMO address misaligned
735+
| .>|4,6 .<|If not higher priority: +
736+
.>|_Lowest_ .>|13 .<|If not higher priority: +
737+
CHERI load PTE fault^3^
737738
|===
738739

739-
NOTE: The full details of the CHERI exceptions are in xref:cheri_exception_combs_descriptions[xrefstyle=short].
740+
^1^ The higher priority CHERI <<cheri_pte_ext,PTE>> page fault covers capability loads or atomics where the loaded tag _is not_ checked, and all capability stores and atomics where the stored tag is set.
741+
742+
^2^ CHERI <<cheri_pte_ext,PTE>> page fault exceptions have the same priority against access faults as normal RISC-V page faults. If a normal RISC-V page fault _and_ a CHERI <<cheri_pte_ext,PTE>> fault are both detected, then the CHERI fault takes priority.
743+
744+
^3^ The lower priority <<cheri_pte_ext,PTE>> fault only covers capability loads and atomics where the loaded tag _is_ checked.
745+
746+
NOTE: The full details of the CHERI exceptions with cause value {cheri_excep_mcause} are in xref:cheri_exception_combs_descriptions[xrefstyle=short].
740747

741748
[#medeleg,reftext="medeleg"]
742749
==== Machine Trap Delegation Register (medeleg)

src/trigger-integration.adoc

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ shown in xref:trigger-exception-priority[xrefstyle=short].
77

88
[[trigger-exception-priority]]
99
.Synchronous exception priority (including triggers) in decreasing priority order. Entries added in {cheri_base_ext_name} are in *bold*
10-
[%autowidth,float="center",align="center",cols="<,>,<,<",options="header"]
10+
[float="center",align="center",cols="<1,>1,<4,<2",options="header"]
1111
|===
1212
|Priority |Exc. Code |Description |Trigger
1313
|_Highest_ |3 +
@@ -22,7 +22,7 @@ mcontrol/mcontrol6 after (on previous instruction)
2222
| .>|*{cheri_excep_mcause}* .<|*Prior to instruction address translation:* +
2323
*CHERI fault due to PCC checks (tag, execute permission, invalid address and bounds)* |
2424
| .>|12, 1 .<|During instruction address translation: +
25-
First encountered page fault or access fault |
25+
First encountered *CHERI PTE page fault*, page fault or access fault |
2626
| .>|1 .<|With physical address for instruction: +
2727
Instruction access fault |
2828

@@ -49,10 +49,14 @@ Environment break |
4949
| .>|4,6 .<|Optionally: +
5050
Load/store/AMO address misaligned |
5151
| .>|13, 15, 5, 7 .<|During address translation for an explicit memory access: +
52-
First encountered page fault or access fault |
52+
First encountered *CHERI <<cheri_pte_ext,PTE>> page fault*, page fault or access fault |
5353
| .>|5,7 .<|With physical address for an explicit memory access: +
5454
Load/store/AMO access fault |
5555
| .>|4,6 .<|If not higher priority: +
5656
Load/store/AMO address misaligned |
57+
| .>|13 .<|If not higher priority: +
58+
CHERI load <<cheri_pte_ext,PTE>> fault
5759
|_Lowest_ .>|3 .<| |mcontrol/mcontrol6 load data before
5860
|===
61+
62+
NOTE: See the notes beneath <<exception-priority>> for details about CHERI <<cheri_pte_ext,PTE>> page fault priority.

0 commit comments

Comments
 (0)