This repository was archived by the owner on May 16, 2025. It is now read-only.
Fully apply implicit acperm, including tag clear - #9
Open
tomaird wants to merge 1 commit into
Open
Conversation
arichardson
reviewed
Apr 16, 2025
| let restrictCL = loaded_cap.tag & not(canEL(auth_cap)); | ||
| if restrictCL then {loaded_cap with cl = auth_cap.cl & loaded_cap.cl} else loaded_cap | ||
| if restrictCL | clearWLM | clearEL then { | ||
| clearTagAcperm(loaded_cap) |
Contributor
There was a problem hiding this comment.
This seems wrong, we should not zero the tag on sealed if all we did was restrict CL.
Author
There was a problem hiding this comment.
The spec says that restricting CL is done with an implicit ACPERM, even if you don't do clear EL too.
"implicit ACPERM" means do the whole instruction, as discussed in the linked ticket.
Contributor
There was a problem hiding this comment.
Yeah my view is that this is incorrect and should be fixed in the spec.
Collaborator
There was a problem hiding this comment.
@arichardson do you know if this was fixed in the spec?
Collaborator
There was a problem hiding this comment.
I'm archiving this repo but we can continue the discussion here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implicit ACPERMs, done for permission-clearing on loads, should apply the full instruction semantics, including clearing the tag for certain cases.
Raised from this issue: riscv/riscv-cheri#577
While the spec may change on this, the issue clarified the intention was always that the full ACPERM semantics should be applied, so the model was always wrong on this.