diff options
author | Will Deacon <will.deacon@arm.com> | 2017-10-24 12:22:47 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-12-17 13:57:01 +0100 |
commit | c2bc66082e1048c7573d72e62f597bdc5ce13fea (patch) | |
tree | 6f2e6ad4fb90064a5b862a7591584ed5aa7884cf /include | |
parent | bpf: fix build issues on um due to mising bpf_perf_event.h (diff) | |
download | linux-c2bc66082e1048c7573d72e62f597bdc5ce13fea.tar.xz linux-c2bc66082e1048c7573d72e62f597bdc5ce13fea.zip |
locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
[ Note, this is a Git cherry-pick of the following commit:
76ebbe78f739 ("locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()")
... for easier x86 PTI code testing and back-porting. ]
In preparation for the removal of lockless_dereference(), which is the
same as READ_ONCE() on all architectures other than Alpha, add an
implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
used to head dependency chains on all architectures.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1508840570-22169-3-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/compiler.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 202710420d6d..712cd8bb00b4 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -341,6 +341,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s __read_once_size(&(x), __u.__c, sizeof(x)); \ else \ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ + smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \ __u.__val; \ }) #define READ_ONCE(x) __READ_ONCE(x, 1) |