Received: from eggs.gnu.org ([2001:4830:134:3::10]:36343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSac3-00072n-Ea for qemu-devel@nongnu.org; Wed, 27 Jul 2016 21:59:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSac1-0007ol-9R for qemu-devel@nongnu.org; Wed, 27 Jul 2016 21:59:50 -0400 Date: Thu, 28 Jul 2016 10:32:02 +1000 From: David Gibson Message-ID: <20160728003202.GB29626@voom.fritz.box> References: <1469602609-31349-1-git-send-email-benh@kernel.crashing.org> <1469602609-31349-11-git-send-email-benh@kernel.crashing.org> <20160727072107.GV17429@voom.fritz.box> <1469612666.5978.137.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline In-Reply-To: <1469612666.5978.137.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [PATCHv2 11/31] ppc: FP exceptions are always precise List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2016 at 07:44:26PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2016-07-27 at 17:21 +1000, David Gibson wrote: > > On Wed, Jul 27, 2016 at 04:56:29PM +1000, Benjamin Herrenschmidt > > wrote: > > >=20 > > > We don't implement imprecise FP exceptions and using store_current > > > which sets SRR1 to the *previous* instruction never makes sense > > > for these. So let's be truthful and make them precise, which is > > > allowed by the architecture. > > >=20 > > > Signed-off-by: Benjamin Herrenschmidt > > > --- > > > =A0target-ppc/excp_helper.c | 11 ++++++----- > > > =A0target-ppc/translate.c=A0=A0=A0|=A0=A01 - > > > =A02 files changed, 6 insertions(+), 6 deletions(-) > > >=20 > > > diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c > > > index 96c6fd9..02d9e79 100644 > > > --- a/target-ppc/excp_helper.c > > > +++ b/target-ppc/excp_helper.c > > > @@ -274,12 +274,13 @@ static inline void powerpc_excp(PowerPCCPU > > > *cpu, int excp_model, int excp) > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0env->error_code = =3D 0; > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return; > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0} > > > + > > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0/* FP exceptions always have NIP= pointing to the > > > faulting > > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0* instruction, so always use = store_next and claim we > > > are > > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0* precise in the MSR. > > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0*/ > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0msr |=3D 0x00100000; > > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (msr_fe0 =3D=3D msr_fe1) { > > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0goto store_next; > > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0} > > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0msr |=3D 0x00010000; > > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0break; > > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0goto store_next; > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0case POWERPC_EXCP_INVAL: > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0LOG_EXCP("Invalid instruction = at " TARGET_FMT_lx "\n", > > > env->nip); > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0msr |=3D 0x00080000; > > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > > > index 3cfa40f..ba14bda 100644 > > > --- a/target-ppc/translate.c > > > +++ b/target-ppc/translate.c > > > @@ -3060,7 +3060,6 @@ static void > > > gen_conditional_store(DisasContext *ctx, TCGv EA, > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0int reg, int size) > > > =A0{ > > > =A0=A0=A0=A0=A0TCGv t0 =3D tcg_temp_new(); > > > -=A0=A0=A0=A0uint32_t save_exception =3D ctx->exception; > >=20 > > This looks like an unrelated change, and one which would break > > compile > > without other changes in gen_conditional_store() that I don't see. > >=20 > > Have you compiled the user-only targets with this change? >=20 > Ah yes, the whole series does work in user-only, I tested, it's > just a messup beween 2 commits. The rest of the change is in: >=20 > "ppc: Rework NIP updates vs. exception generation" >=20 > What happened is that I initially forgot to remove that line > from the above commit, causing a warning. I did a fix, then > folded the fix into the wrong commmit :) >=20 > You can either take it out of this commit and put it into the > above mentioned one, or I can do a 3rd spin... but the fix is > trivial. Ok, I've fixed it up in place. --=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 --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXmVKCAAoJEGw4ysog2bOSYAwP/RaITRXLjFlI5q+bBseQDVUz kjEIRDid8TDOWepmuFvunlD11+4SQPepX1D5VF7yl66IZDQ90MCgnLzgxLF8TR9y pn/ZfGDUHtDiDf8dkXOPVMxRceFj7Xy0VbsHj5yIAHt3suHjIgh7Ij1epf/cfwvv xGm7RGivcvhLJ2RxshzGXyPAd399q9GFXOkSpeq7uB0ypTUEQ5z6jZQH9lyc8gmN NLSEWtt4sO7lKraH99QMl/VEyTgjqzXy34yIS/csH0PO/fq6ARkljvPrczWSkEgj ahdC/6Fzb8Y5kANlT3U3xp6KuuMnpjktvFZzB0HFqXd17FIWXK3BxUb1XB0sim8S srlCKjb0r6FsvrVbEqDXrhl/P2TU7q8HO8t2VEek0TSFKHyqDnD8u3H/BP1Dll0J xhVBQ7tkgkgwd1Fcw8YBrt3JMKPLS23HEv+/xqloVwGUOTg5cFFhA6iaocxBEXw1 hILRd42hWaifzWnHzu5+SBZDopV5KW8tlJY71zZwiunS7UXjmILl0ROw8Zz12kjC ZnhCf7eYhvop6EW0Qop7Wu4O1uWE2KQ6AEnd+2vbKrM/et9cmXU55uU9upebLex0 yOkG0a8ndawV3guT0xsvW/OGcQfz5sL75cwMVMFjQrISRBhi8muNF4U6UVX93tPW k0hVQouwLqDQ8Q96LTkH =jfsE -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv--