Skip to content

Commit 3158daa

Browse files
tie hardware enabling to Svade/Svadu
1 parent 51bbc9e commit 3158daa

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/cheri-pte-ext.adoc

+11-5
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ If the CW bit is clear then:
100100
* When CRG is clear, the "no capability state", a store page fault exception
101101
is raised when a capability store or AMO instruction is executed and the tag bit
102102
of the capability being written is set.
103-
* When CRG is set, the "pre-CW state", two schemes are permitted:
103+
* When CRG is set, the "pre-CW state", two schemes are permitted (also see <<section_hardware_pte_updates>>):
104104

105105
** The same behavior as when CRG is clear, allowing software interpretation
106106
of this state.
@@ -160,10 +160,16 @@ bit value of the capability read. This will introduce additional traps during re
160160
It is legal for the implementation to fault even if the tag is not set since this behaviour is only an optimization for software.
161161
This means it is also legal to only check the tag under certain conditions and conservatively fault otherwise.
162162

163-
^2^ The choice here follows the pattern of whether to implement the _Svade_ extension
164-
to take page-fault exceptions for A and D PTE bit state changes, or whether to implement
165-
a hardware updating mechanism. Software should implement support for a page fault in these cases
166-
which will not be used if the hardware mechanism is implemented.
163+
^2^ See <<section_hardware_pte_updates>>.
164+
165+
[#section_hardware_pte_updates]
166+
=== Enabling Software or Hardware PTE updates
167+
168+
The decision about whether to take exceptions on capability stores with the tag set to a page with PTE.CW=0 and PTE.CRG=1 is determined by whether the _Svade_ and _Svadu_ extensions are enabled.
169+
These cause PTE Accessed and Dirty updates to be done in software, via the exception handler, or by a hardware mechanism respectively.
170+
171+
* If only _Svade_ is implemented, or enabled through henvcfg.ADUE or menvcfg.ADUE, then take a page fault.
172+
* If only _Svadu_ is implemented, or enabled through henvcfg.ADUE or menvcfg.ADUE, then do the hardware update of setting PTE.CW=1 and setting PTE.CRG=<<sstatusreg_pte,sstatus>>.CRG as described in <<section_extending_pte>>.
167173

168174
[#xstatus_pte]
169175
=== Extending the Supervisor (sstatus) and Virtual Supervisor (vsstatus) Status Registers

0 commit comments

Comments
 (0)