From patchwork Tue Jun 28 16:47:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 9203627 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 B56636075F for ; Tue, 28 Jun 2016 16:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7510285FD for ; Tue, 28 Jun 2016 16:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BB112860E; Tue, 28 Jun 2016 16:49:44 +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 53E76285FD for ; Tue, 28 Jun 2016 16:49:44 +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 1bHwB5-0003qR-Nz; Tue, 28 Jun 2016 16:47:59 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHwB3-0003on-O4 for xen-devel@lists.xenproject.org; Tue, 28 Jun 2016 16:47:57 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 0D/AD-11548-D3AA2775; Tue, 28 Jun 2016 16:47:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRWlGSWpSXmKPExsVysWW7jK7NqqJ wgwe7pCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owvNy6zFSzmqzh+azd7A2M3TxcjF4eQwE4m ic5P1xkhnCOMElsevWPvYuTkYBPQkfj+9BQziC0ioCRxb9VkJpAiZoEpzBKfN25nBUkIC3hLb J5zmg3EZhFQlbh55TlYnFfASeJV42GwQZwCzhKf27eB2UJA8RMr5oHVSwhoSzy/MJkdZKiEQB +jxPLO44wTGHkWMDKsYlQvTi0qSy3SNdZLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/ dxAj0PQMQ7GDs+Od0iFGSg0lJlPdbb1G4EF9SfkplRmJxRnxRaU5q8SFGGQ4OJQle6ZVAOcGi 1PTUirTMHGAQwqQlOHiURHifrQBK8xYXJOYWZ6ZDpE4xKkqJ854HSQiAJDJK8+DaYIF/iVFWS piXEegQIZ6C1KLczBJU+VeM4hyMSsIQ23ky80rgpr8CWswEtJi1Oh9kcUkiQkqqgXHxsazgv0 vtdvU/2XPijHjCvssr+oqcOPmu3bxQpD3PI3yvzw4FM8MciZS7CpGf6t0+TZ+1KS/2jE74mQ2 f5v2+M01925nYwhWywp8/ftsg9GXLJv8v5Z88f51ea/O95Yvn53MzJFfdnb51Rk7JYRXT61eS Zrqqt1uqFjYq//DrqL27wd/yZs8qJZbijERDLeai4kQA1nCdVncCAAA= X-Env-Sender: vkuznets@redhat.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1467132475!20772498!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: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1226 invoked from network); 28 Jun 2016 16:47:56 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Jun 2016 16:47:56 -0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 467AE47D; Tue, 28 Jun 2016 16:47:53 +0000 (UTC) Received: from vitty.brq.redhat.com (vitty.brq.redhat.com [10.34.26.3]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5SGlUID004662; Tue, 28 Jun 2016 12:47:50 -0400 From: Vitaly Kuznetsov To: xen-devel@lists.xenproject.org Date: Tue, 28 Jun 2016 18:47:29 +0200 Message-Id: <1467132449-1030-9-git-send-email-vkuznets@redhat.com> In-Reply-To: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> References: <1467132449-1030-1-git-send-email-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 28 Jun 2016 16:47:53 +0000 (UTC) Cc: Juergen Gross , Stefano Stabellini , x86@kernel.org, linux-kernel@vger.kernel.org, Julien Grall , Ingo Molnar , David Vrabel , "H. Peter Anvin" , Boris Ostrovsky , Thomas Gleixner Subject: [Xen-devel] [PATCH linux 8/8] xen/pvhvm: run xen_vcpu_setup() for the boot CPU 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 Historically we didn't call VCPUOP_register_vcpu_info for CPU0 for PVHVM guests (while we had it for PV and ARM guests). This is usually fine as we can use vcpu info in the sared_info page but when we try booting on a vCPU with Xen's vCPU id > 31 (e.g. when we try to kdump after crashing on this CPU) we're not able to boot. Switch to always doing VCPUOP_register_vcpu_info for the boot CPU. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/smp.c | 7 +++++++ arch/x86/xen/xen-ops.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 1596626..0be29a0 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -184,7 +184,7 @@ static void clamp_max_cpus(void) #endif } -static void xen_vcpu_setup(int cpu) +void xen_vcpu_setup(int cpu) { struct vcpu_register_vcpu_info info; int err; diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 719cf29..b9b31a7 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -322,6 +322,13 @@ static void __init xen_smp_prepare_boot_cpu(void) xen_filter_cpu_maps(); xen_setup_vcpu_info_placement(); } + + /* + * Setup vcpu_info for boot CPU. + */ + if (xen_hvm_domain()) + xen_vcpu_setup(0); + /* * The alternative logic (which patches the unlock/lock) runs before * the smp bootup up code is activated. Hence we need to set this up diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 4140b07..3cbce3b 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -76,6 +76,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id); bool xen_vcpu_stolen(int vcpu); +void xen_vcpu_setup(int cpu); void xen_setup_vcpu_info_placement(void); #ifdef CONFIG_SMP