-
Notifications
You must be signed in to change notification settings - Fork 15
DNM! loads and stores through x0 use SCRs? #107
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
base: main
Are you sure you want to change the base?
Conversation
This is an extremely untested thought for CHERIoT v2.
vmurali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine using x0 loads/stores to force using an SCR.
But I think we should make it always refer to a single SCR, rather than depend on whether you have ASR permission or not. I guess you want to replace both AUICGP and simplify switcher spills? Switcher spill is actually not that complicated in my opinion and allows changing the implementation as we see fit in the future.
If you really want to have SCR-based loads and stores, you can create new SCR/CSR instructions that have new SCR indices (and one of the registers can be an offset) that translate to memory writes.
|
Replying a little bit out of order...
Well, sort of, yes, depending on where in the "let's make changes to CHERIoT" story you start. The first vague proposal is to move
This is sort of a separate consideration, arising from the observation that the switcher never dereferences a compartment's As an aside: both Thinking about RISC-V mode switches / exception entry is enough to make one miss X86 (or Arm M). While it's true that a store-through-
New loads and stores eat up a lot of encoding space, and this bit of space is laying right here and otherwise useless by definition. Separately, register-displacement operations are otherwise absent in base RISC-V, so I don't think that'd be seen as a particularly friendly amendment. (This is where we chant "micro-op fusion", right?)
I suppose I'd be willing to gate which CSR is targeted by choice of register operand -- like we did with I suppose the concern here is code that's intended to be ambivalent about whether its running with or without PCC.ASR? (Maybe we have to do something special when compiling the loader, which always runs with PCC.ASR but does have globals, unlike the switcher...) All that said, thanks for the food for thought, as ever. |
Discussed about this offline. What I meant is to hijack the SCR (or CSR in RISCV spec) space to encode new instructions (with a 5-bit offset instead of specifying a source or a destination register for loads or stores respectively). The problem in that, as we discussed, is that we only have a 5-bit offset, as opposed to a 12 bit offset.
Yes. The context of the code would suddenly matter, making it hard to reason about the code - especially when we start "lending" ASR capabilities to other code regions, instead of putting all ASR code into the switcher as we do currently. But ultimately, we do need to understand whether a code runs with ASR or not, to actually reason about it. So this ASR-dependency is not going to change that disposition, but nevertheless it makes it harder to reason about. |
This is an extremely untested thought for CHERIoT v2.