From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzLzW-0002n1-LY for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:59:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzLzE-0006ob-Q8 for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:58:58 -0500 Date: Thu, 19 Nov 2015 17:19:23 +1100 From: David Gibson Message-ID: <20151119061923.GC10667@voom.redhat.com> References: <1447201710-10229-1-git-send-email-benh@kernel.crashing.org> <1447201710-10229-10-git-send-email-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QRj9sO5tAVLaXnSD" Content-Disposition: inline In-Reply-To: <1447201710-10229-10-git-send-email-benh@kernel.crashing.org> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 09/77] ppc: Fix do_rfi() for rfi emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org --QRj9sO5tAVLaXnSD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 11, 2015 at 11:27:22AM +1100, Benjamin Herrenschmidt wrote: > XXX This patch needs double checking... It fixed 32-bit userspace > but I'm not sure it's right. I wonder whether msr_is_64bit() should > be applied to env->msr, not msr, but I need to double check the > architecture. Hrm, I'm not really sure where I'd look in the arch, but msr_is_64bit(env->msr) seems like it would make more sense to me. The current logic means that rfi, ostensibly a 32-bit instruction will have different behaviour depending on the upper bits of SRR1, which seems a unexpected. >=20 > Signed-off-by: Benjamin Herrenschmidt > --- > target-ppc/excp_helper.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c > index c1d6605..00fae60 100644 > --- a/target-ppc/excp_helper.c > +++ b/target-ppc/excp_helper.c > @@ -878,13 +878,13 @@ static inline void do_rfi(CPUPPCState *env, target_= ulong nip, target_ulong msr, > CPUState *cs =3D CPU(ppc_env_get_cpu(env)); > =20 > #if defined(TARGET_PPC64) > + msr =3D msr & msrm; > if (msr_is_64bit(env, msr)) { > nip =3D (uint64_t)nip; > - msr &=3D (uint64_t)msrm; > } else { > nip =3D (uint32_t)nip; > - msr =3D (uint32_t)(msr & msrm); > if (keep_msrh) { > + msr &=3D 0xffffffff; > msr |=3D env->msr & ~((uint64_t)0xFFFFFFFF); > } > } --=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 --QRj9sO5tAVLaXnSD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWTWnqAAoJEGw4ysog2bOSKBoQAObXN13fVBE0MLa46Zn4Usum aqOWKN1w4f3brn+q1a1KZEWlVnb5kBuIxxlqwZFciaYfJX4E7KC2kkaZrVL1+SmD up3v5jZ40Q9QPf3QjaLgmSb29bvSFUhCXsQpafFpPmPDaPkZaJ6TjAHcKmPODgYh je7VWikKrKGeF3lkTV1rfh+B0lPQhikePa5meCVoKsbTK9NtSAgk7M7Kiz1nIbKm PsNQBrRq7nfX79qCcvWSvEyAEEPMNyCpZmhWNys6231OJIJqcfdKe9VMJOszzZQt VZTYyYkVwg/EZelC/ApSgNt43gnWMQPdRVdFpJ7jyyot6yAEWzTMoH03BlriLVhV kwc+/ME4ylhSD7a14QfqdSnuWqtwIPb84/I8y8HlC1fx7MEcMRcIap1dUJEN8b9y rJlpilH9Uu2+IVR2omSNtlqc0YneRqIu2lOXedWtSK0o2wDtDBGzDQX8DU8XS8NQ pZiC7dEsYAf74VUCWbU5YsSbgOmNFsjywSMz64Dg99agDMQ/ZCLlcI3XphTIYBlr RghTzkoT/yXKrEJSJZOns0IVmJ+ECnSN7gMiLeg080BfiILT0eYm9gT8wI2bjoNG JF0TDmcoHpM/Zl62b8TLAhhyWJjUS7J1FLb39ZlIWyQg9hB1f5oOpKdR89ytY1yd Nrp6DP5Yczu1HiZy8z9E =pKYs -----END PGP SIGNATURE----- --QRj9sO5tAVLaXnSD--