@@ -35,7 +35,7 @@ better clarity and will be used in the rest of the specification.
35
35
Load and store operating on a page with permissions `--R`, `X-R`, `-WR` and
36
36
`XWR` are termed as a `regular load` and `regular store`. Regular load and
37
37
regular store memory operations are generated from an instruction (except
38
- `settag`) defined by ISA to perform memory accesses.
38
+ `settag` and `checktag` ) defined by ISA to perform memory accesses.
39
39
40
40
==== Checked load and store
41
41
Regular load and store which is subject to tag check is termed as checked load
@@ -295,6 +295,33 @@ local to a function. These accesses are deemed to be safe and thus are not
295
295
subject to tag checks.
296
296
=====
297
297
298
+ ==== Explicit tag check
299
+ Zimt defines an explicit tag check instruction taken from `MOP.RR.1` of zimop
300
+ extension, `checktag rs1, #chunk_count`. If memory tagging is disabled in the
301
+ execution environment then `checktag` instruction reverts to zimop behavior. If
302
+ memory tagging is enabled in the execution environment then `checktag`
303
+ instruction extracts `pointer_tag` from `rs1` and performs load tag operation
304
+ for memory chunks (count = `#chunk_count`) starting at virtual address `rs1`.
305
+ If any of the loaded `mc_tag` value(s) mismatches with the `pointer_tag`
306
+ specified in `rs1`, then software check exception is raised with tval = 4. If
307
+ memory tagging is enabled in the execution environment then `checktag`
308
+ instruction always makes the check irrespective of `PTE.MTAG` bit setting for
309
+ the code page from where `checktag` instuction is fetched or for data page
310
+ virtual address specified in `rs1`.
311
+
312
+ [wavedrom, ,svg]
313
+ ....
314
+ {reg: [
315
+ {bits: 7, name: 'opcode', attr:'SYSTEM'},
316
+ {bits: 5, name: 'rd', attr:['00000']},
317
+ {bits: 3, name: 'funct3', attr:['100']},
318
+ {bits: 5, name: 'rs1', attr:['tagged_pointer']},
319
+ {bits: 4, name: 'tag_imm4', attr:['chunk_count']},
320
+ {bits: 1, name: '0', attr:['0']},
321
+ {bits: 7, name: '1000011', attr:['gentag']},
322
+ ], config:{lanes: 1, hspace:1024}}
323
+ ....
324
+
298
325
[[ASYNC_SW_CHECK]]
299
326
=== Asynchronous reporting for tag mismatches
300
327
0 commit comments