x86/qspinlock, kcsan: Instrument barrier of pv_queued_spin_unlock()
authorMarco Elver <elver@google.com>
Tue, 30 Nov 2021 11:44:27 +0000 (12:44 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 10 Dec 2021 00:42:28 +0000 (16:42 -0800)
If CONFIG_PARAVIRT_SPINLOCKS=y, queued_spin_unlock() is implemented
using pv_queued_spin_unlock() which is entirely inline asm based. As
such, we do not receive any KCSAN barrier instrumentation via regular
atomic operations.

Add the missing KCSAN barrier instrumentation for the
CONFIG_PARAVIRT_SPINLOCKS case.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
arch/x86/include/asm/qspinlock.h

index d86ab942219c4277385cc256bbcf4794f38a80df..d87451df480bd783b3fc352c57cd1e64a9de291e 100644 (file)
@@ -53,6 +53,7 @@ static inline void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
 
 static inline void queued_spin_unlock(struct qspinlock *lock)
 {
+       kcsan_release();
        pv_queued_spin_unlock(lock);
 }