From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzLzX-0002n2-0h for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:59:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzLzF-0006pj-PN for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:58:58 -0500 Date: Thu, 19 Nov 2015 17:26:41 +1100 From: David Gibson Message-ID: <20151119062641.GF10667@voom.redhat.com> References: <1447201710-10229-1-git-send-email-benh@kernel.crashing.org> <1447201710-10229-16-git-send-email-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i3lJ51RuaGWuFYNw" Content-Disposition: inline In-Reply-To: <1447201710-10229-16-git-send-email-benh@kernel.crashing.org> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 15/77] ppc: Fix sign extension issue in mtmsr(d) emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Michael Neuling , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --i3lJ51RuaGWuFYNw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 11, 2015 at 11:27:28AM +1100, Benjamin Herrenschmidt wrote: > From: Michael Neuling >=20 > Signed-off-by: Michael Neuling > Signed-off-by: Benjamin Herrenschmidt Reviewed-by: David Gibson Looks correct, though my memory of C promotion rules is obviously a bit stale, since I'm not immediately seeing why the original was wrong. > --- > target-ppc/translate.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index bd5df40..3974cd2 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -4391,7 +4391,7 @@ static void gen_mtmsrd(DisasContext *ctx) > /* Special form that does not need any synchronisation */ > TCGv t0 =3D tcg_temp_new(); > tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], (1 << MSR_RI) | (1= << MSR_EE)); > - tcg_gen_andi_tl(cpu_msr, cpu_msr, ~((1 << MSR_RI) | (1 << MSR_EE= ))); > + tcg_gen_andi_tl(cpu_msr, cpu_msr, ~(target_ulong)((1 << MSR_RI) = | (1 << MSR_EE))); > tcg_gen_or_tl(cpu_msr, cpu_msr, t0); > tcg_temp_free(t0); > } else { > @@ -4422,7 +4422,7 @@ static void gen_mtmsr(DisasContext *ctx) > /* Special form that does not need any synchronisation */ > TCGv t0 =3D tcg_temp_new(); > tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], (1 << MSR_RI) | (1= << MSR_EE)); > - tcg_gen_andi_tl(cpu_msr, cpu_msr, ~((1 << MSR_RI) | (1 << MSR_EE= ))); > + tcg_gen_andi_tl(cpu_msr, cpu_msr, ~(target_ulong)((1 << MSR_RI) = | (1 << MSR_EE))); > tcg_gen_or_tl(cpu_msr, cpu_msr, t0); > tcg_temp_free(t0); > } else { --=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 --i3lJ51RuaGWuFYNw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWTWugAAoJEGw4ysog2bOSj7QP/1KcJxmxu/NTzoevkh0p/ANs 65ZgdCglNrXhHCyDgUV7p1DnGUPy20GXPP0jJjXPo4lQ+94sHWD7ezxrEIxhhsCd KU6D2PdtW0yAyELFujG7b+hYamdZWZkcQ4W28z7Vqqhg51oKHCwJUEtla+45C9FE qFRalI/c8AIL8j8AjJ7ldigS4lDzeIAO2jvyr+TycGRXs7vbx+B8DFcwB3IvtvrZ MlSMIRPSwS8xV4gwY6jUNvSs6w7skFr/NhwngZH36w/7vtZmAeV3Ftes2ox0cp6A raOSZfY5fD5CpHihLPRO/zHnMQxoeKRsb4XQOY6gKKIVW5UfliDJ39U5MQ1eoxyt RxjZ+CY9OVvfHsQm+8pHUK1fclJa7o1ytS342/L+zDoqXUtPtkEy7lQpwQGnDDpU hhT6RwqdF6g9VHP5zrATF4g1nfIQwXhQa6VNg+rwoqa/jrYrw91KaHN7zJnwyX9w 2M3i78t8hx5Wf0Eyy9gLN0WIXOo+IUHw7ncf6tI75JOmMuouQ8ZpevFm/rlxVnU/ MmzASxIkAAQ9JL1nhu0y4J8SvSlecRxktYUZfiEuPs0dJ3XaAtPDloUVRkt0SOI6 7PzNYZNIu4KRGmR+PSx0zcx6ekJyBODNh1HCyjfAdAQxvX+Wj4cQeO5F9C3ayKnr X0Qpy3U87MgLIbHj8hYC =opjA -----END PGP SIGNATURE----- --i3lJ51RuaGWuFYNw--