1 From a6b277857fd2c990bc208ca1958d3f34d26052f7 Mon Sep 17 00:00:00 2001
2 From: Peter Zijlstra <peterz@infradead.org>
3 Date: Sat, 5 Sep 2015 16:55:05 +0200
4 Subject: locking/qspinlock/x86: Only emit the test-and-set fallback when building guest support
6 From: Peter Zijlstra <peterz@infradead.org>
8 commit a6b277857fd2c990bc208ca1958d3f34d26052f7 upstream.
10 Only emit the test-and-set fallback for Hypervisors lacking
11 PARAVIRT_SPINLOCKS support when building for guests.
13 Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
14 Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
15 Cc: Peter Zijlstra <peterz@infradead.org>
16 Cc: Thomas Gleixner <tglx@linutronix.de>
17 Cc: linux-kernel@vger.kernel.org
18 Signed-off-by: Ingo Molnar <mingo@kernel.org>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h
22 index 8dde3bdc4a05..eaba08076030 100644
23 --- a/arch/x86/include/asm/qspinlock.h
24 +++ b/arch/x86/include/asm/qspinlock.h
25 @@ -39,8 +39,8 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
29 +#ifdef CONFIG_PARAVIRT
30 #define virt_spin_lock virt_spin_lock
32 static inline bool virt_spin_lock(struct qspinlock *lock)
34 if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
35 @@ -59,6 +59,7 @@ static inline bool virt_spin_lock(struct qspinlock *lock)
39 +#endif /* CONFIG_PARAVIRT */
41 #include <asm-generic/qspinlock.h>