mte_vatag: add stateen interaction - #103
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Svatag specification to describe how access to the tag-table base CSRs interacts with stateen gating, with the goal of preventing unintended communication channels via newly exposed architectural state.
Changes:
- Add a new “Accessibility of Svatag CSRs” section describing when CSR accesses trap based on
Smstateen/Ssstateenandmstateen0/hstateen0settings.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
While reviewing #102 (comment), I forgot that we already add a new state for the Svatag, so that comment was unjustified. This PR currently only handles the existing CSRs, I'll rebase and probably choose a different placement after the other PR gets merged. |
b13a7d7 to
6ba484d
Compare
Since the MTE CSRs expose new architectural state that needs to be managed for lower privileges, we add interaction with stateen to make sure that the CSRs do not create unintentional communication channels.
6ba484d to
cad6e1f
Compare
|
I moved the access restriction from stateen closer to CSR definitions. It avoid the need for another conditional based on whether Zimt/Svatag are supported. Note that stateen may not be the only solution -- we already have the envcfg bits, which could also be used to avoid access to the CSRs from lower privileges. |
|
It makes sense, thanks Radim Krčmář (@radimkrcmar). Florian Mayer (@fmayer) and deepak0414 can you take a look as well? |
| exception if Smstateen is implemented and `mstateen0.MTE=0`. | ||
|
|
||
| CSR access to `senvmtagexclude0`, and `senvmtagexclude1` from VS mode causes | ||
| virtual instruction exception if Ssstateen is implemented, `hstateen0.MTE=0`, |
There was a problem hiding this comment.
should this be hstateen0.MT instead?
Signed-off-by: Florian Mayer <fmayer@google.com>
Signed-off-by: Florian Mayer <fmayer@google.com>
Since the CSRs expose new architectural state that needs to be managed for lower privileges, we must make sure that they do not create unintentional communication channels.