From patchwork Thu Aug 25 05:33:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 662638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sKXsg5M2Wz9ryQ for ; Thu, 25 Aug 2016 15:33:59 +1000 (AEST) Received: from localhost ([::1]:54570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnIb-0002Re-Ef for incoming@patchwork.ozlabs.org; Thu, 25 Aug 2016 01:33:57 -0400 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 Received: from gate.crashing.org ([63.228.1.57]:48312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcnHo-0006uS-VB; Thu, 25 Aug 2016 01:33:09 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u7P5X4LV021372; Thu, 25 Aug 2016 00:33:05 -0500 Message-ID: <1472103184.2246.77.camel@kernel.crashing.org> From: Benjamin Herrenschmidt To: =?ISO-8859-1?Q?Herv=E9?= Poussineau , qemu-devel , "qemu-ppc@nongnu.org" 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> X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by gate.crashing.org id u7P5X4LV021372 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 63.228.1.57 Subject: Re: [Qemu-devel] ppc: regression in 2.7.0-rc3 on rfi/rfid/hrfi instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On Thu, 2016-08-25 at 11:31 +1000, Benjamin Herrenschmidt wrote: >  > 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. Reported-by: Hervé Poussineau Tested-by: Hervé Poussineau --- a/target-ppc/excp_helper.c +++ b/target-ppc/excp_helper.c @@ -959,8 +959,13 @@ static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr) { CPUState *cs = CPU(ppc_env_get_cpu(env)); - /* MSR:POW cannot be set by any form of rfi */ - msr &= ~(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 &= POWERPC_EXCP_BOOKE) { + msr &= ~(target_ulong)0xf0000; + } #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); } -#define MSR_BOOK3S_MASK #if defined(TARGET_PPC64) void helper_rfid(CPUPPCState *env) {