Received: from eggs.gnu.org ([2001:4830:134:3::10]:49478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhuEA-0003Ta-ED for qemu-devel@nongnu.org; Thu, 08 Sep 2016 03:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhuE7-0003gy-Cd for qemu-devel@nongnu.org; Thu, 08 Sep 2016 03:58:30 -0400 References: <1473319962-27591-1-git-send-email-clg@kaod.org> From: Thomas Huth Message-ID: <3b69125f-acaf-c27e-e880-2c61a9adef7c@redhat.com> Date: Thu, 8 Sep 2016 09:58:20 +0200 MIME-Version: 1.0 In-Reply-To: <1473319962-27591-1-git-send-email-clg@kaod.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-ppc@nongnu.org Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , Mark Cave-Ayland On 08.09.2016 09:32, C=C3=A9dric 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=C3=A9dric Le Goater > --- > 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 Reviewed-by: Thomas Huth