From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnGXq-0001dJ-Uz for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnGXo-0002FD-Kl for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:48:57 -0400 Date: Fri, 23 Sep 2016 10:52:31 +1000 From: David Gibson Message-ID: <20160923005231.GM2085@umbus.fritz.box> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P9KQiUGMzYCFwWCN" Content-Disposition: inline In-Reply-To: <87d1jw5mr0.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> 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: Nikunj A Dadhania Cc: Benjamin Herrenschmidt , bharata@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org --P9KQiUGMzYCFwWCN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 22, 2016 at 02:34:19PM +0530, Nikunj A Dadhania wrote: > Benjamin Herrenschmidt writes: >=20 > > On Thu, 2016-09-22 at 11:45 +0530, Bharata B Rao wrote: > >> On Thu, Sep 22, 2016 at 04:07:21PM +1000, Benjamin Herrenschmidt wrote: > >> >=20 > >> > On Thu, 2016-09-22 at 10:51 +0530, Bharata B Rao wrote: > >> > >=20 > >> > > The flag values are expected to remain same for a machine version = for > >> > > the migration to succeed, but this expectation is broken now. Shou= ld > >> > > 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. > >> >=20 > >> > Does this affect KVM ? (And if yes why on earth would KVM give a fly= ing > >> > f*** about the TCG instruction flags ?) ... If not, then I think we = can > >> > safely not care. > >>=20 > >> Yes, KVM migration is broken. > > > > Argh then ... stupid design in QEMU. We can't fix anything without > > breaking migration, yay ! >=20 > Looking back in the history of the code: >=20 > commit: a90db1584a00dc1d1439dc7729d99674b666b85e (target-ppc: Convert > ppc cpu savevm to VMStateDescription) added this: >=20 > + /* Sanity checking */ > + VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), > + VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), >=20 > These flags weren't part of vmstate, I am not sure what was the reason > behind adding it though. Its a bit old, Alexey do you remember? >=20 > > I don't know what to do to fix that to be honest. Do we have a way to f= ilter > > what flags actually matter and filter things out when KVM is enabled ? >=20 > Something like this works for KVM: >=20 > 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 =3D { > =20 > /* 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_fl= ags) */ > + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_fl= ags2) */ > VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU), > VMSTATE_END_OF_LIST() > }, This looks like the right solution to me. AFAICT this was just a sanity check that wasn't thought through well enough. > TCG migration still remains broken with this. Uh.. why? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --P9KQiUGMzYCFwWCN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX5HzNAAoJEGw4ysog2bOS5LgQAJspKCpAQ+SUhcHWRVGkMEC0 AAL1smGJ2TeJbMc4WyCKdEX7ZMGIeFJZnbD4Um6WErzZAlxCUUbOLjuNy9zevrpq 6K0jrCTzsMDCubY0PFzR2SfkWmedZosiUyj+6EThTEr+ail22Eh/Q1f6DG1TIm9Q Z8c0CR+aUT6t0mpLXs321/I4H90I+IWDHstzawgN/tuJjS7Q8YACzYIfhRUccpq4 QiEJFMbdnSQYCgGHtxz7Zn+hQUuzkqhPKLFgjyulk4/RgoVEcdzQEesbdgvhvS3N 2KdUwPC7uwRyI+FZjIvn1xXucZF5i+n8DW0zXKTaRXy3jPN1qRb+Y//3cPo8qWji wI9rOvGeImp03KvR+VRyNKWMOFlb4826nRYhmkmW4KNC6tju7alOGxImHas98j4t Jev4iq5Bc3xCD/uc74j/NSAa0RUiQ5EfeEQOoEBg6g1PuT6nrb9a4Hwbpn6xHxnc +xIo+QQgKwDyZZrm/bU/dAgDHBfZm1p7jdGbsdSTTKFQmtPh1UdKgxFktEGpujPY 366uOrts9UrioFamJFmu5ypUDht+1D7iktpiKyEDPwC2+/MEWDbE//U8usUkI83P 3CUJuFOTRvYmLiJ6KoMUJeeNdaBKdU4n1FTD1fDQA+XbzYSRMoVaa3y0ugEVaFLI AwO9mTWco41rMloclHih =tQrP -----END PGP SIGNATURE----- --P9KQiUGMzYCFwWCN--