From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHLov-0003ea-8o for qemu-devel@nongnu.org; Sun, 26 Jun 2016 21:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHLos-0006iw-TY for qemu-devel@nongnu.org; Sun, 26 Jun 2016 21:58:40 -0400 Date: Mon, 27 Jun 2016 11:29:59 +1000 From: David Gibson Message-ID: <20160627012959.GB4242@voom.fritz.box> References: <201606242018.u5OKISiY007160@linux03a.ddci.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <201606242018.u5OKISiY007160@linux03a.ddci.com> Subject: Re: [Qemu-devel] [PATCH] target-ppc: gen_pause for instructions: yield, mdoio, mdoom, miso List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aaron Larson Cc: agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 24, 2016 at 01:18:28PM -0700, Aaron Larson wrote: >=20 > Call gen_pause for all "or rx,rx,rx" encodings other nop. This > provides a reasonable implementation for yield, and a better > approximation for mdoio, mdoom, and miso. The 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 As far as I can tell, this is ok. However, I'd like to get a second opinion from agraf or BenH before I apply it. > --- > target-ppc/translate.c | 15 ++++++++------- > 1 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) > } else if (unlikely(Rc(ctx->opcode) !=3D 0)) { > gen_set_Rc0(ctx, cpu_gpr[rs]); > #if defined(TARGET_PPC64) > - } else { > + } else if (rs !=3D 0) { /* 0 is nop */ > int prio =3D 0; > =20 > switch (rs) { > @@ -1514,7 +1514,6 @@ static void gen_or(DisasContext *ctx) > break; > #endif > default: > - /* nop */ > break; > } > if (prio) { > @@ -1524,13 +1523,15 @@ static void gen_or(DisasContext *ctx) > tcg_gen_ori_tl(t0, t0, ((uint64_t)prio) << 50); > gen_store_spr(SPR_PPR, t0); > tcg_temp_free(t0); > - /* Pause us out of TCG otherwise spin loops with smt_low > - * eat too much CPU and the kernel hangs > - */ > + } > #if !defined(CONFIG_USER_ONLY) > - gen_pause(ctx); > + /* Pause out of TCG otherwise spin loops with smt_low eat too mu= ch > + * CPU and the kernel hangs. This applies to all encodings other > + * than no-op, e.g., miso(rs=3D26), yield(27), mdoio(29), mdoom(= 30), > + * and all currently undefined. > + */ > + gen_pause(ctx); > #endif > - } > #endif > } > } --=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 --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXcIGXAAoJEGw4ysog2bOSTogP/2DtNoI5CQ5uIzdRCwO6yZbP KAi5lJuCK7xGcyYXFZLFUImB64Q/Jupe+33VLts2ggi6CrpNlflMhwiCzin7l8XT QyQCfT3q/KY6wdXf2XHjWH1rckX9b2yuAonTOjyyxvVSfIrGBpxEWn72awoVnNL0 XaFjMfnveoANNSZnYbZF004or0mkiLC1CL6xezoynnxSHOKd0jrcYfe6OPdxnp/t wMQJQ25Z50C9QOQiDp1DApUIeIydNDcdk/e00dL/V3ldoIAone46eVuna5K1Xhq0 kR4LgqqcxLO08N/ym4jDUXlo8jrGFcWeNhw/1ymjFRqlykPEBjLKghzThYcW4raP AYMsnbDQQoPSxRpNKx3VKoh3EurUNE/UOE3nwfZ7uSqF21zHQwkep1dNWGTFu80C AHE7ViVRZgtZHG4w0MtpZ6XlPQ6Jj/7CyeEdGFAys9on/CePzboReVID6in7sIHX btSeqn3giR8OAMc0Md3EBNqDS3f8CqDJTBzuNS0ROhFHsLI422NsYpu1Yl0zEW7e 5vBkjX4GwnMesIayJt7djwgkxg1DBQcuaY6UhVl2eT7MrHkcyVkk0MzQzo9rK7YL vRPd4cfR4vyxW5W1OhJh6d9CEywstbAXFAwTc1k8GrrG2WiABfdpUpTv7VsDhAu8 QK3Yg55L0vNodPE+Ex6X =ywZD -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k--