From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKheU-0000fT-2d for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKheP-0006xO-V9 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:53:45 -0400 Received: from 17.mo5.mail-out.ovh.net ([46.105.56.132]:52509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKheP-0006x5-OU for qemu-devel@nongnu.org; Wed, 06 Jul 2016 03:53:41 -0400 Received: from player794.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id A63971008D40 for ; Wed, 6 Jul 2016 09:53:40 +0200 (CEST) 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> <1467789880.13965.115.camel@kernel.crashing.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <5c259fdc-2867-0495-f0df-e5418bc714bb@kaod.org> Date: Wed, 6 Jul 2016 09:53:30 +0200 MIME-Version: 1.0 In-Reply-To: <1467789880.13965.115.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 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: Benjamin Herrenschmidt , qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org, David Gibson On 07/06/2016 09:24 AM, Benjamin Herrenschmidt wrote: > On Wed, 2016-07-06 at 08:57 +0200, C=C3=A9dric Le Goater wrote: >> >>> The -1 result is now handled in the JITed code to do the right >> thing >>> (well, afaik). >> >> well, no. It should be a 0 when the slb is not found, and thus no=20 >> machine check. That is how I understand :=20 >=20 > Right, which is afaik what the current qemu code does no ? >=20 > The -1 isn't the function return, it's the pointer-argument > return, which goes into rT.=20 ah yes. the : *rt =3D (target_ulong)-1ul; confused me. > This is then handled in the generated code: >=20 > gen_helper_find_slb_vsid(cpu_gpr[rS(ctx->opcode)], cpu_env, > cpu_gpr[rB(ctx->opcode)]); > l1 =3D gen_new_label(); > l2 =3D gen_new_label(); > tcg_gen_trunc_tl_i32(cpu_crf[0], cpu_so); >=20 > We clear CR (except so) >=20 > tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[rS(ctx->opcode)], -1, l1); >=20 > We branch to l1 if rT is -1 > =20 > tcg_gen_ori_i32(cpu_crf[0], cpu_crf[0], 1 << CRF_EQ); >=20 > We set EQ if we didn't branch >=20 > tcg_gen_br(l2); >=20 > Then go to l2 (skip the next bit) >=20 > gen_set_label(l1); > tcg_gen_movi_tl(cpu_gpr[rS(ctx->opcode)], 0); >=20 > We clear rS if it was -1 >=20 > gen_set_label(l2); >=20 Thanks for the details, sorry for the noise :/ Are there any OSes using it ?=20 C.