Received: from eggs.gnu.org ([2001:4830:134:3::10]:49152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjGCA-0001jU-Aw for qemu-devel@nongnu.org; Sun, 11 Sep 2016 21:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjGC5-0008FU-82 for qemu-devel@nongnu.org; Sun, 11 Sep 2016 21:38:01 -0400 Date: Mon, 12 Sep 2016 11:37:07 +1000 From: David Gibson Message-ID: <20160912013707.GF12621@voom.fritz.box> References: <1473319962-27591-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b8GWCKCLzrXbuNet" Content-Disposition: inline In-Reply-To: <1473319962-27591-1-git-send-email-clg@kaod.org> Subject: Re: [Qemu-devel] [PATCH] ppc: restrict the use of the rfi instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , Thomas Huth , Mark Cave-Ayland --b8GWCKCLzrXbuNet Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 08, 2016 at 09:32:42AM +0200, C=E9dric Le Goater wrote: > From: Benjamin Herrenschmidt >=20 > Power ISA 2.x has deleted the rfi instruction and rfid shoud be used > instead on cpus following this instruction set or later. >=20 > This will raise an invalid exception when rfi is used on such > processors: Book3S 64-bit processors. >=20 > Signed-off-by: Benjamin Herrenschmidt > Reviewed-by: David Gibson > [clg: the required fix in openbios, commit b747b6acc272 ('ppc: use > rfid when running under a CPU from the 970 family.'), is now > merged in qemu under commit 5cebd885d0d2 ('Update OpenBIOS > images to b747b6a built from submodule.') ] > Signed-off-by: C=E9dric Le Goater Applied to ppc-for-2.8, thanks. > --- > target-ppc/translate.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > Index: qemu-dgibson-for-2.8.git/target-ppc/translate.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- qemu-dgibson-for-2.8.git.orig/target-ppc/translate.c > +++ qemu-dgibson-for-2.8.git/target-ppc/translate.c > @@ -3585,10 +3585,13 @@ static void gen_rfi(DisasContext *ctx) > #if defined(CONFIG_USER_ONLY) > GEN_PRIV; > #else > - /* FIXME: This instruction doesn't exist anymore on 64-bit server > - * processors compliant with arch 2.x, we should remove it there, > - * but we need to fix OpenBIOS not to use it on 970 first > + /* This instruction doesn't exist anymore on 64-bit server > + * processors compliant with arch 2.x > */ > + if (ctx->insns_flags & PPC_SEGMENT_64B) { > + gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL); > + return; > + } > /* Restore CPU state */ > CHK_SV; > gen_update_cfar(ctx, ctx->nip - 4); >=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 --b8GWCKCLzrXbuNet Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJX1gbCAAoJEGw4ysog2bOShwoP/Aw6BVViDwFmbVJpmo1I9rgZ P6mpjLkGZCiaDXeddh8XWbY0HynnCf13zVr4QI8fLZN1wEQVY8BchB0oIxoaLQCl HpgTHkHJ7PBKHhbBXudkZNtmOG9etlK5YfTcQshUfdQPopYjVTVdstoVjPk9F8sa qKdIDdD6w/f843X/zNz+tZKeIPQODvipX24Zl+3YIhQtU9IkRPu0ZRNuWAaeqzvG uGT13JEK3GsEdcbXNmhEf4Ydg9vBzYJfvcayBbLtOfxf6l8MhlBCtcrct93e5jfd 7HPYYoRjJd7qRx3prJtQ70kVfCeF6ObdC8G3kQ4npUyfgplM/OKauDCk5J1rW0T5 hEoqBUZyofrfFmT4PdhQqZh1jjEszxv8oe2wOsR39KvTOfvWF/mOBTO98Fx3AYrm IVHMxrCGv5Eas0YCq3MV4d2j9Ez9sac8Lodvj5g1tg3HtAf7F8HF7F9B1VimxR1G 3/f940N8vtFHraqXy8vxkQY3Y/Cb7ALAvXbJotqlEraxzAcQ0IPm+7TtWU2suHLT T3eYk9QO2gewhdvWd4ZQVNfQKGC2KCA6kW0LmlbvWZkheWH/u5xv4jUXwNfI0HJC IZAvVAayyG7eD5e76fh1b4FWMCisGVcuWLtomxILuPz9lQ+IP/k9BQxrqYKT71mQ oZmR0hr4WiVxeCMhj+JO =jMqr -----END PGP SIGNATURE----- --b8GWCKCLzrXbuNet--