From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIQaK-0006bx-2z for qemu-devel@nongnu.org; Wed, 29 Jun 2016 21:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIQaH-0000ES-QY for qemu-devel@nongnu.org; Wed, 29 Jun 2016 21:16:03 -0400 Date: Thu, 30 Jun 2016 10:44:48 +1000 From: David Gibson Message-ID: <20160630004448.GN8885@voom.fritz.box> References: <201606242018.u5OKISiY007160@linux03a.ddci.com> <1467201657.20278.231.camel@au1.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yK/6QRnH3Zanb0EF" Content-Disposition: inline In-Reply-To: <1467201657.20278.231.camel@au1.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: gen_pause for instructions: yield, mdoio, mdoom, miso List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Aaron Larson , agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org --yK/6QRnH3Zanb0EF Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 29, 2016 at 10:00:57PM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2016-06-24 at 13:18 -0700, Aaron Larson wrote: > > Call gen_pause for all "or rx,rx,rx" encodings other nop.=A0=A0This > > provides a reasonable implementation for yield, and a better > > approximation for mdoio, mdoom, and miso.=A0=A0The choice to pause for > > all > > encodings !=3D0 leverages the PowerISA admonition that the reserved > > encodings might change program priority, providing a slight "future > > proofing". > >=20 > > Signed-off-by: Aaron Larson >=20 > Acked-by: Benjamin Herrenschmidt Applied to ppc-for-2.7, thanks. > > --- > > =A0target-ppc/translate.c | 15 ++++++++------- > > =A01 file changed, 8 insertions(+), 7 deletions(-) > >=20 > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > > index 2f1c591..c4559b6 100644 > > --- a/target-ppc/translate.c > > +++ b/target-ppc/translate.c > > @@ -1471,7 +1471,7 @@ static void gen_or(DisasContext *ctx) > > =A0=A0=A0=A0=A0} else if (unlikely(Rc(ctx->opcode) !=3D 0)) { > > =A0=A0=A0=A0=A0=A0=A0=A0=A0gen_set_Rc0(ctx, cpu_gpr[rs]); > > =A0#if defined(TARGET_PPC64) > > -=A0=A0=A0=A0} else { > > +=A0=A0=A0=A0} else if (rs !=3D 0) { /* 0 is nop */ > > =A0=A0=A0=A0=A0=A0=A0=A0=A0int prio =3D 0; > > =A0 > > =A0=A0=A0=A0=A0=A0=A0=A0=A0switch (rs) { > > @@ -1514,7 +1514,6 @@ static void gen_or(DisasContext *ctx) > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0break; > > =A0#endif > > =A0=A0=A0=A0=A0=A0=A0=A0=A0default: > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0/* nop */ > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0break; > > =A0=A0=A0=A0=A0=A0=A0=A0=A0} > > =A0=A0=A0=A0=A0=A0=A0=A0=A0if (prio) { > > @@ -1524,13 +1523,15 @@ static void gen_or(DisasContext *ctx) > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0tcg_gen_ori_tl(t0, t0, ((uint64_= t)prio) << 50); > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0gen_store_spr(SPR_PPR, t0); > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0tcg_temp_free(t0); > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0/* Pause us out of TCG otherwise s= pin loops with smt_low > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0* eat too much CPU and the kern= el hangs > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0*/ > > +=A0=A0=A0=A0=A0=A0=A0=A0} > > =A0#if !defined(CONFIG_USER_ONLY) > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0gen_pause(ctx); > > +=A0=A0=A0=A0=A0=A0=A0=A0/* Pause out of TCG otherwise spin loops with = smt_low eat > > too much > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0* CPU and the kernel hangs.=A0=A0This appli= es to all encodings > > other > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0* than no-op, e.g., miso(rs=3D26), yield(27= ), mdoio(29), > > mdoom(30), > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0* and all currently undefined. > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0*/ > > +=A0=A0=A0=A0=A0=A0=A0=A0gen_pause(ctx); > > =A0#endif > > -=A0=A0=A0=A0=A0=A0=A0=A0} > > =A0#endif > > =A0=A0=A0=A0=A0} > > =A0} >=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 --yK/6QRnH3Zanb0EF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXdGuAAAoJEGw4ysog2bOSb04P/0VcqMHlMBSRp1kz3Xj3nkz8 dImpL+k5ZMF1ocilKeMCxVhRN9/JYPyZWumrrmt8lngo/IblfOaGjb36P5/pIm08 H25iHrZRtqbwkUXunCg6/ZwLerTjoVn3Sb4feFecKqosOtOWFbWpTM1Vps4MiobX HoVKBS/dTvvlwl501pCOUTg0z7nMJNgf/pZ6U14KNijKnqSpElxgS5G+eoZIpndm 8XiG1VjDhZXZ5vdfLAWHGOepAWM/fm0OkeDUiQ5PfYywmtjgPD+Hik63iVvTyRQF QbNhCEIyjmYVe/a83IIOddr2CePOBukksjRfoYBLnrSfuqO6PFjRFVT12zpffofh ybYDugt3Uk32T3Ty8Nnf7Y+t8mJYbH0BMp0WBYWJCN0JzG9/syWcjzuaMu1mtwP8 3HQ4L8kx5wqw5xFtxY1DRxInwcstWfl18h1orXcUxQg1YflntvLLDaCkM9/5QvXR /IjBsSsLKE2z9vtYGZrp72oHQhd36vV8I/AXiXMgYqKrSjy2jmIcS7OECwUXaQ3o WSb3Hivy84ysxkyIRjxKUNX1Jq4nMj2j+dNU07xF4CFWnGf41nRz2WirwXrQ7EtI HbGBqQOCgKipRv2N1N3M/qWGfivqw9qDD/btCVh50MgAbuBw4p7x2DPZRX/5k5Mp Q+vt8r645JhAW+kE0yrq =PuXC -----END PGP SIGNATURE----- --yK/6QRnH3Zanb0EF--