From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKhCc-00062U-C2 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKhCX-0008VU-7u for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:24:58 -0400 Message-ID: <1467789880.13965.115.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Wed, 06 Jul 2016 17:24:40 +1000 In-Reply-To: <3625f797-2c3b-16b7-e6ee-e6f8baeeb178@kaod.org> References: <1465267828-10326-1-git-send-email-benh@kernel.crashing.org> <1465267828-10326-8-git-send-email-benh@kernel.crashing.org> <66622434-90c8-0d15-f140-2ca1eaa8473d@kaod.org> <1467756609.13965.78.camel@kernel.crashing.org> <3625f797-2c3b-16b7-e6ee-e6f8baeeb178@kaod.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 8/9] ppc: Add missing slbfee. instruction on ppc64 BookS processors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?C=E9dric?= Le Goater , qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org, David Gibson On Wed, 2016-07-06 at 08:57 +0200, C=C3=A9dric Le Goater wrote: >=20 > > The -1 result is now handled in the JITed code to do the right > thing > > (well, afaik). >=20 > well, no. It should be a 0 when the slb is not found, and thus no=C2=A0 > machine check. That is how I understand :=C2=A0 Right, which is afaik what the current qemu code does no ? The -1 isn't the function return, it's the pointer-argument return, which goes into rT. This is then handled in the generated code: =C2=A0 =C2=A0 gen_helper_find_slb_vsid(cpu_gpr[rS(ctx->opcode)], cpu_env, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0cpu_gpr[rB(ctx->opcode)]); =C2=A0=C2=A0=C2=A0=C2=A0l1 =3D gen_new_label(); =C2=A0=C2=A0=C2=A0=C2=A0l2 =3D gen_new_label(); =C2=A0=C2=A0=C2=A0=C2=A0tcg_gen_trunc_tl_i32(cpu_crf[0], cpu_so); We clear CR (except so) =C2=A0=C2=A0=C2=A0=C2=A0tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[rS(ctx->o= pcode)], -1, l1); We branch to l1 if rT is -1 =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0tcg_gen_ori_i32(cpu_crf[0], cpu_crf[0], 1 << CRF_= EQ); We set EQ if we didn't branch =C2=A0=C2=A0=C2=A0=C2=A0tcg_gen_br(l2); Then go to l2 (skip the next bit) =C2=A0=C2=A0=C2=A0=C2=A0gen_set_label(l1); =C2=A0=C2=A0=C2=A0=C2=A0tcg_gen_movi_tl(cpu_gpr[rS(ctx->opcode)], 0); We clear rS if it was -1 =C2=A0=C2=A0=C2=A0=C2=A0gen_set_label(l2);