You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the fault check functionality related to pte value.
- add `check_fault` and `check_value` fields in `node` structure in `cycle.ml`,
,with default values being `None` for irrelevance. `check_fault` carries a boolean
and a string, that is, if the event should fault and a label for the instruction.
While `check_value` carries a boolean for if any memory effect check, i.e. read event,
should be check. This two new variables enable generating fault and value check when
there is previous change to pte or plain values respectively.
- Introduce `can_fault` function in `Pteval`, which checks if `valid` is set,
i.e., being 1, in AArch64, while always returns `true` for other platform.
- In `final.ml` Use the FaultSet in `/lib` to track and rendering the `Fault`, which
replace the existing `StringSet` solutions. In particular, there are
two `FaultSet` that track postive and negative cases, i.e.
`Fault(...)` and `~Fault(...)`.
- Modify `AArch64Compile_gen.ml` for printing the label on load and store instruction,
when a fault check is needed.
The test for postive fault is a variant of `LB.litmus`. That is
```
diyone7 -arch AArch64 -variant kvm PodRW PteVA Rfe PodRW PteVA Rfe
```
This will generate a test:
```
AArch64 A
"PodRWPPteVA RfePteVAP PodRWPPteVA RfePteVAP"
Generator=diyone7 (version 7.58+1)
Prefetch=0:x=F,0:y=W,1:y=F,1:x=W
Com=Rf Rf
Orig=PodRWPPteVA RfePteVAP PodRWPPteVA RfePteVAP
{ int y=0; int x=4;
0:X0=x; 0:X2=PTE(y); 0:X3=(oa:PA(y), valid:0);
1:X1=y; 1:X5=PTE(x); 1:X6=(oa:PA(x), valid:0);
}
P0 | P1 ;
L01: | L00: ;
LDR W1,[X0] | LDR W4,[X1] ;
STR X3,[X2] | STR X6,[X5] ;
exists (Fault(P0:L01,x) /\ Fault(P1:L00,y))
```
that checks if both labelled-`LDR` triggers fault. This is in the same spirit of
`catalogue/aarch64/tests/LB.litmus` that both `LDR` observe
the the value written by `STR`.
Regarding the test for much more common negetive fault, i.e. no fault.
```
diyone7 -arch AArch64 -variant kvm -oneloc PteVA TLBI-sync.ISHsWR Fri
```
This will generate a test:
```
AArch64 A
"TLBI-sync.ISHsWRPteVAP FriPPteVA"
Generator=diyone7 (version 7.58+1)
Com=Fr
Orig=TLBI-sync.ISHsWRPteVAP FriPPteVA
{ int x=0;
0:X0=PTE(x); 0:X1=(oa:PA(x), valid:0); 0:X2=x;
}
P0 ;
STR X1,[X0] ;
LSR X4,X2,herd#12 ;
DSB ISH ;
TLBI VAAE1IS,X4 ;
DSB ISH ;
L00: ;
LDR W3,[X2] ;
exists (~Fault(P0:L00,x))
```
which check if the labelled-`LDR` triggers no fault because does not
observe the previous `STR` on the PTE value of variable `x`.
Minor improvement:
- Merge the accumulators `cell` and `pte_cell` into CoSt `st` in cycle (`cycle.ml`) building,
functions `do_set_write_v` and `do_set_read_v`.
- Replace a few manual list foldings with a `List.fold_left`.
- Add some explanatory comments on some single-latter variables.
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Signed-off-by: Shale Xiong <shale.xiong@arm.com,xiongshale@gmail.com>
0 commit comments