Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727662
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Juergen Gross <jgross@suse.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/2] paravirt,xen: correct xen_nopvspin case |
| Date | Wed, 06 Sep 2017 19:40:01 +0200 |
| Message-ID | <umMsV-4XV-5@gated-at.bofh.it> (permalink) |
| References | <umMsV-4XV-3@gated-at.bofh.it> |
| X-Original-To | linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org |
| X-Mailer | git-send-email 2.12.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | jeremy@goop.org, chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au, boris.ostrovsky@oracle.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, longman@redhat.com, Juergen Gross <jgross@suse.com> |
| X-Original-Date | Wed, 6 Sep 2017 19:36:25 +0200 |
| X-Original-Message-ID | <20170906173625.18158-3-jgross@suse.com> |
| X-Original-References | <20170906173625.18158-1-jgross@suse.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1727662 |
Show key headers only | View raw
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@suse.com>
---
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 25a7c4302ce7..e8ab80ad7a6f 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");
--
2.12.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/2] guard virt_spin_lock() with a static key Juergen Gross <jgross@suse.com> - 2017-09-06 19:40 +0200 [PATCH v3 2/2] paravirt,xen: correct xen_nopvspin case Juergen Gross <jgross@suse.com> - 2017-09-06 19:40 +0200 [PATCH v3 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock() Juergen Gross <jgross@suse.com> - 2017-09-06 19:40 +0200
csiph-web