Received: from eggs.gnu.org ([2001:4830:134:3::10]:52945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2XQq-0003Za-8S for qemu-devel@nongnu.org; Fri, 04 Nov 2016 01:52:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2XQn-0001pk-7c for qemu-devel@nongnu.org; Fri, 04 Nov 2016 01:52:52 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:36824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2XQm-0001pH-UK for qemu-devel@nongnu.org; Fri, 04 Nov 2016 01:52:49 -0400 Received: by mail-pf0-x241.google.com with SMTP id n85so6880723pfi.3 for ; Thu, 03 Nov 2016 22:52:48 -0700 (PDT) References: <1477825928-10803-1-git-send-email-david@gibson.dropbear.id.au> <1477825928-10803-17-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <57db31f3-e8b6-cdb4-da1e-e08f06bebd5c@ozlabs.ru> Date: Fri, 4 Nov 2016 16:52:39 +1100 MIME-Version: 1.0 In-Reply-To: <1477825928-10803-17-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 16/17] ppc: Remove counter-productive "sanity checks" in migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , nikunj@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com Cc: thuth@redhat.com, lvivier@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 30/10/16 22:12, David Gibson wrote: > When vmstate for the ppc cpu was introduced in a90db158 "target-ppc: > Convert ppc cpu savevm to VMStateDescription", several "sanity check" > fields were included, verifying that certain cpu parameters matched between > source and destination. > > This turns out not to have been a good idea. For one thing it's redundant > with existing checks for a compatible cpu version at either end. But more > importantly the insns_flags and insns_flags2 checks actively break things: > they expose what's essentially an internal TCG implementation detail in the > migration stream. That means that when new instruction classes are added > or rearranged, migration can break. > > This removes these ill-considered sanity checks. > > Signed-off-by: David Gibson > --- > target-ppc/machine.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/target-ppc/machine.c b/target-ppc/machine.c > index 62b9e94..453ef0a 100644 > --- a/target-ppc/machine.c > +++ b/target-ppc/machine.c > @@ -602,10 +602,10 @@ const VMStateDescription vmstate_ppc_cpu = { > /* FIXME: access_type? */ > > /* Sanity checking */ > - VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU), > - VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), > - VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), > - VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU), > + VMSTATE_UNUSED(sizeof(target_ulong) /* msr_mask */ > + + sizeof(uint64_t) /* insns_flags */ > + + sizeof(uint64_t) /* insns_flags2 */ > + + sizeof(uint32_t)), /* nb_BATs */ This breaks migration to older QEMU: 25055@1478238734.537761:vmstate_load_field_error field "env.msr_mask" load failed, ret = -22 > VMSTATE_END_OF_LIST() > }, > .subsections = (const VMStateDescription*[]) { > -- Alexey