tools/memory-model: Switch to softcoded herd7 tags
A new version of herd7 provides a -lkmmv2 switch which overrides the old herd7 behavior of simply ignoring any softcoded tags in the .def and .bell files. We port LKMM to this version of herd7 by providing the switch in linux-kernel.cfg and reporting an error if the LKMM is used without this switch. To preserve the semantics of LKMM, we also softcode the Noreturn tag on atomic RMW which do not return a value and define atomic_add_unless with an Mb tag in linux-kernel.def. We update the herd-representation.txt accordingly and clarify some of the resulting combinations. Co-developed-by: Hernan Ponce de Leon <hernan.poncedeleon@huaweicloud.com> Signed-off-by: Hernan Ponce de Leon <hernan.poncedeleon@huaweicloud.com> Signed-off-by: Jonas Oberhauser <jonas.oberhauser@huaweicloud.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Tested-by: Boqun Feng <boqun.feng@gmail.com> Tested-by: Akira Yokosawa <akiyks@gmail.com> # herdtools7.7.58
This commit is contained in:
committed by
Paul E. McKenney
parent
29279349a5
commit
fafa180683
@@ -63,14 +63,14 @@ atomic_set(X,V) { WRITE_ONCE(*X,V); }
|
||||
atomic_read_acquire(X) smp_load_acquire(X)
|
||||
atomic_set_release(X,V) { smp_store_release(X,V); }
|
||||
|
||||
atomic_add(V,X) { __atomic_op(X,+,V); }
|
||||
atomic_sub(V,X) { __atomic_op(X,-,V); }
|
||||
atomic_and(V,X) { __atomic_op(X,&,V); }
|
||||
atomic_or(V,X) { __atomic_op(X,|,V); }
|
||||
atomic_xor(V,X) { __atomic_op(X,^,V); }
|
||||
atomic_inc(X) { __atomic_op(X,+,1); }
|
||||
atomic_dec(X) { __atomic_op(X,-,1); }
|
||||
atomic_andnot(V,X) { __atomic_op(X,&~,V); }
|
||||
atomic_add(V,X) { __atomic_op{noreturn}(X,+,V); }
|
||||
atomic_sub(V,X) { __atomic_op{noreturn}(X,-,V); }
|
||||
atomic_and(V,X) { __atomic_op{noreturn}(X,&,V); }
|
||||
atomic_or(V,X) { __atomic_op{noreturn}(X,|,V); }
|
||||
atomic_xor(V,X) { __atomic_op{noreturn}(X,^,V); }
|
||||
atomic_inc(X) { __atomic_op{noreturn}(X,+,1); }
|
||||
atomic_dec(X) { __atomic_op{noreturn}(X,-,1); }
|
||||
atomic_andnot(V,X) { __atomic_op{noreturn}(X,&~,V); }
|
||||
|
||||
atomic_add_return(V,X) __atomic_op_return{mb}(X,+,V)
|
||||
atomic_add_return_relaxed(V,X) __atomic_op_return{once}(X,+,V)
|
||||
@@ -144,3 +144,5 @@ atomic_fetch_andnot(V,X) __atomic_fetch_op{mb}(X,&~,V)
|
||||
atomic_fetch_andnot_acquire(V,X) __atomic_fetch_op{acquire}(X,&~,V)
|
||||
atomic_fetch_andnot_release(V,X) __atomic_fetch_op{release}(X,&~,V)
|
||||
atomic_fetch_andnot_relaxed(V,X) __atomic_fetch_op{once}(X,&~,V)
|
||||
|
||||
atomic_add_unless(X,V,W) __atomic_add_unless{mb}(X,V,W)
|
||||
|
||||
Reference in New Issue
Block a user