[herd] Fix non explicit atomic pairs#1876
Conversation
|
|
||
| let make_atomic_load_store es = | ||
| let atms,spurious = U.collect_atomics es in | ||
| let make_atomic_load_store _test es = |
There was a problem hiding this comment.
Why do we need _test here?
There was a problem hiding this comment.
I used the test argument to display some graphs. We can remove it now.
We compute non-explicit atomic pairs as the restriction of `iico_data` from non-explict atomic reads to non-explicit atomic writes We here rely on the assumption that *all* atonic pairs of non-explicit accesses result from page table updates.
bc3db54 to
a481c0c
Compare
|
Thanks for this Luc, I will try to have a look at the code as soon as possible. I have a high level question. We discussed this with Hadrien as well, why can't we get this information from the instruction semantics? I understand why we can't do that for exclusives, but for atomic instructions (for example, CAS, SWP) and for atomic hardware updates, we know that the Memory Read Effect and the Memory Write Effect need to be paired together from the instruction semantics. Rather than searching through the list of Effect to find pairs of Effects that satisfy certain conditions, wouldn't it be preferable to retain that information from the instruction semantics? |
I guess the process has been as follows: we first have implemented exclusives first (for Power) and then generalised without thinking of a different solution. The case of AArch64+ASL is also to be considered. |
I think the case of AArch64+ASL is easy enough: we could run this algorithm, or implement it in |
I agree and longer term ASL will provide the means to identify pairs of Memory Read and Memory Write Effects that are intended to be atomic. @maranget for Power and other architecture, is exclusives the only concern or is there support for atomics as well. Otherwise, it might be simple to do this hybrid approach, for atomic instructions and hardware updates we use the instruction semantics and for exclusives we use a version of this code. |
Nice, we can implement rmw as
|
|
Additonally, I am a bit concerned by the added complexity of an hybrid approach. Don't you think that an "all cat" or an "all mem.ml" approach would be more easy to maintain? |
|
And to answer one of your questions : ARM -> exclusives, LISA -> amo, BPF -> amo, C -> amo, Java -> amo, MIPS -> exclusives, PPC -> exclusives, RISCV -> exclusives,amo, X86_64 -> amo, X86 -> amo. |
herdtools7/herd/machModelChecker.ml Line 440 in 161ed8e let lxsx = rmw \ amo. I am not understand the suggestion.
agreed. |
|
I meant that amo an lxsx can be computed directly from the event sets EXCL and X as you do here. That is: To that aim we have to define EXCL and X for all architectures. |
This is one possibility. At least this is how we could do it for AArch64+ASL. Another possibility (which might be what Nikos was talking about) would be to have the instruction semantics define |
|
In any case we need support for the At the moment. herd7 allows the test because it consider that |
Should we still go ahead with this PR or do you think this is blocking? |
|
Superseded by PR #1889? |
|
Superseded by PR #1889. |
Compute
rmwon non-explicit memory accesses fromiico_data