aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spinlock.h
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2021-11-30 12:44:22 +0100
committerPaul E. McKenney <paulmck@kernel.org>2021-12-09 16:42:27 -0800
commitf948666de517cf8ebef7cb2c9b2d669dec4bfe2e (patch)
tree2f8b8e12d5111fc08ce67245e75dee3ddb76eb3a /include/linux/spinlock.h
parentkcsan: selftest: Add test case to check memory barrier instrumentation (diff)
downloadlinux-dev-f948666de517cf8ebef7cb2c9b2d669dec4bfe2e.tar.xz
linux-dev-f948666de517cf8ebef7cb2c9b2d669dec4bfe2e.zip
locking/barriers, kcsan: Add instrumentation for barriers
Adds the required KCSAN instrumentation for barriers if CONFIG_SMP. KCSAN supports modeling the effects of: smp_mb() smp_rmb() smp_wmb() smp_store_release() Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r--include/linux/spinlock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index b4e5ca23f840..5c0c5174155d 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -171,7 +171,7 @@ do { \
* Architectures that can implement ACQUIRE better need to take care.
*/
#ifndef smp_mb__after_spinlock
-#define smp_mb__after_spinlock() do { } while (0)
+#define smp_mb__after_spinlock() kcsan_mb()
#endif
#ifdef CONFIG_DEBUG_SPINLOCK