mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	Since commit:
  b899a85043 ("compiler.h: Remove ACCESS_ONCE()")
... there has been no definition of ACCESS_ONCE() in the kernel tree,
and it has been necessary to use READ_ONCE() or WRITE_ONCE() instead.
Correspondingly, let's remove ACCESS_ONCE() from the kernel memory
model.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Akira Yokosawa <akiyks@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jade Alglave <j.alglave@ucl.ac.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luc Maranget <luc.maranget@inria.fr>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arch@vger.kernel.org
Cc: parri.andrea@gmail.com
Link: http://lkml.kernel.org/r/20180716180605.16115-6-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
		
	
			
		
			
				
	
	
		
			52 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
// SPDX-License-Identifier: GPL-2.0+
 | 
						|
(*
 | 
						|
 * Copyright (C) 2015 Jade Alglave <j.alglave@ucl.ac.uk>,
 | 
						|
 * Copyright (C) 2016 Luc Maranget <luc.maranget@inria.fr> for Inria
 | 
						|
 * Copyright (C) 2017 Alan Stern <stern@rowland.harvard.edu>,
 | 
						|
 *                    Andrea Parri <parri.andrea@gmail.com>
 | 
						|
 *
 | 
						|
 * An earlier version of this file appeared in the companion webpage for
 | 
						|
 * "Frightening small children and disconcerting grown-ups: Concurrency
 | 
						|
 * in the Linux kernel" by Alglave, Maranget, McKenney, Parri, and Stern,
 | 
						|
 * which appeared in ASPLOS 2018.
 | 
						|
 *)
 | 
						|
 | 
						|
"Linux-kernel memory consistency model"
 | 
						|
 | 
						|
enum Accesses = 'once (*READ_ONCE,WRITE_ONCE*) ||
 | 
						|
		'release (*smp_store_release*) ||
 | 
						|
		'acquire (*smp_load_acquire*) ||
 | 
						|
		'noreturn (* R of non-return RMW *)
 | 
						|
instructions R[{'once,'acquire,'noreturn}]
 | 
						|
instructions W[{'once,'release}]
 | 
						|
instructions RMW[{'once,'acquire,'release}]
 | 
						|
 | 
						|
enum Barriers = 'wmb (*smp_wmb*) ||
 | 
						|
		'rmb (*smp_rmb*) ||
 | 
						|
		'mb (*smp_mb*) ||
 | 
						|
		'rcu-lock (*rcu_read_lock*)  ||
 | 
						|
		'rcu-unlock (*rcu_read_unlock*) ||
 | 
						|
		'sync-rcu (*synchronize_rcu*) ||
 | 
						|
		'before-atomic (*smp_mb__before_atomic*) ||
 | 
						|
		'after-atomic (*smp_mb__after_atomic*) ||
 | 
						|
		'after-spinlock (*smp_mb__after_spinlock*)
 | 
						|
instructions F[Barriers]
 | 
						|
 | 
						|
(* Compute matching pairs of nested Rcu-lock and Rcu-unlock *)
 | 
						|
let matched = let rec
 | 
						|
	    unmatched-locks = Rcu-lock \ domain(matched)
 | 
						|
	and unmatched-unlocks = Rcu-unlock \ range(matched)
 | 
						|
	and unmatched = unmatched-locks | unmatched-unlocks
 | 
						|
	and unmatched-po = [unmatched] ; po ; [unmatched]
 | 
						|
	and unmatched-locks-to-unlocks =
 | 
						|
		[unmatched-locks] ; po ; [unmatched-unlocks]
 | 
						|
	and matched = matched | (unmatched-locks-to-unlocks \
 | 
						|
		(unmatched-po ; unmatched-po))
 | 
						|
	in matched
 | 
						|
 | 
						|
(* Validate nesting *)
 | 
						|
flag ~empty Rcu-lock \ domain(matched) as unbalanced-rcu-locking
 | 
						|
flag ~empty Rcu-unlock \ range(matched) as unbalanced-rcu-locking
 | 
						|
 | 
						|
(* Outermost level of nesting only *)
 | 
						|
let crit = matched \ (po^-1 ; matched ; po^-1)
 |