From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbcF1QtE (ORCPT ); Tue, 28 Jun 2016 12:49:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486AbcF1QsD (ORCPT ); Tue, 28 Jun 2016 12:48:03 -0400 From: Vitaly Kuznetsov To: xen-devel@lists.xenproject.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Stefano Stabellini , Boris Ostrovsky , David Vrabel , Juergen Gross , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Julien Grall Subject: [PATCH linux 8/8] xen/pvhvm: run xen_vcpu_setup() for the boot CPU 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-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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.5.5