Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifications to PTE specification #469

Merged
merged 7 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/cheri-pte-ext.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ The page table entry format remains unchanged for Sv32. However, two new
bits, Capability Write (CW) and Capability Read
Generation (CRG), are added to leaf PTEs in Sv39, Sv48 and Sv57 as shown in
xref:sv39pte[xrefstyle=short], xref:sv48pte[xrefstyle=short] and
xref:sv57pte[xrefstyle=short] respectively.
xref:sv57pte[xrefstyle=short] respectively. For non-leaf PTEs these bits
remain reserved and must be cleared by software for forward compatibility,
or else a page-fault exception is raised.

.Sv39 page table entry
[#sv39pte]
Expand Down Expand Up @@ -102,11 +104,15 @@ If the CW bit is clear then:
of the capability being written is set.
* When CRG is set, the "pre-CW state", two schemes are permitted (also see <<section_hardware_pte_updates>>):

NOTE: The tag bit of the stored capability is checked _after_ it is potentially
cleared <<tags_cleared_by_permissions,due to lack of permissions>>.

** The same behavior as when CRG is clear, allowing software interpretation
of this state.
** When a capability store or AMO instruction is executed
and the tag bit of the capability being written is set, the
implementation sets the CW bit and assigns the CRG bit equal to <<sstatusreg_pte,sstatus>>.CRG.
+
The PTE update must be
atomic with respect to other accesses to the PTE, and must atomically check
that the PTE is valid and grants sufficient permissions. Updates to the CW bit
Expand All @@ -129,9 +135,9 @@ regards to the ongoing capability revocation cycle. Two schemes are permitted:

* A load page fault exception is raised when a capability load or AMO instruction is executed
and the virtual page's CRG bit does not equal <<sstatusreg_pte,sstatus>>.CRG.
* A load page fault exception is raised when a capability load or AMO instruction is executed,
the capability read from memory has tag set
and the virtual page's CRG bit does not equal <<sstatusreg_pte,sstatus>>.CRG.
* A load page fault exception is raised when a capability load or AMO instruction is executed
and the virtual page's CRG bit does not equal <<sstatusreg_pte,sstatus>>.CRG
and the capability read from memory has its tag set.
tariqkurd-repo marked this conversation as resolved.
Show resolved Hide resolved

NOTE: An implementation may avoid a dependency on the tag
bit value of the capability read. This will introduce additional traps during revocation sweeps.
Expand Down
1 change: 1 addition & 0 deletions src/riscv-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ misaligned address fault exceptions when the effective address to access is
misaligned, even if the implementation supports Zicclsm. To transfer CLEN
misaligned bits without a tag, use integer loads and stores.

[#tags_cleared_by_permissions]
For loads, the tag of the capability loaded from memory is cleared if the
authorising capability does not grant permission to read capabilities (i.e.
both <<r_perm>> and <<c_perm>> must be set in AP). For stores, the tag of the
Expand Down
Loading