summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-01-09 13:51:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:44:54 +0300
commit51dbedee2ff3b000c9905189e33e1972b6c9f649 (patch)
tree22d435a666edb7f85d9b594ff7fb04bdc803c78c
parentbddb355267849423306cc9dc313783303dd19f03 (diff)
downloadlinux-51dbedee2ff3b000c9905189e33e1972b6c9f649.tar.xz
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
commit e3f360db08d55a14112bd27454e616a24296a8b0 upstream. Make sure that *ptr__ within arch_this_cpu_to_op_simple() is only dereferenced once by using READ_ONCE(). Otherwise the compiler could generate incorrect code. Cc: <stable@vger.kernel.org> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/s390/include/asm/percpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
index 918f0ba4f4d2..5e26e2c4641b 100644
--- a/arch/s390/include/asm/percpu.h
+++ b/arch/s390/include/asm/percpu.h
@@ -31,7 +31,7 @@
pcp_op_T__ *ptr__; \
preempt_disable_notrace(); \
ptr__ = raw_cpu_ptr(&(pcp)); \
- prev__ = *ptr__; \
+ prev__ = READ_ONCE(*ptr__); \
do { \
old__ = prev__; \
new__ = old__ op (val); \