-
Notifications
You must be signed in to change notification settings - Fork 9
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
Weaken backwards-arc sentry pseudo-locality #79
Comments
I think from microarchitecture point of view, using CSP makes it tougher compared to using a CSR. Reason being that there is only one way (via CSRRW) to change a "normal" CSR, and it is easier for it to take effect immediately after execution. Meanwhile, CSP can be updated in a number of different ways (R2R instructions, load from memory) so it is tricker to get it right. We might be able to simplify things a little w/ flush instructions, but I am not super sure how it works beyond just cheriot-ibex. |
(Another argument in favor of having made SP architectural and not an ordinary GPR. Which, having not done in the base ISA, RISC-V then almost did with the compressed instruction encodings... grumble.) |
@davidchisnall was asking in the meeting, I think (forgive me if I've gotten this wrong), if it's possible to avoid some of the pipeline forwarding complexity by making That's the case that matters, since when
In practice, almost all spills of return addresses will use |
I think, musing aloud, that it's fine if this effect of transitioning |
@nwf if we can indeed defer the effect till mret/cjalr it would help (since those instructions flush the pipeline anyway). Another thought - is it possible to make an architecturally visible mode bits rather than referring to CSP? I guess it's similar to making a CSR.. |
For now, just rip pseudolocality out. See #82. We can revisit this later. |
#64 added a "pseudo-locality" flavor of return sentry capabilities: storing these always requires
SL
authority, even if the sentry object itself isG
-lobal (which it should be, so that after return, things derived fromauipcc
are global). (See also discussion on #63)This is all well and good, but it means that we can't easily let compartments running under the RTOS pivot onto heap-allocated stacks. While such a pivoted thread couldn't make cross-compartment calls and would have to be careful about local parameters, it would be very convenient for adapting existing code that uses large on-stack buffers (e.g., TLS), and it wouldn't require us to allocate large stacks for threads that incidentally call into such code.
@davidchisnall's suggestion is to weaken the requirement on stores such that storing a backwards-arc sentry requires
SL
of its authority (whatever that authority might be) if the capability incsp
isSL
-bearing. I'll write this up in Sail for review and @kliuMsft can tell us how we're ruining timing of the pipeline. :)The text was updated successfully, but these errors were encountered: