From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn1Js-00019m-UV for qemu-devel@nongnu.org; Thu, 22 Sep 2016 06:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn1Jn-0004lr-Gl for qemu-devel@nongnu.org; Thu, 22 Sep 2016 06:33:30 -0400 Sender: Paolo Bonzini References: <20160922052105.GD7915@in.ibm.com> <1474524441.2857.159.camel@kernel.crashing.org> <20160922061514.GF7915@in.ibm.com> <1474534046.2857.166.camel@kernel.crashing.org> <87d1jw5mr0.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> <1474538671.2857.169.camel@kernel.crashing.org> From: Paolo Bonzini Message-ID: Date: Thu, 22 Sep 2016 12:32:24 +0200 MIME-Version: 1.0 In-Reply-To: <1474538671.2857.169.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Benjamin Herrenschmidt , Nikunj A Dadhania , bharata@linux.vnet.ibm.com, aik@ozlabs.ru Cc: clg@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au On 22/09/2016 12:04, Benjamin Herrenschmidt wrote: > On Thu, 2016-09-22 at 14:34 +0530, Nikunj A Dadhania wrote: >> Something like this works for KVM: >> >> diff --git a/target-ppc/machine.c b/target-ppc/machine.c >> index 4820f22..1cf3779 100644 >> --- a/target-ppc/machine.c >> +++ b/target-ppc/machine.c >> @@ -563,8 +563,8 @@ const VMStateDescription vmstate_ppc_cpu = { >> >> /* Sanity checking */ >> VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU), >> - VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), >> - VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), >> + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags) */ >> + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags2) */ >> VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU), >> VMSTATE_END_OF_LIST() >> }, >> >> TCG migration still remains broken with this. > > Can we have conditionally present flags and a post-load that does some > matching ? Yes, you can use something like VMSTATE_UINT64(env.src_insns_flags, PowerPCCPU), VMSTATE_UINT64(env.src_insns_flags2, PowerPCCPU), and a post_load that compares them if kvm_enabled() only. *However* a better fix would be to preserve the old flags for pseries-2.6, and only set the newer flags for pseries-2.7. I'm not saying you have to do this, but if it's not hard (no idea) why not learn how to do it right. The design is not stupid, it's just that compatibility is harder than you think and you are going through the same learning experiences that x86 went though. Paolo