Skip to content

Commit 37f2ef9

Browse files
artkhyzharelokin
andcommitted
[herd] Strengthen the ordering requirements for Exp-haz-ob in aarch64.cat
Feedback from the the Linux kernel indicated that the implementation of qspinlock would benefit from stronger ordering guarantees for mixed-size memory accesses. This proposal is updating to the Explicit-hazard-ordered-before rule in order to strengthen the ordering requirements of the architecture. As a result of this change, the following two tests become forbidden: AArch64 CoRR+amo.swph0h0-posh0a.w0+w0 Variant=mixed { uint32_t 0:X3; uint32_t 0:X2; 0:X0=x; uint32_t 1:X1=0xccddeeff; 1:X0=x; } P0 | P1 ; MOV W2,herd#42 | STR W1,[X0] ; SWPH W2,W1,[X0] | ; LDAR W3,[X0] | ; exists (0:X1=0xeeff /\ 0:X3=42) AArch64 CoRR+rmwh0h0-posh0a.w0+w0 Variant=mixed { uint32_t 0:X3; uint32_t 0:X2; 0:X0=x; uint32_t 1:X1=0xccddeeff; 1:X0=x; } P0 | P1 ; MOV W2,herd#42 | STR W1,[X0] ; LDXRH W1,[X0] | ; STXRH W4,W1,[X0] | ; LDAR W3,[X0] | ; exists (0:X1=0xeeff /\ 0:X3=42 /\ 0:X4=0) Co-authored-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
1 parent c903074 commit 37f2ef9

File tree

7 files changed

+38
-3
lines changed

7 files changed

+38
-3
lines changed

catalogue/aarch64-mixed/shelf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
cats = [
44
"cats/aarch64.cat",
5-
]
5+
]
66

77
cfgs = [
88
"cfgs/web-mixed.cfg",
99
]
1010

1111
illustrative_tests = [
12+
"tests/CoRR+amo.swph0h0-posh0a.w0+w0.litmus",
13+
"tests/CoRR+rmwh0h0-posh0a.w0+w0.litmus",
1214
"tests/MP-Koeln.litmus",
1315
"tests/LB+dmb.sy+data-wsi-wsi+MIXED+H.litmus",
1416
"tests/MP+HAmo+BAcqAmo.litmus",

catalogue/aarch64-mixed/tests/@all

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CoRR+rmwh0h0-posh0a.w0+w0.litmus
2+
CoRR+amo.swph0h0-posh0a.w0+w0.litmus
13
2+2W+posb0b0+posb1b1.litmus
24
2+2W+posw0w0+posw4w4.litmus
35
CO-MIXED-20cc+H.litmus
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
AArch64 CoRR+amo.swph0h0-posh0a.w0+w0
2+
Variant=mixed
3+
{
4+
uint32_t 0:X3; uint32_t 0:X2;
5+
0:X0=x;
6+
uint32_t 1:X1=0xccddeeff; 1:X0=x;
7+
}
8+
P0 | P1 ;
9+
MOV W2,#42 | STR W1,[X0] ;
10+
SWPH W2,W1,[X0] | ;
11+
LDAR W3,[X0] | ;
12+
exists (0:X1=0xeeff /\ 0:X3=42)
13+
14+
(* Linux's qspinlock for systems without FEAT_LSE requires that this is forbidden *)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
AArch64 CoRR+rmwh0h0-posh0a.w0+w0
2+
Variant=mixed
3+
{
4+
uint32_t 0:X3; uint32_t 0:X2;
5+
0:X0=x;
6+
uint32_t 1:X1=0xccddeeff; 1:X0=x;
7+
}
8+
P0 | P1 ;
9+
MOV W2,#42 | STR W1,[X0] ;
10+
LDXRH W1,[X0] | ;
11+
STXRH W4,W1,[X0] | ;
12+
LDAR W3,[X0] | ;
13+
exists (0:X1=0xeeff /\ 0:X3=42 /\ 0:X4=0)
14+
15+
(* Linux's qspinlock for systems without FEAT_LSE requires that this is forbidden *)

catalogue/aarch64-mixed/tests/kinds.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CoRR+amo.swph0h0-posh0a.w0+w0 Forbidden
2+
CoRR+rmwh0h0-posh0a.w0+w0 Forbidden
13
2+2W+posb0b0+posb1b1 Allowed
24
CO-MIXED-20cc+H Forbidden
35
CoRW2+posb0b0+b0 Allowed

herd/libdir/aarch64.cat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ with IC-after from (all-IC-Imp_Instr_R-enums local-hw-reqs)
6161

6262
(** Explicitly-hazard-ordered-before **)
6363
let Exp-haz-ob =
64-
[Exp & R]; (po & same-loc); [Exp & R]; (ca & ext); [Exp & W]
64+
[Exp & R]; (po & same-loc); [Exp & R]; sca-class?; [Exp & R]; (ca & ext); [Exp & W]; sca-class?; [Exp & W]
6565

6666
(** TLBI-ordered-before **)
6767

herd/libdir/catdefinitions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
\newcommand{\sameloc}[2]{#1 and #2 are to the Same Location}
1919
\newcommand{\samelocemph}[2]{#1 and #2 are to the \emph{Same Location}}
2020

21-
\newcommand{\sca}[2]{#1 belongs to the same single-copy-atomic class as #2}
21+
\newcommand{\sca}[2]{#1 belongs to the same single-copy-atomic grouping as #2}
2222
\newcommand{\po}[2]{#1 appears in program order before #2}
2323

2424
\newcommand{\coemph}[2]{#1 is \emph{Coherence-write-before} #2}

0 commit comments

Comments
 (0)