From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756168AbcGZMah (ORCPT ); Tue, 26 Jul 2016 08:30:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753701AbcGZMae (ORCPT ); Tue, 26 Jul 2016 08:30:34 -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" , "Jan Beulich" , Andrew Cooper , Julien Grall Subject: [PATCH linux v3 0/9] xen: pvhvm: support bootup on secondary vCPUs Date: Tue, 26 Jul 2016 14:30:19 +0200 Message-Id: <1469536228-29932-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.27]); Tue, 26 Jul 2016 12:30:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It may happen that Xen's and Linux's ideas of vCPU id diverge. In particular, when we crash on a secondary vCPU we may want to do kdump and unlike plain kexec where we do migrate_to_reboot_cpu() we try booting on the vCPU which crashed. This doesn't work very well for PVHVM guests as we have a number of hypercalls where we pass vCPU id as a parameter. These hypercalls either fail or do something unexpected. To solve the issue we need to have a mapping between Linux's and Xen's vCPU ids. This series solves the issue for x86 PVHVM guests. PV guests don't (and probably won't) support kdump so I always assume Xen's vCPU id == Linux's vCPU id. ARM guests will probably need to get proper mapping once we start supporting kexec/kdump there. Changes since v2: - Use 'uint32_t' for xen_vcpu_id mapping [Julien Grall] - Rebased to linux-4.7 Changes since v1: - "x86/acpi: store ACPI ids from MADT for future usage" patch added. - Use ACPI ids instead of vLAPIC ids/2 [Andrew Cooper, Jan Beulich] - Introduce xen_vcpu_nr() helper [David Vrabel]. - Modify all callers of HYPERVISOR_vcpu_op() instead of modifying HYPERVISOR_vcpu_op() [David Vrabel] Vitaly Kuznetsov (9): x86/xen: update cpuid.h from Xen-4.7 x86/acpi: store ACPI ids from MADT for future usage xen: introduce xen_vcpu_id mapping x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page xen/events: use xen_vcpu_id mapping in events_base xen/events: fifo: use xen_vcpu_id mapping xen/evtchn: use xen_vcpu_id mapping xen/pvhvm: run xen_vcpu_setup() for the boot CPU arch/arm/xen/enlighten.c | 13 +++++++++++- arch/x86/include/asm/cpu.h | 1 + arch/x86/include/asm/smp.h | 2 ++ arch/x86/include/asm/xen/cpuid.h | 5 ++++- arch/x86/kernel/acpi/boot.c | 16 ++++++++++---- arch/x86/kernel/apic/apic.c | 2 ++ arch/x86/kernel/setup_percpu.c | 3 +++ arch/x86/xen/enlighten.c | 45 +++++++++++++++++++++++++++++++--------- arch/x86/xen/irq.c | 3 ++- arch/x86/xen/smp.c | 18 +++++++++++----- arch/x86/xen/time.c | 18 ++++++++++------ arch/x86/xen/xen-ops.h | 1 + drivers/xen/events/events_base.c | 13 ++++++------ drivers/xen/events/events_fifo.c | 2 +- drivers/xen/evtchn.c | 3 ++- drivers/xen/time.c | 2 +- include/xen/xen-ops.h | 6 ++++++ 17 files changed, 116 insertions(+), 37 deletions(-) -- 2.7.4