From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as16R-00039T-3l for qemu-devel@nongnu.org; Mon, 18 Apr 2016 00:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1as16N-00029D-Ur for qemu-devel@nongnu.org; Mon, 18 Apr 2016 00:48:03 -0400 Date: Mon, 18 Apr 2016 11:53:47 +1000 From: David Gibson Message-ID: <20160418015347.GR18218@voom.redhat.com> References: <1460710980-9995-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="chReQkDOePndSGWY" Content-Disposition: inline In-Reply-To: <1460710980-9995-1-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org, aik@ozlabs.ru, rth@twiddle.net --chReQkDOePndSGWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 15, 2016 at 11:03:00AM +0200, Thomas Huth wrote: > env->xer only holds the lower bits of the XER register nowadays, the > SO, OV and CA bits are stored in separate variables (see the function > cpu_write_xer() for details). Since the migration code currently only > reads the "xer" variable, the upper bits are lost during migration. > Fix it by using cpu_read_xer() instead. >=20 > Signed-off-by: Thomas Huth > --- > In case somebody wants to test this, this problem can easily be > seen with my SPRs kvm-unit-test on KVM running on a P8 machine: > https://patchwork.ozlabs.org/patch/607981/ >=20 > target-ppc/machine.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to ppc-for-2.6, thanks. >=20 > diff --git a/target-ppc/machine.c b/target-ppc/machine.c > index 692121e..46684fb 100644 > --- a/target-ppc/machine.c > +++ b/target-ppc/machine.c > @@ -136,7 +136,7 @@ static void cpu_pre_save(void *opaque) > =20 > env->spr[SPR_LR] =3D env->lr; > env->spr[SPR_CTR] =3D env->ctr; > - env->spr[SPR_XER] =3D env->xer; > + env->spr[SPR_XER] =3D cpu_read_xer(env); > #if defined(TARGET_PPC64) > env->spr[SPR_CFAR] =3D env->cfar; > #endif --=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 --chReQkDOePndSGWY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXFD4rAAoJEGw4ysog2bOS36MP/3IxnKDQk88/q7TXMHkOPg5c EYPzAoZG/GOvlLxak2P73femn+PiHZAKWoLgeSNwzRyeVhBf7SrIi6cRvLSF3rq6 m7AMhYOkRYCepozDW2NKypsHWXckvB4bS/3oQ7fjH5V+T6KWw7Jgo9YSTBS58FWf b4AIVJ+DiHyovT5M40Ra9Y5+Lz5M3pKnJzEseiuOCu2Lnu6ItNr1fzozp+L1+rR1 R5tgGvJSA5X4nzaGEoT6DOZfTZo9IpCIzGS81kH8Lb0O1Z1xQSLsZ26OJPPSIS3G E7mqCbvh71wfs/fq/N3srtQQhXlEK2ww+peONWk7sZgGQh0VcxbsrUOSZKfe8qPj WEv66XFsPLoIJxWc0xJLLd2s1LGQYFkMwvlaid3Lz3AJMWXR7kQ5OeQQZ0ejmnQj djV8ueO7bVDyrtuR8GcJxnXyuqYNlcgmK/X3FRCUzTqI07xlVO1L7kDq9xKcRysC eYjQqRpooISrntLxFT0cAsnuAQTGxIQEu8Nb9RyXAQoUhfKfl/82Ama+KXLak1Io P/zawbwzo/rFZFanINiTmn6r5qztJntWR3SSdJjf9TqtQTOIr+DqDH/k8RO5j1EL vQkt1PEvCWGeYDsn01hN4YLSUOKfiFIldvDOuh4wvUKYRuGd2xYWNt4UId0GiMcx d3RBg9keYwqMRIDsXRMF =602U -----END PGP SIGNATURE----- --chReQkDOePndSGWY--