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

cheri-cap-lib fast representability check differs from that in Sail #20

Open
PeterRugg opened this issue May 21, 2021 · 1 comment
Open

Comments

@PeterRugg
Copy link
Collaborator

As reported by Dapeng Gao:

The ‘CSetOffset’ instruction in Flute performs some optimisations (https://github.com/CTSRD-CHERI/cheri-cap-lib/blob/5c4171d3d0164d1d59ae3d6fa06ccaa4154522b8/CHERICC_Fat.bsv#L608) when computing permitted offsets, and these optimisations are not present in the Sail spec.

@PeterRugg
Copy link
Collaborator Author

Again, as reported by Dapeng:

Although the ‘CIncOffset’ and ‘CIncOffsetImm’ instructions do exactly this check, the ‘CSetOffset’ function does something slightly different. The relevant code is around here (https://github.com/CTSRD-CHERI/cheri-cap-lib/blob/5c4171d3d0164d1d59ae3d6fa06ccaa4154522b8/CHERICC_Fat.bsv#L634), where the bound comparisons are different depending on whether you are incrementing or setting the offset. This causes ‘CSetOffset’ to deviate from the spec, albeit in a ‘good’ way that allows more legal capabilities to remain tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant