From patchwork Tue Mar 14 17:35:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 9624031 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 C52C0604CC for ; Tue, 14 Mar 2017 17:38:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B886D20564 for ; Tue, 14 Mar 2017 17:38:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD2B728503; Tue, 14 Mar 2017 17:38:22 +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 0050A20564 for ; Tue, 14 Mar 2017 17:38:20 +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 1cnqMf-00011D-Ot; Tue, 14 Mar 2017 17:36:05 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnqMf-00010u-12 for xen-devel@lists.xenproject.org; Tue, 14 Mar 2017 17:36:05 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 5B/3A-01936-40A28C85; Tue, 14 Mar 2017 17:36:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKLMWRWlGSWpSXmKPExsVysWW7jC6z1ok Ig49nDC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozO6dtYCl6IVjT9WsrUwLhVqIuRi0NIYDeT xN6ZbSwQzhFGiSszJjF2MXJysAnoSHx/eooZxBYRUJK4t2oyE0gRs8AmRokHrafZQRLCAq4St 9rmsoLYLAKqEsf/94A18wqYS0yYfYYNxOYUsJDYOeUYC4gtBBR/fW4bWI2EgLbEqY3f2UGGSg j0MUp8O72TdQIjzwJGhlWMGsWpRWWpRbpGFnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXr J+bmbGIHer2dgYNzB2LfK7xCjJAeTkiiviuCJCCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvCUa QDnBotT01Iq0zBxgGMKkJTh4lER4s0HSvMUFibnFmekQqVOMilLivNEgCQGQREZpHlwbLPQvM cpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLm/QsyhSczrwRu+iugxUxAixN/HgFZXJKIkJJqYO yz6TdodmaW51vkM3lVqXO9p+zn717qLzfsOHDz5+sQ1pAK3lmneip5QqaKBjhNbbQ90LA43uh dToGEsKHe1lC/8Nf9t3UYOuK4xW6/6PrUkn2uInBqzhapPQsVtsUUcQbyN0256n/KQ+tX9pMF y07de9rM4fVo05ZstdmBNpGah48//rjGWImlOCPRUIu5qDgRACRosBl4AgAA X-Env-Sender: vkuznets@redhat.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1489512962!85839861!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58224 invoked from network); 14 Mar 2017 17:36:03 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Mar 2017 17:36:03 -0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB6A43D956; Tue, 14 Mar 2017 17:36:02 +0000 (UTC) Received: from vitty.brq.redhat.com (vitty.brq.redhat.com [10.34.26.3]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EHZvDh016231; Tue, 14 Mar 2017 13:36:01 -0400 From: Vitaly Kuznetsov To: xen-devel@lists.xenproject.org Date: Tue, 14 Mar 2017 18:35:37 +0100 Message-Id: <20170314173556.2249-3-vkuznets@redhat.com> In-Reply-To: <20170314173556.2249-1-vkuznets@redhat.com> References: <20170314173556.2249-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Mar 2017 17:36:03 +0000 (UTC) Cc: Juergen Gross , Boris Ostrovsky , x86@kernel.org, Andrew Jones , linux-kernel@vger.kernel.org Subject: [Xen-devel] [PATCH v3 02/21] x86/xen: globalize have_vcpu_info_placement 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 have_vcpu_info_placement applies to both PV and HVM and as we're going to split the code we need to make it global. Rename to xen_have_vcpu_info_placement. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/enlighten.c | 12 ++++++------ arch/x86/xen/xen-ops.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 999ba13..f0784a6 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -164,7 +164,7 @@ struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info; * * 0: not available, 1: available */ -static int have_vcpu_info_placement = 1; +int xen_have_vcpu_info_placement = 1; struct tls_descs { struct desc_struct desc[3]; @@ -228,7 +228,7 @@ void xen_vcpu_setup(int cpu) per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)]; - if (!have_vcpu_info_placement) { + if (!xen_have_vcpu_info_placement) { if (cpu >= MAX_VIRT_CPUS) clamp_max_cpus(); return; @@ -251,7 +251,7 @@ void xen_vcpu_setup(int cpu) if (err) { printk(KERN_DEBUG "register_vcpu_info failed: err=%d\n", err); - have_vcpu_info_placement = 0; + xen_have_vcpu_info_placement = 0; clamp_max_cpus(); } else { /* This cpu is using the registered vcpu info, even if @@ -280,7 +280,7 @@ void xen_vcpu_restore(void) xen_setup_runstate_info(cpu); - if (have_vcpu_info_placement) + if (xen_have_vcpu_info_placement) xen_vcpu_setup(cpu); if (other_cpu && is_up && @@ -1159,7 +1159,7 @@ void xen_setup_vcpu_info_placement(void) * xen_vcpu_setup managed to place the vcpu_info within the * percpu area for all cpus, so make use of it. */ - if (have_vcpu_info_placement) { + if (xen_have_vcpu_info_placement) { pv_irq_ops.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct); pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(xen_restore_fl_direct); pv_irq_ops.irq_disable = __PV_IS_CALLEE_SAVE(xen_irq_disable_direct); @@ -1178,7 +1178,7 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf, #define SITE(op, x) \ case PARAVIRT_PATCH(op.x): \ - if (have_vcpu_info_placement) { \ + if (xen_have_vcpu_info_placement) { \ start = (char *)xen_##x##_direct; \ end = xen_##x##_direct_end; \ reloc = xen_##x##_direct_reloc; \ diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index f6a41c4..2b162f6 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -76,6 +76,8 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id); bool xen_vcpu_stolen(int vcpu); +extern int xen_have_vcpu_info_placement; + void xen_vcpu_setup(int cpu); void xen_setup_vcpu_info_placement(void);