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

Canonical tag clearing pseudo #94

Closed
arichardson opened this issue Feb 6, 2024 · 4 comments · Fixed by #103
Closed

Canonical tag clearing pseudo #94

arichardson opened this issue Feb 6, 2024 · 4 comments · Fixed by #103
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@arichardson
Copy link
Collaborator

ISAv9 had a dedicated CClearTag instruction that writes back the input register without a tag. This is not hugely common. One place I've seen it is in the CheriBSD kernel does for a tag-stripping memcpy since it predates tag-clearing semantics for loads without permit_load_cap.

With #82 we could treat cbuildcap cd, c0, cs2 as the canonical ccleartag cd, cs1 (previously I believe the best we could do was the two-instruction cgethigh cd, cs1; csethigh cd, cs1, cd;.

  1. Should we add a note to buildcap that it might be a good idea for a high-performance CHERI core to special-case cbuildcap cd, c0, cs2 in the decoder to be a tag-clearing move?

  2. Should there be an assembly pseudo for ccleartag that maps to cbuildcap cd, c0, cs2?

@arichardson arichardson added enhancement New feature or request question Further information is requested labels Feb 6, 2024
@andresag01
Copy link
Collaborator

I like the idea of making cbuildcap cd, c0, cs2 an assembly pseudo for ccleartag. The function is already there and this encoding is probably never going to get used as a hint or something like that.

I am less keen about the informative note because this ccleartag is hardly ever used, so I doubt optimising that special cbuildcap case as a move will make any difference for performance.

@andresag01 andresag01 added documentation Improvements or additions to documentation and removed question Further information is requested labels Feb 7, 2024
@andresag01
Copy link
Collaborator

@francislaus pointed out that cbuildcap cd, c0, cs2 does not behave like ccleartag when otypes are implemented. Given that otypes might be an extension in future, it would be best to add a note to the spec reserving cbuildcap cd, c0, cs2 instead of declaring it a ccleartag pseudo.

@tariqkurd-repo
Copy link
Collaborator

I've marked this as a bug as this is a spec change.

@andresag01
Copy link
Collaborator

Closed via #103

andresag01 pushed a commit that referenced this issue Feb 12, 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 documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants