From patchwork Wed Sep 6 17:36:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9941137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51F5C602CC for ; Wed, 6 Sep 2017 17:38:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E8F328BA6 for ; Wed, 6 Sep 2017 17:38:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3343F28C02; Wed, 6 Sep 2017 17:38:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2ECC28BA6 for ; Wed, 6 Sep 2017 17:38:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpeFd-0000hd-Dt; Wed, 06 Sep 2017 17:36:33 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpeFb-0000hB-ES for xen-devel@lists.xenproject.org; Wed, 06 Sep 2017 17:36:31 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 36/D8-03423-E1230B95; Wed, 06 Sep 2017 17:36:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVyuP0Ov66c0YZ Ig+6zghbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8amVf9ZCxo4Kr51XGVrYHzN1sXIySEhYCTx duI/pi5GLg4hgYWMEvuWrwJLsAmoSmy4fooVxBYRqJM4uPwQM0gRs8AvRolLB3cwgSSEBewlp pzbwAJiswA1/OqcAGbzCphILFnYwQ6xQV6i48BksDingKnE434IWwio5vj366wTGLkXMDKsYl QvTi0qSy3SNdZLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAj0LwMQ7GDs+Od0iFG Sg0lJlPey2vpIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8hgYbIoUEi1LTUyvSMnOAgQaTluDg URLhbQRJ8xYXJOYWZ6ZDpE4x6nJ03Lz7h0mIJS8/L1VKnLcapEgApCijNA9uBCzoLzHKSgnzM gIdJcRTkFqUm1mCKv+KUZyDUUmYdyHIFJ7MvBK4Ta+AjmACOqLq5RqQI0oSEVJSDYyl1cWGbl m3j3vunJzftPZv2YkvHy/p/xMLeHq1bMGKs06LkzYqTbWevajqddYKbq7GTfdPH1z5liE+6lK heCrfMpXX193ultx4/feH5emDPtYTTWRm3916f7Wnab3hs4v6ld8cl/EqOe7tOJW2srJagaM3 YmM244dbfv9nv4ySWXNr41alw6x9SizFGYmGWsxFxYkADuy2gnUCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-5.tower-27.messagelabs.com!1504719390!109963174!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3519 invoked from network); 6 Sep 2017 17:36:30 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-5.tower-27.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 6 Sep 2017 17:36:30 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1DCB5AE79; Wed, 6 Sep 2017 17:36:30 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org Date: Wed, 6 Sep 2017 19:36:25 +0200 Message-Id: <20170906173625.18158-3-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170906173625.18158-1-jgross@suse.com> References: <20170906173625.18158-1-jgross@suse.com> Cc: Juergen Gross , jeremy@goop.org, peterz@infradead.org, rusty@rustcorp.com.au, chrisw@sous-sol.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, longman@redhat.com, akataria@vmware.com, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v3 2/2] paravirt, xen: correct xen_nopvspin case X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #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");