[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 10 Oct 2017 04:03:32 -0700
From: tip-bot for Juergen Gross <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, hpa@...or.com, mingo@...nel.org,
tglx@...utronix.de, longman@...hat.com, peterz@...radead.org,
jgross@...e.com, linux-kernel@...r.kernel.org
Subject: [tip:locking/core] locking/spinlocks, paravirt, xen: Correct the
xen_nopvspin case
Commit-ID: e6fd28eb3522b31f79a938e24674f77268a120fd
Gitweb: https://git.kernel.org/tip/e6fd28eb3522b31f79a938e24674f77268a120fd
Author: Juergen Gross <jgross@...e.com>
AuthorDate: Wed, 6 Sep 2017 19:36:25 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 10 Oct 2017 11:50:13 +0200
locking/spinlocks, paravirt, xen: Correct the xen_nopvspin case
With the boot parameter "xen_nopvspin" specified a Xen guest should not
make use of paravirt spinlocks, but behave as if running on bare
metal. This is not true, however, as the qspinlock code will fall back
to a test-and-set scheme when it is detecting a hypervisor.
In order to avoid this disable the virt_spin_lock_key.
Signed-off-by: Juergen Gross <jgross@...e.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Waiman Long <longman@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: akataria@...are.com
Cc: boris.ostrovsky@...cle.com
Cc: chrisw@...s-sol.org
Cc: hpa@...or.com
Cc: jeremy@...p.org
Cc: rusty@...tcorp.com.au
Cc: virtualization@...ts.linux-foundation.org
Cc: xen-devel@...ts.xenproject.org
Link: http://lkml.kernel.org/r/20170906173625.18158-3-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/xen/spinlock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index 25a7c43..e8ab80a 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -10,6 +10,7 @@
#include <linux/slab.h>
#include <asm/paravirt.h>
+#include <asm/qspinlock.h>
#include <xen/interface/xen.h>
#include <xen/events.h>
@@ -129,6 +130,7 @@ void __init xen_init_spinlocks(void)
if (!xen_pvspin) {
printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
+ static_branch_disable(&virt_spin_lock_key);
return;
}
printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
Powered by blists - more mailing lists