Skip to content

Commit 723177d

Browse files
Jonas Oberhauserpaulmckrcu
authored andcommitted
tools/memory-model: Define applicable tags on operation in tools/...
Herd7 transforms reads, writes, and read-modify-writes by eliminating 'acquire tags from writes, 'release tags from reads, and 'acquire, 'release, and 'mb tags from failed read-modify-writes. We emulate this behavior by redefining Acquire, Release, and Mb sets in linux-kernel.bell to explicitly exclude those combinations. Herd7 furthermore adds 'noreturn tag to certain reads. Currently herd7 does not allow specifying the 'noreturn tag manually, but such manual declaration (e.g., through a syntax __atomic_op{noreturn}) would add invalid 'noreturn tags to writes; in preparation, we already also exclude this combination. Signed-off-by: Jonas Oberhauser <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Boqun Feng <[email protected]> Tested-by: Boqun Feng <[email protected]>
1 parent de6f997 commit 723177d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/memory-model/linux-kernel.bell

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ enum Barriers = 'wmb (*smp_wmb*) ||
3636
'after-srcu-read-unlock (*smp_mb__after_srcu_read_unlock*)
3737
instructions F[Barriers]
3838

39+
40+
(*
41+
* Filter out syntactic annotations that do not provide the corresponding
42+
* semantic ordering, such as Acquire on a store or Mb on a failed RMW.
43+
*)
44+
let FailedRMW = RMW \ (domain(rmw) | range(rmw))
45+
let Acquire = Acquire \ W \ FailedRMW
46+
let Release = Release \ R \ FailedRMW
47+
let Mb = Mb \ FailedRMW
48+
let Noreturn = Noreturn \ W
49+
3950
(* SRCU *)
4051
enum SRCU = 'srcu-lock || 'srcu-unlock || 'sync-srcu
4152
instructions SRCU[SRCU]

0 commit comments

Comments
 (0)