You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/insns/store_exceptions.adoc
+5
Original file line number
Diff line number
Diff line change
@@ -22,5 +22,10 @@ listed below; in this case, _CHERI data fault_ is reported in the <<mtval2>> or
22
22
| Bounds violation | At least one byte accessed is outside the authority capability bounds, or the capability has <<section_cap_malformed,malformed>> bounds
| .>|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
733
733
| .>|5,7 .<|With physical address for an explicit memory access: +
734
734
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^
737
738
|===
738
739
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 simultaneously, then both are recorded as shown in <<mtval2-page-fault>>.
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].
740
747
741
748
[#medeleg,reftext="medeleg"]
742
749
==== Machine Trap Delegation Register (medeleg)
@@ -830,13 +837,24 @@ CHERI violations have the following order in priority:
830
837
. Invalid address violation
831
838
. Bounds violation (_Lowest_)
832
839
833
-
===== mtval2 values for Load Page Faults
840
+
===== mtval2 values for Load/Store/AMO Page Faults
834
841
835
-
If a load page fault is caused by a CHERI <<cheri_pte_ext,PTE>> fault, then set bit zero of <<mtval2>> to 1 and all other bits to 0, otherwise set all bits to zero.
842
+
Page faults can be caused by normal RISC-V page faults and also by CHERI <<cheri_pte_ext,PTE>> faults.
843
+
If both are detected at once, then both are recorded.
If a store page fault is caused by a CHERI <<cheri_pte_ext,PTE>> fault, then set bit zero of <<mtval2>> to 1 and all other bits to 0, otherwise set all bits to zero.
854
+
NOTE: Reporting both allows the software the choice about which action to take first, for example a write to a
855
+
page with no write permission, _and_ the incorrect value of PTE.CRG requires two actions.
856
+
Software can then decide whether to prioritize the copy-on-write procedure to fix the lack of write
857
+
permission, or to sweep the page.
840
858
841
859
[#supervisor-level-csrs-section]
842
860
=== Supervisor-Level CSRs
@@ -1051,7 +1069,7 @@ address is 0x14b.
1051
1069
which are delegated to S-mode.
1052
1070
1053
1071
The fields are identical to <<mtval2>> for CHERI exceptions, and for load and
1054
-
store page fault exceptions if {cheri_pte_ext_name} is implemented.
1072
+
store/AMO page fault exceptions if {cheri_pte_ext_name} is implemented.
1055
1073
1056
1074
NOTE: <<stval2>> is not a standard RISC-V CSR, but <<mtval2>> is.
0 commit comments