Skip to content

Commit 5563fbb

Browse files
authored
src/mte: some minor cleanup (#50)
Signed-off-by: Deepak Gupta <debug@rivosinc.com>
1 parent d350261 commit 5563fbb

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/mte_intro.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ deployment scenarios including production.
8888

8989
Leveraging this software usage model, the `Zimte` extension defines a mechanism
9090
for tagged pointer construction, tag management instructions to store tags and
91-
tag checks on memory accesses (pointer dereferences). `Svatag` extension
92-
defines that `tag` is stored in virtual memory along with protection mechanisms
93-
for tag storage.
91+
tag checks on memory accesses (pointer dereferences). `Svatag` and `Smvatag`
92+
extensions defines tag storage mechanism in virtual memory along with protection
93+
mechanisms for tag storage.

src/mte_tag.adoc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ zeroes destination register.
144144
addtag instruction can be used by the compiler for generating distinct pointer
145145
tags derived from a base tag (base tag obtained via gentag). Compiler can use
146146
this mechanism to assign different tags (with same base tag) for consecutive
147-
objects on stack and mitigate adjacent overflow bugs. This also helps with
147+
objects on stack and help catch adjacent overflow bugs. This also helps with
148148
language runtime during events like exception unwind to calculate tags for
149149
objects on stack in a deterministic manner.
150150
@@ -213,10 +213,10 @@ and maximum possible chunks are 16. 8x16 = 128 bit).
213213
====
214214

215215
Depending on width of `mc_tag`, `settag` may end up being a read, modify and
216-
then write operation on the memory region defined by Svatag extension. There
217-
are no atomicity requirements on the implementation for `settag` instruction.
218-
If atomicity is desired for `store tag` operation then it is software's
219-
responsibility using existing mechanisms.
216+
then write operation on the memory region defined by Svatag and Smvatag
217+
extensions. There are no atomicity requirements on the implementation for
218+
`settag` instruction. If atomicity is desired for `store tag` operation then it
219+
is software's responsibility using existing mechanisms.
220220

221221
`settag` can generate store operations larger than maximum store width
222222
supported by implementation and implementation may choose to split it
@@ -226,7 +226,7 @@ no ordering requirements or dependencies among splitted stores.
226226
===== Memory ordering requirement
227227

228228
A regular memory access (regular load or regular store) to some virtual address
229-
`va` can not bypass the older store initiated by `settag rs1=va`.
229+
`va` can not bypass the older store tag initiated by `settag rs1=va`.
230230

231231
This specification defines tag as the entity associated to virtual addresses.
232232
In case of aliasing (multiple virtual addresses map to same physical address),
@@ -273,9 +273,10 @@ checks are performed
273273
* Hart evaluates expression `mc_tag == pointer_tag` and if false then hart
274274
raises a software check exception with tval = 4.
275275

276-
While performing tag check on a regular load/store, fetching `mc_tag` from the
277-
tag memory region holding tags may also result in a load page fault or load
278-
access fault and hart reports the virtual address of the tag in `xtval`.
276+
While performing tag check on a regular load/store, fetching (load tag
277+
operation) `mc_tag` from the tag memory region holding tags may also result in
278+
a load page fault or load access fault and hart reports the virtual address of
279+
the tag in `xtval`.
279280

280281
[NOTE]
281282
=====
@@ -320,7 +321,7 @@ following rules apply:
320321
common denominator of `MTAG=0` applies for such instruction.
321322

322323
`MTAG` bit in page table entry remains a reserved bit if `XWR == 111` or
323-
`XWR == `010` and if set, will raise a page fault of original access type.
324+
`XWR == 010` and if set, will raise a page fault of original access type.
324325

325326
If memory tagging is not enabled for the execution environment via *envcfg CSR,
326327
then `MTAG` bit in page table entry remains a reserved and if set will raise a

0 commit comments

Comments
 (0)