Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,21 @@ litmus-aarch64-run:: litmus-cata-aarch64-ifetch-test-kvm

litmus-cata-aarch64-ifetch-test-kvm: litmus-aarch64-dep
mkdir $(KUT_DIR_AARCH64)/kvm-unit-tests/t
if $(RUN_TESTS); then NORUN=UDF+2FH; else NORUN=NO; fi ; \
Comment thread
diaolo01 marked this conversation as resolved.
if $(RUN_TESTS); then \
NORUN=UDF+2FH ; \
TESTS=catalogue/aarch64-ifetch/tests/@dic0-idc0 ; \
else \
NORUN=NO ; \
TESTS=catalogue/aarch64-ifetch/tests/@all ; \
fi ; \
$(LITMUS) \
-set-libdir $(LITMUS_LIB_DIR) \
-o $(KUT_DIR_AARCH64)/kvm-unit-tests/t \
-mach kvm-armv8.1 -variant self -a 4 -s 10 -r 10 \
-nonames $${NORUN} \
-driver C -ascall true \
-outnames $(KUT_NAMES) \
catalogue/aarch64-ifetch/tests/@all
$${TESTS}
cd $(KUT_DIR_AARCH64)/kvm-unit-tests/t; make $(SILENTOPT) -j $(J)
if $(RUN_TESTS); then \
( cd $(KUT_DIR_AARCH64)/kvm-unit-tests && sh t/run.sh ) | \
Expand Down
8 changes: 8 additions & 0 deletions catalogue/aarch64-ifetch/tests/@dic0-idc0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DIC0-IDC0/@all
MP+rel+blr.litmus
MP.FF+dc.cvau-dmb.ish+dsb.ish-ic.ivau-dsb.ish-rfiINSTNOP.litmus
MP.FF+dc.cvau-dsb.ish-ic.ivau-dsb.ish+dmb.ish+rfiINST.litmus
MP.FF+dc.cvau-dsb.ish-ic.ivau-dsb.ish+po.litmus
MP.RF+dc.cvau-dmb.ish+dsb.ish.ic.ivau.dsb-rfiINSTRISB.litmus
SM.udf+dc.cvau+dsb.ish-ic.vau-dsb.ish-isb.litmus
mytest2.litmus
9 changes: 5 additions & 4 deletions litmus/libdir/_aarch64/self.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ inline static void isync(void) {
asm __volatile__ ("isb" ::: "memory");
}

inline static void check_dic_idc(int need_dic, int need_idc) {
inline static int check_dic_idc(int need_dic, int need_idc) {
uint64_t ctr_el0;
asm volatile ("mrs %0, ctr_el0" : "=r" (ctr_el0));
int idc = (ctr_el0 >> 28) & 1;
int dic = (ctr_el0 >> 29) & 1;
if ((need_dic && !dic) || (need_idc && !idc)) {
fprintf(stderr, "Fatal error: hardware does not support the CacheType "
"feature IDC=%d, DIC=%d\n", need_idc, need_dic);
exit(0);
printf("Required hardware features not available on this system: "
"IDC=%d, DIC=%d\n", idc, dic);
return 0;
}
return 1;
}
16 changes: 16 additions & 0 deletions litmus/preSi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,22 @@ module Make
O.fi "if (!check_const_pac_field_variant(%S)) return 0;" doc.Name.name;
if Cfg.is_kvm && Cfg.variant Variant_litmus.ExS then
O.fi "if (!check_exs(%S)) return 0;" doc.Name.name ;
if do_self then begin
let cache_type = CacheType.get test.T.info in
let needs_dic, needs_idc =
let open CacheType in
match cache_type with
| None -> (fun _ -> false), (fun _ -> false)
| Some cache_type -> cache_type.dic, cache_type.idc in
(* Arm ARM: CTR_EL0.DIC/IDC are common within an Inner Shareable domain. *)
begin match forall_procs test needs_dic, forall_procs test needs_idc with
| Some dic, Some idc ->
O.fi "if (!check_dic_idc(%d, %d)) return 0;"
(if dic then 1 else 0)
(if idc then 1 else 0)
| _ -> ()
end
end ;
if Cfg.is_kvm then begin
match db with
| None ->
Expand Down
2 changes: 1 addition & 1 deletion litmus/skel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ module Make
(fun _ -> false), (fun _ -> false)
| Some cache_type ->
cache_type.dic, cache_type.idc in
O.fi "check_dic_idc(%d, %d);"
O.fi "if (!check_dic_idc(%d, %d)) return NULL;"
(if needs_dic proc then 1 else 0)
(if needs_idc proc then 1 else 0)
end ;
Expand Down
Loading