-
Notifications
You must be signed in to change notification settings - Fork 94
[litmus] Introduce ExS, EIS and EOS variants #1716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| AArch64 SVC-ifetch.dic0idc0-exs1eis0.litmus | ||
| variant=ifetch,exs | ||
| { | ||
| 0:X0=instr:"NOP"; 0:X1=P0:L2; | ||
| } | ||
| P0 | P0.F ; | ||
| STR W0,[X1] | ERET ; | ||
| DC CVAU, X1 |; | ||
| DSB ISH |; | ||
| IC IVAU, X1 |; | ||
| DSB ISH |; | ||
| SVC #0 |; | ||
| L2: |; | ||
| B L1 |; | ||
| MOV W9,#1 |; | ||
| L1: |; | ||
|
|
||
| exists(0:X9=0) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| AArch64 SVC-ifetch.dic0idc0-exs1eis1 | ||
| variant=ifetch,exs,eis | ||
| { | ||
| 0:X0=instr:"NOP"; 0:X1=P0:L2; | ||
| } | ||
| P0 | P0.F ; | ||
| STR W0,[X1] | ERET ; | ||
| DC CVAU, X1 |; | ||
| DSB ISH |; | ||
| IC IVAU, X1 |; | ||
| DSB ISH |; | ||
| SVC #0 |; | ||
| L2: |; | ||
| B L1 |; | ||
| MOV W9,#1 |; | ||
| L1: |; | ||
|
|
||
| exists(0:X9=0) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /****************************************************************************/ | ||
| /* the diy toolsuite */ | ||
| /* */ | ||
| /* Jade Alglave, University College London, UK. */ | ||
| /* Luc Maranget, INRIA Paris-Rocquencourt, France. */ | ||
| /* */ | ||
| /* Copyright 2026-present Institut National de Recherche en Informatique et */ | ||
| /* en Automatique and the authors. All rights reserved. */ | ||
| /* */ | ||
| /* This software is governed by the CeCILL-B license under French law and */ | ||
| /* abiding by the rules of distribution of free software. You can use, */ | ||
| /* modify and/ or redistribute the software under the terms of the CeCILL-B */ | ||
| /* license as circulated by CEA, CNRS and INRIA at the following URL */ | ||
| /* "http://www.cecill.info". We also give a copy in LICENSE.txt. */ | ||
| /****************************************************************************/ | ||
| #include "kvm-headers.h" | ||
| #include "exs.h" | ||
|
|
||
| #define MMFR0_EXS_SHIFT 44 | ||
| #define MMFR0_EXS_MASK 0xf | ||
|
|
||
| int check_exs(const char *tname) { | ||
| uint64_t mmfr0; | ||
| asm volatile("mrs %0, ID_AA64MMFR0_EL1" : "=r" (mmfr0)); | ||
| int exs = (mmfr0 >> MMFR0_EXS_SHIFT) & MMFR0_EXS_MASK; | ||
| if (exs == 0) { | ||
| printf("Test %s, ExS not supported on this system\n", tname); | ||
| return 0; | ||
| } | ||
| return 1; | ||
| } | ||
|
|
||
| void init_exs(int eis_val, int eos_val) { | ||
| uint64_t sctlr; | ||
| asm volatile("mrs %0, SCTLR_EL1" : "=r" (sctlr)); | ||
| sctlr = eis_val ? (sctlr | SCTLR_EL1_EIS) : (sctlr & ~SCTLR_EL1_EIS); | ||
| sctlr = eos_val ? (sctlr | SCTLR_EL1_EOS) : (sctlr & ~SCTLR_EL1_EOS); | ||
| asm volatile("msr SCTLR_EL1, %0" :: "r" (sctlr)); | ||
| asm volatile("isb"); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /****************************************************************************/ | ||
| /* the diy toolsuite */ | ||
| /* */ | ||
| /* Jade Alglave, University College London, UK. */ | ||
| /* Luc Maranget, INRIA Paris-Rocquencourt, France. */ | ||
| /* */ | ||
| /* Copyright 2026-present Institut National de Recherche en Informatique et */ | ||
| /* en Automatique and the authors. All rights reserved. */ | ||
| /* */ | ||
| /* This software is governed by the CeCILL-B license under French law and */ | ||
| /* abiding by the rules of distribution of free software. You can use, */ | ||
| /* modify and/ or redistribute the software under the terms of the CeCILL-B */ | ||
| /* license as circulated by CEA, CNRS and INRIA at the following URL */ | ||
| /* "http://www.cecill.info". We also give a copy in LICENSE.txt. */ | ||
| /****************************************************************************/ | ||
| #ifndef _LITMUS_EXS_H | ||
| #define _LITMUS_EXS_H 1 | ||
|
|
||
| int check_exs(const char *tname); | ||
| void init_exs(int eis_val, int eos_val); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,11 @@ module Make | |
| if Cfg.variant Variant_litmus.ConstPacField && not (Cfg.variant Variant_litmus.Pac) then | ||
| Warn.user_error "\"const-pac-field\" variant require \"pac\" variant" | ||
|
|
||
| let () = | ||
| if (Cfg.variant Variant_litmus.EIS || Cfg.variant Variant_litmus.EOS) | ||
| && not (Cfg.variant Variant_litmus.ExS) then | ||
| Warn.user_error "\"eis\"/\"eos\" variants require \"exs\" variant" | ||
|
|
||
| module Insert = | ||
| ObjUtil.Insert | ||
| (struct | ||
|
|
@@ -271,6 +276,9 @@ module Make | |
| if Cfg.variant Variant_litmus.MemTag then begin | ||
| O.o "#include \"memtag.h\"" | ||
| end; | ||
| if Cfg.variant Variant_litmus.ExS then begin | ||
| O.o "#include \"exs.h\"" | ||
| end; | ||
| if Cfg.variant Variant_litmus.Pac then begin | ||
| O.o "#include \"auth.h\"" | ||
| end; | ||
|
|
@@ -2256,6 +2264,14 @@ module Make | |
| in | ||
| O.fi "mte_init(%s);" (pp_tag_check Cfg.tagcheck); | ||
| end; | ||
| if Cfg.variant Variant_litmus.ExS then | ||
| begin | ||
| let eis_val = | ||
| if Cfg.variant Variant_litmus.EIS then 1 else 0 in | ||
| let eos_val = | ||
| if Cfg.variant Variant_litmus.EOS then 1 else 0 in | ||
| O.fi "init_exs(%d, %d);" eis_val eos_val; | ||
| end; | ||
| if Cfg.variant Variant_litmus.Pac then | ||
| O.oi "init_pauth();" ; | ||
| O.oi "int id = smp_processor_id();" ; | ||
|
|
@@ -2424,6 +2440,8 @@ module Make | |
| end ; | ||
| if Cfg.variant Variant_litmus.ConstPacField then | ||
| 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 ; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps you could also move the eis and eos handling here as well?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have followed the split between
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Unrelated to the PR. Perhaps MTE would benefit from the similar check/use split... |
||
| if Cfg.is_kvm then begin | ||
| match db with | ||
| | None -> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.