From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bA67U-0006rY-5g for qemu-devel@nongnu.org; Mon, 06 Jun 2016 21:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bA67R-0007Sy-V3 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 21:47:51 -0400 Date: Tue, 7 Jun 2016 10:44:13 +1000 From: David Gibson Message-ID: <20160607004413.GM9226@voom.fritz.box> References: <1465206764.4274.45.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sWvRP97dwRHm9fX+" Content-Disposition: inline In-Reply-To: <1465206764.4274.45.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [PATCH 1/2] ppc: Properly tag the translation cache based on MMU mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?iso-8859-1?Q?C=E9dric?= Le Goater , Mark Cave-Ayland --sWvRP97dwRHm9fX+ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 06, 2016 at 07:52:44PM +1000, Benjamin Herrenschmidt wrote: > We used to always flush the TLB when changing relocation mode in > MSR:IR and MSR:DR (ie. MMU on/off for Instructions and Data). >=20 > We don't anymore since we have split mmu_idx for instruction and data. >=20 > However, since we hard code the mmu_idx in the translated code, we > now need to also make sure MSR:IR and MSR:DR are part of the hflags > used to tag translated code, so that we use different translated > code for different MMU settings. >=20 > Darwin gets hurt by this problem. >=20 > Signed-off-by: Benjamin Herrenschmidt Bizarrely, patch complained about a malformed diff on this one for reasons I couldn't figure out. I recreated manually and applied to ppc-for-2.7. > --- > =A0target-ppc/helper_regs.h | 2 +- > =A01 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h > index 12af61c..104b690 100644 > --- a/target-ppc/helper_regs.h > +++ b/target-ppc/helper_regs.h > @@ -95,7 +95,7 @@ static inline void hreg_compute_hflags(CPUPPCState *env) > =A0=A0=A0=A0=A0/* We 'forget' FE0 & FE1: we'll never generate imprecise e= xceptions */ > =A0=A0=A0=A0=A0hflags_mask =3D (1 << MSR_VR) | (1 << MSR_AP) | (1 << MSR_= SA) | > =A0=A0=A0=A0=A0=A0=A0=A0=A0(1 << MSR_PR) | (1 << MSR_FP) | (1 << MSR_SE) = | (1 << MSR_BE) | > -=A0=A0=A0=A0=A0=A0=A0=A0(1 << MSR_LE) | (1 << MSR_VSX); > +=A0=A0=A0=A0=A0=A0=A0=A0(1 << MSR_LE) | (1 << MSR_VSX) | (1 << MSR_IR) |= (1 << MSR_DR); > =A0=A0=A0=A0=A0hflags_mask |=3D (1ULL << MSR_CM) | (1ULL << MSR_SF) | MSR= _HVB; > =A0=A0=A0=A0=A0hreg_compute_mem_idx(env); > =A0=A0=A0=A0=A0env->hflags =3D env->msr & hflags_mask; >=20 >=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 --sWvRP97dwRHm9fX+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXVhjdAAoJEGw4ysog2bOSezgP/Rt+PY1xo0752+8i57JkhQ95 kwk2ayrDRwlAiWpsYEHR+n8LyLil6pQHj3hnvmoL8Ev/Ok0EhPySzJhj7+cboOKb DMpH152iB2Ns1anxogdtggpufCYj0vr+UtmkqHGFIMK04p48bSQfyzsvEmtxT80L znxjwED6KqhvQ82BFsV7rBHsmllkwvmFHtMP/RxtlW1T8g11POMC3K0FaPUfpGd+ yiaB4AJYwKhlWtGq5cP9vxYPZCj7Yi5S/14QG7OvKyT31dkuO9AZ4ULXOr/h7BtZ nse3g81M0wnPTuWEUNtlYyjG8iNHJHupf9sJjhrkbGxdkYMe69PGWZHFxbuyZCcs Y6xQ0nEnBRp6fEgg049l2odMkS/6HCNEztV1tgeuAxdF2IFKArVhMjw2u7XMFI2g 5cb99kPT/2gxJiFCyPBG+KKuRbHjpGVHJjUnQfIrv53jfPT5PSD/me15IhZMlcEW dDlawz9wm4BgO7vHaPQ5KEsL35/WCmUOxTUA1aciAQgVxTyE4nPNIb8k8YWMrc8e /1yCw85NbS37ZA/E1bYa5qVy6hIGzS7VLvjdhQcZx5saad0ugYBKW8N8ZKd7vEJW 5ApJ38Sz+JvZ0Atk0xvXueujkQmcYlxNNlCse7eVn8wUAowcRnvNJib5CpeeG4B2 Mzc/pMQOSvKQ3XDPTXRX =cubW -----END PGP SIGNATURE----- --sWvRP97dwRHm9fX+--