Skip to content

[AARCH-25772,cat] Changes to the ordering requirements of DMB LD and DSB LD#1880

Draft
artkhyzha wants to merge 2 commits into
herd:masterfrom
artkhyzha:artem-mte-fix
Draft

[AARCH-25772,cat] Changes to the ordering requirements of DMB LD and DSB LD#1880
artkhyzha wants to merge 2 commits into
herd:masterfrom
artkhyzha:artem-mte-fix

Conversation

@artkhyzha

@artkhyzha artkhyzha commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR relaxes the architectural intent so that DMB LD and DSB LD provide order from Implicit Tag Memory Read Effects only if those are generated by instructions that (1) also generate Explicit Memory Read Effects, and (2) are not atomic instructions that use a zero register as their destination register.

In the case of DSB LD, implementing the relaxation to the architectural intent means correcting the ETS2 clause that previously omitted Implicit Tag Memory Reads. Hence, this specific case actually shows up as a strengthening in logs.

The following is the output of verdicts from herd7 for the tests in this PR. Some of them illustrate the changes, others illustrate corner cases that are not affected.

                                          |Kind| Before After 
-------------------------------------------------------------
-------------------------------------------------------------
ETS2.MP-I2V+dmb.stpt+dsb.ld               |---| Allow  Forbid
-------------------------------------------------------------
LB-noret-tagfault+dmb.ldpp+dmb.ldpt       |---| Forbid Allow 
-------------------------------------------------------------
LB-synctagfault+dmb.ldpp+dmb.ldpt         |---| Forbid Forbid
-------------------------------------------------------------
LB-tagfault+dmb.ldpp+dmb.ldpt             |---| Forbid Forbid
-------------------------------------------------------------
LB-tagfault-casfail+dmb.ld+dmb.ldpt       |---| Forbid Forbid
-------------------------------------------------------------
LB-tagfault-casok+dmb.ld+dmb.ldpt         |---| Forbid Forbid
-------------------------------------------------------------
MP-noret+dmb.ldpt+dmb.ldpp                |---| Forbid Allow 
-------------------------------------------------------------
MP-synctagfault+dmb.ldpt+dmb.ldpp         |---| Allow  Allow 
-------------------------------------------------------------
R+dmb.ldpt+dmb.ldpp                       |---| Forbid Allow 
-------------------------------------------------------------
R-noret-synctagfault+dmb.ldpt+dmb.ldpp    |---| Forbid Forbid
-------------------------------------------------------------
WWRW-asynctagfault+dmb.ldpp+dmb.ldpt      |---| Forbid Allow 
-------------------------------------------------------------
WWRW-noret-asynctagfault+dmb.ldpp+dmb.ldpt|---| Forbid Allow

P.S. The above table is produced via commands:

herd7 tests/*.litmus > Before
herd7 tests/*.litmus -I libdir > After
mcompare7 -show X Before After

@artkhyzha

artkhyzha commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

Currently fails make test. This is due to the test for miaou7 introduced in this commit. For the PR to pass that test, it needs improvements to miaou7 for handling the domain function in cat.

Fixed. A different change implemented to handle "domain". Also, the cat file is edited slightly to improve the output.

| (if "ETS2" || "ETS3" then [M | DC.CVAU | IC | TLBI]; po; [dsb.full]; po; [Imp & TTD & M] else 0)
| [(Exp & R) \ NoRet | Imp & Tag & R]; po; [dsb.ld]; po; [~(Imp & TTD & M | Imp & Instr & R)]
| (if "ETS2" || "ETS3" then [(Exp & R) \ NoRet]; po; [dsb.ld]; po; [Imp & TTD & M] else 0)
| [(Exp & R) \ NoRet | domain([Imp & Tag & R]; same-instance; [(Exp & R) \ NoRet])]; po; [dsb.ld]; po; [~(Imp & TTD & M | Imp & Instr & R)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have we consider the case where E1 is generated by a LDR instruction that faults?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. It is quite hard to come up with a relevant test. In simple MP shapes, this Imp Tag R would be IFB-ordered-before everything that follows the exception entry in program order. This renders DMB LD irrelevant.

So in principle it is interesting to ponder whether the phrasing for the changes to DMB LD needs to be adjusted to account for the faulting case, but it could be good to invent a test for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also add the catdefinitions.tex here?

I assume you didn't have to make any changes to catdefinitions.tex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants