From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbdIENZH (ORCPT ); Tue, 5 Sep 2017 09:25:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:50229 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750805AbdIENYx (ORCPT ); Tue, 5 Sep 2017 09:24:53 -0400 From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org 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 Subject: [PATCH 4/4] paravirt,xen: correct xen_nopvspin case Date: Tue, 5 Sep 2017 15:24:44 +0200 Message-Id: <20170905132444.7163-5-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170905132444.7163-1-jgross@suse.com> References: <20170905132444.7163-1-jgross@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 set the virt_spin_lock pvops function to _paravirt_false() in case xen_nopvspin has been specified. Signed-off-by: Juergen Gross --- 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..c01cedfa745d 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -129,6 +129,8 @@ void __init xen_init_spinlocks(void) if (!xen_pvspin) { printk(KERN_DEBUG "xen: PV spinlocks disabled\n"); + pv_lock_ops.virt_spin_lock = + __PV_IS_CALLEE_SAVE(_paravirt_false); return; } printk(KERN_DEBUG "xen: PV spinlocks enabled\n"); -- 2.12.3