From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnGXu-0001hP-5w for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnGXr-0002GZ-Sq for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:02 -0400 Date: Fri, 23 Sep 2016 11:01:42 +1000 From: David Gibson Message-ID: <20160923010142.GN2085@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> <1474538671.2857.169.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H7cT1SUwsqXggVRO" Content-Disposition: inline In-Reply-To: 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: Paolo Bonzini Cc: Benjamin Herrenschmidt , Nikunj A Dadhania , bharata@linux.vnet.ibm.com, aik@ozlabs.ru, clg@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --H7cT1SUwsqXggVRO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 22, 2016 at 12:32:24PM +0200, Paolo Bonzini wrote: >=20 >=20 > 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 =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= _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. > >=20 > > Can we have conditionally present flags and a post-load that does some > > matching ? >=20 > Yes, you can use something like >=20 > VMSTATE_UINT64(env.src_insns_flags, PowerPCCPU), > VMSTATE_UINT64(env.src_insns_flags2, PowerPCCPU), >=20 > and a post_load that compares them if kvm_enabled() only. We could, but I'm not convinced there's any point. I don't see that migrating these flags actually has any value beyond a sanity check, the consequences of which we obviously didn't think through fully. They should just be a TCG internal matter. > *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. >=20 > 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. >=20 > Paolo >=20 --=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 --H7cT1SUwsqXggVRO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX5H72AAoJEGw4ysog2bOS2BEP/iMLfTttXEbK3Zi0WJdgolm+ c55hGioDGjSwBVgJzf5JDzfjS8sEeowBKwNZF5Y9nm/boXlWbwr2VoflDt1oiaKf yCHPCf14DdIHmppOIRXrtIKpA2MhbZ64AwmwPpbRaLFOkpUpTalnPYoDy4p4WBVX 3Xt3BNLjBVmzxeps1C4+c6EWSaIp/5VbOIU1PGk/6S5ayPtbSAyngUTUgk2szJ3h DM6Cla0qmYVBtnkF6KVCCYnNfVCDosCClNWhuefqw704TgNY2h0wCW2sB378eQ6K FsTHRgjazaY8LW0tevSoj5GVIvNmKfbR/VbMYocy6aCirmer+d8S2Cg7SnJaZbRU Yg3Nee8uy3K+pdwHWNKv90dt7qAJiN7bJdXMV9I7qhs4N8EUml4dqDnwsNiBFyPR 4oKvEiuGZseLwXpvt7oz4HMehETlMizx4Ng2Bh50vdMz02sacFzuxo6UA5nh3AmF jToO9y084K6vTMUWzSDlysObmH4hagqgpycJonuKnuiy65e3hDg1Q7jjH/yGws6v yborNuIF2RolVoXjUWYFS5UfWCRws8w4OsLe8hJjnmZGAU/UkSUlH8ZO38Ql7Xtz DFdld+iTFGfBKtLJHM4jMGLeefdJ2fYdXFSlzas9JRPOG4DOZeNWbYD5ElM4I6W6 jk6kvdj/i1kvijhM+ind =whIf -----END PGP SIGNATURE----- --H7cT1SUwsqXggVRO--