locking/paravirt: Use new static key for controlling call of virt_spin_lock()
authorJuergen Gross <jgross@suse.com>
Wed, 6 Sep 2017 17:36:24 +0000 (19:36 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 10 Oct 2017 09:50:12 +0000 (11:50 +0200)
commit9043442b43b1fddf202591b84702863286700c1a
tree705f0e7893ff4f54d07fdd0374e46f5fa0773c1a
parentaf1a34f21150af199f066dfcccbae9830c9429aa
locking/paravirt: Use new static key for controlling call of virt_spin_lock()

There are cases where a guest tries to switch spinlocks to bare metal
behavior (e.g. by setting "xen_nopvspin" boot parameter). Today this
has the downside of falling back to unfair test and set scheme for
qspinlocks due to virt_spin_lock() detecting the virtualized
environment.

Add a static key controlling whether virt_spin_lock() should be
called or not. When running on bare metal set the new key to false.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akataria@vmware.com
Cc: boris.ostrovsky@oracle.com
Cc: chrisw@sous-sol.org
Cc: hpa@zytor.com
Cc: jeremy@goop.org
Cc: rusty@rustcorp.com.au
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170906173625.18158-2-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/qspinlock.h
arch/x86/kernel/paravirt.c
arch/x86/kernel/smpboot.c