From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnHu-0001qF-BA for qemu-devel@nongnu.org; Thu, 25 Aug 2016 01:33:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcnHt-0006z9-GE for qemu-devel@nongnu.org; Thu, 25 Aug 2016 01:33:14 -0400 Message-ID: <1472103184.2246.77.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Thu, 25 Aug 2016 15:33:04 +1000 In-Reply-To: <1472088691.2246.62.camel@kernel.crashing.org> References: <4a78a3a5-91ba-b3bd-a59c-d1ebf9f1470b@reactos.org> <1472088691.2246.62.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] ppc: regression in 2.7.0-rc3 on rfi/rfid/hrfi instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Herv=E9?= Poussineau , qemu-devel , "qemu-ppc@nongnu.org" On Thu, 2016-08-25 at 11:31 +1000, Benjamin Herrenschmidt wrote: >=C2=A0 > Interesting, the problem is only with 603, not 604. I think I might > have broken something with the 603 SW TLB loading stuff which is > a bit weird, I'll have a look. Thanks. This fixes it to some extent... It gets to "press enter to activate this console" but from there things don't work properly unless I emulate a 604. I suspect there are still issues with the 603 SW TLB mode. --- a/target-ppc/excp_helper.c +++ b/target-ppc/excp_helper.c @@ -959,8 +959,13 @@ static inline void do_rfi(CPUPPCState *env, target_u= long nip, target_ulong msr) { CPUState *cs =3D CPU(ppc_env_get_cpu(env)); =20 - /* MSR:POW cannot be set by any form of rfi */ - msr &=3D ~(1ULL << MSR_POW); + /* These bits cannot be set by RFI on non-BookE systems and so must + * be filtered out. 6xx and 7xxx with SW TLB management will put + * TLB related junk in there among other things. + */ + if (env->excp_model &=3D POWERPC_EXCP_BOOKE) { + msr &=3D ~(target_ulong)0xf0000; + } =20 #if defined(TARGET_PPC64) /* Switching to 32-bit ? Crop the nip */ @@ -990,7 +995,6 @@ void helper_rfi(CPUPPCState *env) do_rfi(env, env->spr[SPR_SRR0], env->spr[SPR_SRR1] & 0xfffffffful); } =20 -#define MSR_BOOK3S_MASK #if defined(TARGET_PPC64) void helper_rfid(CPUPPCState *env) {