Commit e3f360db authored by Heiko Carstens's avatar Heiko Carstens

s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()

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: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 82d3edb5
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
pcp_op_T__ *ptr__; \ pcp_op_T__ *ptr__; \
preempt_disable_notrace(); \ preempt_disable_notrace(); \
ptr__ = raw_cpu_ptr(&(pcp)); \ ptr__ = raw_cpu_ptr(&(pcp)); \
prev__ = *ptr__; \ prev__ = READ_ONCE(*ptr__); \
do { \ do { \
old__ = prev__; \ old__ = prev__; \
new__ = old__ op (val); \ new__ = old__ op (val); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment