src/mte_tag: tighten the first stage page table conditions for MTAG#79
Conversation
|
It came to my attention that there was a bug on normal (non-MPRV, non-HLV/HSV) @radimkrcmar, if you could spend few minutes on this as well. That would be appreciated. |
I am a bit out of water here as I don't understand why XWR is reserved, as XR seems practically the same, so any decision about how it should interact with tagging seems arbitrary to me. |
MTAG = 1 with XWR because it creates a situation where code can be self modifying or code is operating on data which is on same page. As per the rules tag checks should elided. However any such situation wanting tag checks or elision doesn't make sense. So totally avoiding that encoding to be possible and keeping it reserved. |
Aah |
e41f634 to
8f9c7f7
Compare
Did an update on PR. |
|
@fmayer says that its easier to say simply that checked accesses come executable page with mtag=0 towards a data page with mtag = 1. |
Quite often loader or other piece of code might read code pages. If a code page is set as MTAG=1, then those loads (to code page) will look for tags. This change clarifies in specification that loads/stores to pages marked as executable always generate unchecked memory accesses. If if memory tagging is not enabled for execution environment then `MTAG` bit is ignored. This allows for setting up tagging and enabling/disabling on sampling basis (without asking OS to clear to the bit when tagging is disabled) Signed-off-by: Deepak Gupta <debug@rivosinc.com>
8f9c7f7 to
15d5106
Compare
|
Can anyone take a look, approve or drop a comment? |
Quite often loader or other piece of code might read code pages. If a code page is set as MTAG=1, then those loads (to code page) will look for tags. This change clarifies in specification that loads/stores to pages marked as executable always generate unchecked memory accesses.
Setting MTAG for XWR=111 and XWR=010 was disallowed. Instead of raising page fault, raise access-fault exception to signify fatality.