Received: from eggs.gnu.org ([2001:4830:134:3::10]:51201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKKVC-0007pm-VY for qemu-devel@nongnu.org; Tue, 05 Jul 2016 03:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKKV7-00050E-Tp for qemu-devel@nongnu.org; Tue, 05 Jul 2016 03:10:38 -0400 Received: from 3.mo69.mail-out.ovh.net ([188.165.52.203]:36813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKKV7-0004zv-MW for qemu-devel@nongnu.org; Tue, 05 Jul 2016 03:10:33 -0400 Received: from player789.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id DD341FFCCB8 for ; Tue, 5 Jul 2016 09:10:30 +0200 (CEST) Date: Tue, 5 Jul 2016 09:10:21 +0200 From: Greg Kurz Message-ID: <20160705091021.48057402@bahia.lan> In-Reply-To: <1467693772-7391-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1467693772-7391-1-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v0 0/5] sPAPR: Fix migration when CPUs are removed in random order List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, imammedo@redhat.com, nikunj@linux.vnet.ibm.com, pbonzini@redhat.com On Tue, 5 Jul 2016 10:12:47 +0530 Bharata B Rao wrote: > device_add/del based CPU hotplug and unplug support is upstream for > sPAPR PowerPC and is under development for x86. Both of these will > support CPU device removal in random order (and not necessarily in LIFO > order). Random order removal will result in holes in cpu_index range > which causes migration to fail. This needs fixes in both generic code > as well as arch specific code. > > - We need to use arch_id as the instance_id when registering CPU devices > using vmstate_register. To support forward migration, as per Igor's > suggestion, this needs to be done conditionally based on machine type > version. > - From pseries-2.7 onwards, we start using arch_id for migration as well > as in XICS code. > > In fact, Igor even suggested to move the vmstate registration calls > into cpu_common_realizefn and yet-to-be-introduced cpu_common_unrealizefn. > But I haven't done that in this patchset as I am hitting an unrelated > issue with that movement. > > This patchset depends on Greg Kurz's patchset where among other things, > he is deriving cpu_dt_it (arch_id) based on core-id. > (https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg00210.html) > I'm respinning my patchset according to the latest comments I got. This includes rebasing on top of Eduardo's tree to have the global parse_features bits, as mentioned here: https://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg00622.html I'll rework this patch to apply on the current code: https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg07564.html > Tested changes to XICS code with both kernel_irqchip=on/off. > This applies on ppc-for-2.7 branch of David's tree. > > Bharata B Rao (5): > cpu: Factor out cpu vmstate_[un]register into separate routines > cpu: Optionally use arch_id instead of cpu_index in cpu > vmstate_register() > spapr: Implement CPUClass.get_arch_id() for PowerPC CPUs > xics: Use arch_id instead of cpu_index in XICS code > spapr: Prefer arch_id over cpu_index > > exec.c | 53 +++++++++++++++++++++++++++++---------------- > hw/intc/xics.c | 14 ++++++++---- > hw/intc/xics_kvm.c | 12 +++++----- > hw/intc/xics_spapr.c | 33 ++++++++++++++++++++++------ > hw/ppc/spapr.c | 2 ++ > hw/ppc/spapr_cpu_core.c | 5 +++++ > include/hw/boards.h | 1 + > include/qom/cpu.h | 4 ++++ > target-ppc/translate_init.c | 8 +++++++ > 9 files changed, 96 insertions(+), 36 deletions(-) >