From: tip-bot for Juergen Gross <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: torvalds@linux-foundation.org, hpa@zytor.com, mingo@kernel.org,
tglx@linutronix.de, longman@redhat.com, peterz@infradead.org,
jgross@suse.com, linux-kernel@vger.kernel.org
Subject: [tip:locking/core] locking/spinlocks, paravirt, xen: Correct the xen_nopvspin case
Date: Tue, 10 Oct 2017 04:03:32 -0700 [thread overview]
Message-ID: <tip-e6fd28eb3522b31f79a938e24674f77268a120fd@git.kernel.org> (raw)
In-Reply-To: <20170906173625.18158-3-jgross@suse.com>
Commit-ID: e6fd28eb3522b31f79a938e24674f77268a120fd
Gitweb: https://git.kernel.org/tip/e6fd28eb3522b31f79a938e24674f77268a120fd
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Wed, 6 Sep 2017 19:36:25 +0200
Committer: Ingo Molnar <mingo@kernel.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@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-3-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.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");
next prev parent reply other threads:[~2017-10-10 11:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 17:36 [PATCH v3 0/2] guard virt_spin_lock() with a static key Juergen Gross
2017-09-06 17:36 ` [PATCH v3 1/2] paravirt/locks: use new static key for controlling call of virt_spin_lock() Juergen Gross
2017-10-10 11:03 ` [tip:locking/core] locking/paravirt: Use " tip-bot for Juergen Gross
2017-09-06 17:36 ` [PATCH v3 2/2] paravirt,xen: correct xen_nopvspin case Juergen Gross
2017-10-10 11:03 ` tip-bot for Juergen Gross [this message]
2017-09-25 13:59 ` [PATCH v3 0/2] guard virt_spin_lock() with a static key Juergen Gross
2017-09-25 14:44 ` Waiman Long
2017-10-02 14:19 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-e6fd28eb3522b31f79a938e24674f77268a120fd@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox