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

Reformulation for "fencing when changing SDID" #108

Closed
ronan-lashermes opened this issue Oct 29, 2024 · 3 comments
Closed

Reformulation for "fencing when changing SDID" #108

ronan-lashermes opened this issue Oct 29, 2024 · 3 comments

Comments

@ronan-lashermes
Copy link

I believe this phrase could be clarified:

changed at the cost of fencing to flush any prior cached state. The SDID is

To me, "cached state" suggests only the need to flush specific microarchitectural caching structures (such as TLB, L1D, L1I). However, from a security standpoint, the correct action involves flushing all microarchitectural state, including components like branch prediction (BTB, RSB, TAGE) and cache controller states.

Suggested revision:

"However, the SDID can be changed at the cost of fencing to flush any prior microarchitectural state"

Still, I am unsure if this phrasing would be sufficiently clear for readers unfamiliar with the risks associated with covert channels.

@rsahita
Copy link
Collaborator

rsahita commented Oct 29, 2024

Hi Ronan - this specification does not delve into any treatment of flushing any micro-arch state when supervisor domains are in use. The security model and the uarch side-channel specs are the right place for that treatment. The goal of this sentence was to note that the SDID is a hart-local identifier and may be reused as long as the state tagged by the re-used SDID is appropriately flushed.

per your comment - i think these two lines should be moved to an "implementation note" - I plan to change it as follows - PTAL:

For most typical usages, the SDID will remain stable over the life
of the supervisor domain. However, the SDID can be changed
at the cost of fencing to flush any prior cached state that was
associated with the SDID.

@ronan-lashermes
Copy link
Author

Ok, as I understand it, the SDID is a security domain identifier and therefore, upon changing it, should quite naturally trigger a fence.time kind of flushing/partitioning. As you say, the details should be left to the fence.time spec.

What I wanted to say is that flushing cached state is required for proper functionality, flushing all state (with fence.time for example) is required for security. In a hypothetical future with fence.time, fence.time is the instruction that should trigger the flushing, including the cached state.

Moving this sentence to an implementation note is a great solution, but I think you can remove the "fencing to" for clarity.

For most typical usages, the SDID will remain stable over the life
of the supervisor domain. However, the SDID can be changed
at the cost of flushing any prior cached state that was
associated with the SDID

@rsahita
Copy link
Collaborator

rsahita commented Oct 31, 2024

sounds good PTAL PR #109

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