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

Define behaviour for reserved RV32 permission encoding #47

Closed
Timmmm opened this issue Jan 25, 2024 · 4 comments · Fixed by #53
Closed

Define behaviour for reserved RV32 permission encoding #47

Timmmm opened this issue Jan 25, 2024 · 4 comments · Fixed by #53
Labels
bug Something isn't working

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Jan 25, 2024

The spec says

Valid capabilities must not have the permissions field set to a reserved value according to Table 3 when XLENMAX=32.

I believe this can't ever happen for tagged capabilities but CGetPerm works for non-tagged capabilities. What should it return for this? Same question for CAndPerm.

@andresag01
Copy link
Collaborator

Thanks for pointing this out. I agree that there is a gap in the spec regarding CGetPerm. However, CAndPerm does describe what happens in this case:

The AP field is not able to encode all combinations of permissions when XLENMAX=32. If
permissions that cannot be encoded are indicated, CANDPERM outputs a capability with
all architectural permissions cleared.

@PeterRugg had some comments about this behaviour, so there is a TODO note on it and should be picked up for discussion.

@PeterRugg
Copy link
Contributor

Hmm, that's a good question, and links into how we define the reserved permission bits in a way that maximises compatibility in all cases. I imagine the interpretation of all the encoded permission bits could potentially change when the reserved bits are set by future or non-standard extensions, i.e. effectively interpreting some of them as format bits. That means software shouldn't rely on the interpretation of the existing bits if the reserved bits are set. It still needs to be defined, though, so maybe all zero?

@andresag01 andresag01 added the bug Something isn't working label Jan 25, 2024
@tariqkurd-repo
Copy link
Collaborator

I'm happy with all zeroes - as that doesn't exclude using the reserved value for a purpose other than representing permissions.

@Timmmm
Copy link
Contributor Author

Timmmm commented Jan 25, 2024

Ok that makes sense; I'll make a PR.

Timmmm added a commit to Timmmm/riscv-cheri that referenced this issue Jan 25, 2024
Timmmm added a commit to Timmmm/riscv-cheri that referenced this issue Jan 25, 2024
Timmmm added a commit to Timmmm/riscv-cheri that referenced this issue Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants