From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756422AbdJJLHZ (ORCPT ); Tue, 10 Oct 2017 07:07:25 -0400 Received: from terminus.zytor.com ([65.50.211.136]:38173 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756242AbdJJLHX (ORCPT ); Tue, 10 Oct 2017 07:07:23 -0400 Date: Tue, 10 Oct 2017 04:03:32 -0700 From: tip-bot for Juergen Gross Message-ID: 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 Reply-To: longman@redhat.com, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, hpa@zytor.com, peterz@infradead.org, jgross@suse.com, linux-kernel@vger.kernel.org In-Reply-To: <20170906173625.18158-3-jgross@suse.com> References: <20170906173625.18158-3-jgross@suse.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/spinlocks, paravirt, xen: Correct the xen_nopvspin case Git-Commit-ID: e6fd28eb3522b31f79a938e24674f77268a120fd X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e6fd28eb3522b31f79a938e24674f77268a120fd Gitweb: https://git.kernel.org/tip/e6fd28eb3522b31f79a938e24674f77268a120fd Author: Juergen Gross AuthorDate: Wed, 6 Sep 2017 19:36:25 +0200 Committer: Ingo Molnar 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 Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner 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 --- 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 #include +#include #include #include @@ -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");