ArchSemArm: add the acq-rel AMO full-barrier bob clause (UMArm + VMSA22Arm) - #211
Conversation
|
Thank you for the PR! The Coq translation of the explicit-memory part looks right to me. However, could you clarify the statement that the full model’s |
…22Arm)
UMArm and VMSA22Arm track the ESOP'22 Arm model and are missing one clause the
current Arm application-level model has: the forward edge out of an
acquire-release AMO write,
herd/libdir/aarch64hwreqs.cat:135
[range([Exp & R & A]; amo; [Exp & W & L])]; po; [Exp & M | ...]
i.e. the property that an atomic with both acquire and release semantics acts as
a full barrier. This property has been in the Arm model since 2018 -- herd
a6c15616d3f1e6ba53c012a1a536a4404006e06e (Luc Maranget, "herd: Implement atomic
operations ADD and EOR"), originally "po; ([A];amo;[L]); po" -- and was
strengthened to this range(...) forward-edge form in 2022, herd
636b7163c0679c691b8cf9a04623cd3aa1cc0ec3 (PR #322, "Atomics with both acquire
and release semantics currently act as a full barrier", Jade Alglave):
herd/herdtools7@636b716
It was most recently reworded by 003ec3289ca2781e9823c8beb8bd45b6ecef1279
(2025-12, Fault-Effects relaxation). Because UMArm/VMSA22Arm track the ESOP'22
snapshot, they did not have it.
The clause is added identically to UMArm.bob and VMSA22Arm.bob. We take the [M]
(explicit-memory) target, matching the sibling acquire/release bob clauses
[A ∪ Q]; po; [M] and [M]; po; [L], which likewise target [M]. VMSA22Arm does
model Fault effects (Fault_T/Fault_P) and Tag reads, but bob's acquire/release
clauses order only [M]; the full clause's [Imp & Tag & R] / [MMU & FAULT] targets
are ordered by other ob components (obfault, tob, obtlbi, ...), not by bob.
Keeping the two bob definitions in sync preserves VMUMEquivThm.UM_to_VMSA_bob
(VMSA.bob = UM.bob), so the whole of ArchSemArm still builds.
0d0d829 to
39ffc80
Compare
|
Thanks! You're right, and I've fixed it. VMSA22Arm does model Fault effects (Fault_T/Fault_P) and Tag reads — the "do not occur" wording was inaccurate. The actual reason for the I've corrected the commit message and added a code comment to both bobs spelling this out (and noting explicitly that VMSA22Arm does model faults, just ordered elsewhere). Happy to instead use the full |
|
Thank you for the clarification! A simpler comment would be suffice, but I think the code looks right. |
|
Thank you for this fix! I would be happy to talk by email or over a video call about the status of this model, and what use case you have in mind for it. The gist is that our only use case for this model so far was to support the proof relating it to the ESOP22 VMSA model. Therefore, I suspect it is slightly out of sync with the official herd model and probably some other small fixes are needed. We or you could do them depending on what you need this model for |
|
@tperami thanks, and yes — happy to talk by email or a call. The use case is the proof in #212: an optimization in the OCaml runtime (runtime/memory.c) that drops the two I only depend on this one clause for the proof, so I don't need the whole model brought fully in sync with herd. I did keep UMArm.bob and VMSA22Arm.bob identical so VMUMEquivThm.UM_to_VMSA_bob still holds. |
UMArm and VMSA22Arm track the ESOP'22 Arm model and are missing one clause the current Arm application-level model has: the forward edge out of an acquire-release AMO write,
herd/libdir/aarch64hwreqs.cat:135
i.e. the property that an atomic with both acquire and release semantics acts as a full barrier. This property has been in the Arm model since 2018 -- herd herd/herdtools7@a6c1561 (Luc Maranget, "herd: Implement atomic operations ADD and EOR"), originally
po; ([A];amo;[L]); po-- and was strengthened to thisrange(...)forward-edge form in 2022, herd/herdtools7@636b716 (PR #322, "Atomics with both acquire and release semantics currently act as a full barrier", Jade Alglave). It was most recently reworded in 2025-12 by herd/herdtools7@003ec32 (Fault-Effects relaxation).The clause is added identically to UMArm.bob and VMSA22Arm.bob (user-mode projection: target [M]; the full model's
[Imp & Tag & R] / [MMU & FAULT]targets do not occur in these models). Keeping the two bob definitions in sync preserves VMUMEquivThm.UM_to_VMSA_bob (VMSA.bob = UM.bob), so the whole of ArchSemArm still builds.