-
Notifications
You must be signed in to change notification settings - Fork 9
src/mte_tag: add checktag instruction to Zimt spec #68
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
Conversation
src/mte_tag.adoc
Outdated
starting at virtual address `rs1`. If any of the loaded `mc_tag` value(s) | ||
mismatches with the `pointer_tag` specified in `rs1`, then software check | ||
exception is raised with tval = 4. If memory tagging is enabled in the | ||
execution environment then `checktag` instruction always makes the check |
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.
This is an interesting consideration. Can you give your rational for ignoring the PTE.MTAG of the data?
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.
Multiple reasons
-
Technically all that is needed is whether this pointer is valid, there is no need to touch the virtual address. So one less page walk. one less tlb lookup. Thus ignoring PTE.MTAG is a good optimization here for CPU.
-
Compiler put it there because it actually wanted to know pointer validity. So what's the point of honoring MTAG bit here.
Let me know if you don't want it to do check for tags if ITLB.MTAG=1 or PTE.MTAG=1 for codepage.
That's the instruction-side of things then. We can specify a rule here that checktag
reverts to zimop behavior
if fetched from a codepage with PTE.MTAG=1 or ITLB.MTAG=1
I am assuming that's where you were heading with this.
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.
We can specify a rule here that checktag reverts to zimop behavior if fetched from a codepage with PTE.MTAG=1 or ITLB.MTAG=1
No, that would defeat the whole point.
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.
Ok then we can specify that checktag
always checks for the tag irrespective of setting PTE.MTAG on data or code page.
Sounds okay?
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.
Take a look now.
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.
Did another minor update.
@fmayer
looks okay to you?
fbc14d4
to
5d35235
Compare
src/mte_tag.adoc
Outdated
extension, `checktag rs1, #chunk_count` which extracts `pointer_tag` from `rs1` | ||
and performs load tag operation for memory chunks (count = `#chunk_count`) | ||
starting at virtual address `rs1`. If any of the loaded `mc_tag` value(s) | ||
mismatches with the `pointer_tag` specified in `rs1`, then software check |
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.
Improve wording. first it says
rforms load tag operation for memory chunks (count =
#chunk_count
)
starting at virtual addressrs1
. If any of the loadedmc_tag
value(s)
mismatches with thepointer_tag
specified inrs1
, then software check
exception is raised
but then it clarifies that it doesn't if memtag is off.
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.
Take a look at wordings now.
Signed-off-by: Deepak Gupta <[email protected]>
No description provided.