From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmx43-0007TR-6x for qemu-devel@nongnu.org; Thu, 22 Sep 2016 02:00:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmx3y-00035a-8o for qemu-devel@nongnu.org; Thu, 22 Sep 2016 02:00:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46323 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmx3y-00035U-2r for qemu-devel@nongnu.org; Thu, 22 Sep 2016 02:00:50 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8M5w6tg022433 for ; Thu, 22 Sep 2016 02:00:49 -0400 Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0a-001b2d01.pphosted.com with ESMTP id 25kkrtgc9n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Sep 2016 02:00:48 -0400 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Sep 2016 11:30:45 +0530 Date: Thu, 22 Sep 2016 11:30:24 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <20160922052105.GD7915@in.ibm.com> <20160922053008.GH2085@umbus.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160922053008.GH2085@umbus.fritz.box> Message-Id: <20160922060024.GE7915@in.ibm.com> Subject: Re: [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, "Nikunj A. Dadhania" On Thu, Sep 22, 2016 at 03:30:08PM +1000, David Gibson wrote: > On Thu, Sep 22, 2016 at 10:51:05AM +0530, Bharata B Rao wrote: > > Hi, > > > > Nikunj and I realized that migrating pseries-2.6 guest from QEMU-2.6 > > to newer QEMU-2.7 is broken like this: > > > > qemu-system-ppc64: error while loading state for instance 0x0 of device 'cpu' > > qemu-system-ppc64: load of migration failed: Invalid argument > > > > Bisecting tells us that 4e0806110c8b896ceff3490f15a616e8b3165efe > > (ppc: Add PPC_64H instruction flag to POWER7 and POWER8) is the > > first bad commit. Along with this there are other 3 similar commits > > which add new bits to insns_flags and insns_flags2 fields of POWER7 > > and POWER8 CPUs. > > > > 4e0806110c8b896ceff3490f15a616e8b3165efe Adds PPC_64H to POWER7 and POWER8 > > dfdd3e43620a6cd4f2be31da5a257c84a16fc000 Adds PPC_64BX to POWER7 > > b781537560e3b968b6fe1395e3d07bd67f0009ba Adds PPC_CILDST to POWER7 and POWER8 > > 7778a575c7055276afdd01737e9d1029a65f923d Adds PPC2_PM_ISA206 to POWER7 and POWER8 > > > > The flag values are expected to remain same for a machine version for > > the migration to succeed, but this expectation is broken now. Should > > we make the addition of these flags conditional on machine type version ? > > But these flags are part of POWER8 CPU definition which is common for > > both pseries and upcoming powernv. > > Can you step me through how the new flags are breaking the migration? > It's not immediately obvious to me. Here is what I understand. Given below is the pruned vmstate_ppc_cpu data structure. const VMStateDescription vmstate_ppc_cpu = { .name = "cpu", .fields = (VMStateField[]) { /* Sanity checking */ VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), VMSTATE_END_OF_LIST() }, }; When pseries-2.6 guest is started at the source with QEMU-2.6, insns_flags and insns_flags2 will not have PPC_64H, PPC_64BX, PPC_CILDST, PPC2_PM_ISA206 set. However at the target when pseries-2.6 guest is started with QEMU-2.7, these flags will be set. And I believe VMSTATE_UINT64_EQUAL checks above will cause migration to fail. Regards, Bharata.