From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSEsY-0002jp-Lm for qemu-devel@nongnu.org; Tue, 26 Jul 2016 22:47:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSEsT-0001lK-Gr for qemu-devel@nongnu.org; Tue, 26 Jul 2016 22:47:25 -0400 Date: Wed, 27 Jul 2016 11:06:32 +1000 From: David Gibson Message-ID: <20160727010632.GP17429@voom.fritz.box> References: <1469571686-7284-1-git-send-email-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="D3I0HgOdJ5+6n+7I" Content-Disposition: inline In-Reply-To: <1469571686-7284-1-git-send-email-benh@kernel.crashing.org> Subject: Re: [Qemu-devel] [PATCH 01/32] ppc: Fix fault PC reporting for lve*/stve* VMX instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org --D3I0HgOdJ5+6n+7I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2016 at 08:20:55AM +1000, Benjamin Herrenschmidt wrote: > We forgot to do gen_update_nip() for these like we do with other > helpers. Fix this, but in a more efficient way by passing the RA > to the accessors instead so the overhead is only taken on faults. >=20 > Signed-off-by: Benjamin Herrenschmidt As a bugfix, I've applied this to ppc-for-2.7. > --- > target-ppc/mem_helper.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) >=20 > diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c > index e4de86b..e4ed377 100644 > --- a/target-ppc/mem_helper.c > +++ b/target-ppc/mem_helper.c > @@ -232,16 +232,16 @@ target_ulong helper_lscbx(CPUPPCState *env, target_= ulong addr, uint32_t reg, > \ > if (needs_byteswap(env)) { \ > r->element[LO_IDX ? index : (adjust - index)] =3D \ > - swap(access(env, addr)); \ > + swap(access(env, addr, GETPC())); \ > } else { \ > r->element[LO_IDX ? index : (adjust - index)] =3D \ > - access(env, addr); \ > + access(env, addr, GETPC()); \ > } \ > } > #define I(x) (x) > -LVE(lvebx, cpu_ldub_data, I, u8) > -LVE(lvehx, cpu_lduw_data, bswap16, u16) > -LVE(lvewx, cpu_ldl_data, bswap32, u32) > +LVE(lvebx, cpu_ldub_data_ra, I, u8) > +LVE(lvehx, cpu_lduw_data_ra, bswap16, u16) > +LVE(lvewx, cpu_ldl_data_ra, bswap32, u32) > #undef I > #undef LVE > =20 > @@ -259,16 +259,17 @@ LVE(lvewx, cpu_ldl_data, bswap32, u32) > \ > if (needs_byteswap(env)) { \ > access(env, addr, swap(r->element[LO_IDX ? index : \ > - (adjust - index)])); \ > + (adjust - index)]), \ > + GETPC()); \ > } else { \ > access(env, addr, r->element[LO_IDX ? index : \ > - (adjust - index)]); \ > + (adjust - index)], GETPC()); \ > } \ > } > #define I(x) (x) > -STVE(stvebx, cpu_stb_data, I, u8) > -STVE(stvehx, cpu_stw_data, bswap16, u16) > -STVE(stvewx, cpu_stl_data, bswap32, u32) > +STVE(stvebx, cpu_stb_data_ra, I, u8) > +STVE(stvehx, cpu_stw_data_ra, bswap16, u16) > +STVE(stvewx, cpu_stl_data_ra, bswap32, u32) > #undef I > #undef LVE > =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 --D3I0HgOdJ5+6n+7I Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXmAkXAAoJEGw4ysog2bOSwtEP/Ah3ISXnUubBUaMKE/59kfvD izcykr9L3b1ccpqPXfBKwIHdt+72hAG/x+7YXLzwGk8z/dYInL8GIsc3ZyGw7ahb N2dbOcLVnFr3rK10cK0G9rfGnG2OapVKuFsB+ia6vHjarExczYxTgQb0uEqVdUwI X83OmvGB1Y6//WJFI++BMQ8oO1LcW0Tu/hEVHolmPoTuoDtfrPE18WXgc0n1NU0h 8JQIC9B43QAdGVbRiPCg4zGP8aCNBSVYySWDefutsLrkaBBOfzk6MhRNsvFm+bMY lXc4MdVdfsyx1vgxi7k2lv6g8LRXGPktNzChZRMDuxIC8p8byNBv88gCXvVZJQcP MX0j6oeRAOxuVVN80u+/6foefOSlU+QZSGTCtxY63hG4VpHN9cCoOUP4drUifwxz MgMTxSctK9/vYwOtwiTgCMkNmKrVLC+A1UxvBbr7uHUjUnT9KGisoMrF3RiE1bPJ o4hNjLhnCqcwX9d+tVtUat4NohUGJ+0Vaukr6vcurzIskbBhhOZx6WWne/dIxwcM q7oHI5aQSFy8ds0cSGg5n/b4BvM1+dFk6MlLCJmSBJ4Mk9Ouyv9pjpuwSxIEOCgL IyNW/eakAnby/9vJq0sh+0DaiUW0uwseuBFRGVPe8kPt+YZzRWzEQNY7LKdp2Okd Lst8PnrYBgnDaEJezOoB =4tYv -----END PGP SIGNATURE----- --D3I0HgOdJ5+6n+7I--