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

Change CSetBounds* behavior #121

Open
andresag01 opened this issue Oct 16, 2023 · 1 comment
Open

Change CSetBounds* behavior #121

andresag01 opened this issue Oct 16, 2023 · 1 comment

Comments

@andresag01
Copy link

CHERI-RISC-V currently has the following instructions to set a capability's bounds:

  1. CSetBounds
  2. CSetBoundsImm
  3. CSetBoundsExact

Currently (1) and (2) round down the base and round up the length while (3) does the same but clears the tag if rounding was required. Ideally, software is aware of the rounding and most commonly uses (3) instead of (2)/(1), so it would be ideal to change these instructions into:

  1. CSetBounds: the same operation as the old CSetBoundsExact
  2. CSetBoundsImm: the same operation as the old CSetBoundsExact but with an immediate operand
  3. CSetBoundsInexact: the same operation as the old CSetBounds

A further proposal is also to eliminate CSetBoundsInexact altogether because it could be emulated with the new CSetBounds followed by CBuildCap although it is not a very natural way of performing that operation.

@tariqkurd-repo
Copy link

tariqkurd-repo commented Nov 20, 2023

@jonwoodruff also suggested to make the implementation of CSetBounds[Imm] simpler as it no longer needs to round, so it can execute with a shorter latency than CSetBoundsInexact which does the rounding up (and shares logic with CRAM/CRRL)

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

2 participants