Skip to content

Commit 2005b6d

Browse files
committed
[litmus] Enable check_dic_idc for presi and kvm modes
1 parent 971d0bb commit 2005b6d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Makefile.aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ litmus-cata-aarch64-VMSA-test-kvm: litmus-aarch64-dep
142142
$(RM) -r $(KUT_DIR_AARCH64)/kvm-unit-tests/t
143143
@ echo "litmus7 in -mode kvm catalogue aarch64-VMSA tests: OK"
144144

145-
litmus-aarch64-run:: litmus-cata-aarch64-ifetch-test-kvm
145+
litmus-aarch64-norun:: litmus-cata-aarch64-ifetch-test-kvm
146146

147147
# Test UDF+2H is not terminating, do not execute it.
148148
# See NORUN below.

litmus/libdir/_aarch64/self.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ inline static void check_dic_idc(int need_dic, int need_idc) {
5050
int idc = (ctr_el0 >> 28) & 1;
5151
int dic = (ctr_el0 >> 29) & 1;
5252
if ((need_dic && !dic) || (need_idc && !idc)) {
53-
fprintf(stderr, "Fatal error: hardware does not support the CacheType "
54-
"feature IDC=%d, DIC=%d\n", need_idc, need_dic);
53+
printf("Required hardware features not available on this system: \n"
54+
"IDC=%d, DIC=%d\n", idc, dic);
5555
exit(0);
5656
}
5757
}

litmus/preSi.ml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,22 @@ module Make
23292329
end ;
23302330
if Cfg.variant Variant_litmus.ConstPacField then
23312331
O.fi "if (!check_const_pac_field_variant(%S)) return 0;" doc.Name.name;
2332+
if do_self then begin
2333+
let cache_type = CacheType.get test.T.info in
2334+
let needs_dic, needs_idc =
2335+
let open CacheType in
2336+
match cache_type with
2337+
| None -> (fun _ -> false), (fun _ -> false)
2338+
| Some cache_type -> cache_type.dic, cache_type.idc in
2339+
(* Arm ARM: CTR_EL0.DIC/IDC are common within an Inner Shareable domain. *)
2340+
begin match forall_procs test needs_dic, forall_procs test needs_idc with
2341+
| Some dic, Some idc ->
2342+
O.fi "check_dic_idc(%d, %d);"
2343+
(if dic then 1 else 0)
2344+
(if idc then 1 else 0)
2345+
| _ -> ()
2346+
end
2347+
end ;
23322348
if Cfg.is_kvm then begin
23332349
match db with
23342350
| None ->

0 commit comments

Comments
 (0)