Commit 56e8ddf
[AARCH-24571,herd] Fixes in aarch64.cat relating to FEAT_HAFDBS
This change implements AARCH-24571 as published in the Arm
Architecture Reference Manual for A-profile architecture: Known issues
in Issue L.b.
With FEAT_HAFDBS, in the case where one PE, P0, is configured with
hardware updates of Dirty state enabled (TCR_ELx.{HA, HD}={1, 1}), but
another PE, P1, using the same translation tables is configured with
hardware updates of Dirty state disabled ((TCR_ELx.{HA, HD}={x, 0}),
the following scenario can occur:
* P1 has a copy of a writable-clean translation table entry cached in
a TLB.
* P0 performs a hardware update of Dirty state for that translation
table entry.
* A store is attempted on P1, and this hits the writable-clean
translation table entry cached in the TLB.
The architecture permits the store on P1 to generate a Permission
fault, because P1 has hardware updates of Dirty state disabled.
However, the formal memory model did not permit this outcome. The
changes below relax the memory model to permit this outcome, and
therefore match the rules described in section D8.5.2.1 "Hardware
management of the dirty state".
As a result the following test is architecturally forbidden:
AArch64 S.HU+dsb.sy+dsb.sy-isb
Variant=vmsa
TTHM=P0:HD
{
[TTD(x)]=(oa:PA(x), dbm:1, db:0);
0:X1=x; 0:X3=y;
1:X1=x; 1:X3=y;
}
P0 | P1 ;
MOV W0,#1 | LDR W2,[X3] ;
STR W0,[X1] | DSB SY ;
DSB SY | ISB ;
MOV W2,#1 | MOV W0,#2 ;
STR W2,[X3] | STR W0,[X1] ;
exists (1:X2=1 /\ fault(P1,x))
In addition, in the case where a PE is configured with hardware
updates of Dirty state enabled (TCR_ELx.{HA, HD}={1, 1}), the
architecture forbids the hardware update of Dirty state on the PE
until the associated store is known to be non-speculative and,
therefore, ahead of the address translation or the tag check of an
instruction earlier in program order. However, the formal memory
model allowed such an outcome to be observed. The changes below
strengthen the memory model to forbid this outcome, and therefore
match the rules described in section D8.5.2.1 "Hardware management of
the dirty state".
As a result, the following test is architecturally forbidden:
AArch64 S.HU+dmb.st+po-ttd
TTHM=P1:HD
Variant=vmsa,fatal
{
[TTD(x)]=(oa:PA(x), dbm:1, db:0);
[TTD(y)]=(oa:PA(y), valid:0);
pteval_t 0:X6=(oa:PA(y), valid:1); 0:X7=TTD(y);
pteval_t 0:X8=(oa:PA(x), dbm:1, db:0); 0:X9=TTD(x);
1:X1=x; 1:X3=y;
}
P0 | P1 ;
STR X8,[X9] | L0: LDR WZR,[X3] ;
DMB ST | MOV W0,#1 ;
STR X6,[X7] | L1: STR W0,[X1] ;
exists (not (fault(P1:L0)) /\ [TTD(x)]=(oa:PA(x), dbm:1, db:0))
and the following test is architecturally forbidden:
AArch64 S.HU+dmb.st+po-tag
TTHM=P1:HD
Variant=vmsa,fatal,mte,sync
{
[TTD(x)]=(oa:PA(x), dbm:1, db:0);
[TTD(y)]=(oa:PA(y), TaggedNormal);
0:X6=y:red; 0:X7=y:green;
pteval_t 0:X8=(oa:PA(x), dbm:1, db:0);
0:X9=TTD(x);
1:X1=x; 1:X3=y:red;
}
P0 | P1 ;
STR X8,[X9] | L0: LDR WZR,[X3] ;
DMB ST | MOV W0,#1 ;
STG X6,[X7] | L1: STR WZR,[X1] ;
exists (not (fault(P1:L0)) /\ [TTD(x)]=(oa:PA(x), dbm:1, db:0))
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>1 parent 52f25fb commit 56e8ddf
File tree
4 files changed
+17
-23
lines changed- catalogue/aarch64-VMSA/tests
- herd/libdir
4 files changed
+17
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
| 624 | + | |
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
395 | 389 | | |
396 | 390 | | |
397 | 391 | | |
| |||
0 commit comments