From patchwork Thu Jan 13 22:21:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 78818 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 45191B7683 for ; Fri, 14 Jan 2011 09:22:19 +1100 (EST) Received: by ozlabs.org (Postfix) id EFFACB70AF; Fri, 14 Jan 2011 09:22:04 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from gw1.transmode.se (gw1.transmode.se [213.115.205.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9CA71B70A9 for ; Fri, 14 Jan 2011 09:22:04 +1100 (EST) Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id 60519650005; Thu, 13 Jan 2011 23:22:01 +0100 (CET) Received: from gentoo-jocke.transmode.se ([192.168.1.15]) by sesr04.transmode.se (Lotus Domino Release 8.5.2 HF88) with ESMTP id 2011011323220157-36140 ; Thu, 13 Jan 2011 23:22:01 +0100 Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.0) with ESMTP id p0DMM1r2001745; Thu, 13 Jan 2011 23:22:01 +0100 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id p0DMM13f001744; Thu, 13 Jan 2011 23:22:01 +0100 From: Joakim Tjernlund To: Scott Wood , Willy Tarreau , linuxppc-dev Subject: [PATCH 1/3] 8xx: Move invalidation of non present TLBs Date: Thu, 13 Jan 2011 23:21:53 +0100 Message-Id: <1294957315-1696-2-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1294957315-1696-1-git-send-email-Joakim.Tjernlund@transmode.se> References: <1294957315-1696-1-git-send-email-Joakim.Tjernlund@transmode.se> X-MIMETrack: Itemize by SMTP Server on sesr04/Transmode(Release 8.5.2 HF88|October 08, 2010) at 2011-01-13 23:22:01, Serialize by Router on sesr04/Transmode(Release 8.5.2 HF88|October 08, 2010) at 2011-01-13 23:22:01, Serialize complete at 2011-01-13 23:22:01 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org 8xx does not invalidate ~PRESENT TLBs, move the workaround in mm/fault.c here to keep 8xx quirks localized. Signed-off-by: Joakim Tjernlund --- arch/ppc/kernel/head_8xx.S | 12 ++++++++++-- arch/ppc/mm/fault.c | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S index 75acaa0..24b206c 100644 --- a/arch/ppc/kernel/head_8xx.S +++ b/arch/ppc/kernel/head_8xx.S @@ -221,7 +221,11 @@ DataAccess: mr r5,r20 mfspr r4,DAR stw r4,_DAR(r21) - li r20,0x00f0 + /* invalidate ~PRESENT TLBs, 8xx MMU don't do this */ + andis. r20,r5,0x4000 + beq+ 1f + tlbie r4 +1: li r20,0x00f0 mtspr DAR,r20 /* Tag DAR */ addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL @@ -238,7 +242,11 @@ InstructionAccess: addi r3,r1,STACK_FRAME_OVERHEAD mr r4,r22 mr r5,r23 - li r20,MSR_KERNEL + /* invalidate ~PRESENT TLBs, 8xx MMU don't do this */ + andis. r20,r5,0x4000 + beq+ 1f + tlbie r4 +1: li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ FINISH_EXCEPTION(do_page_fault) diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c index 874005a..8819fb1 100644 --- a/arch/ppc/mm/fault.c +++ b/arch/ppc/mm/fault.c @@ -116,13 +116,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, else is_write = error_code & 0x02000000; #endif /* CONFIG_4xx || CONFIG_BOOKE */ -#if defined(CONFIG_8xx) - /* 8xx does no invalidate TLBs that are ~PRESENT, - * do it here. - */ - if (error_code & 0x40000000) - _tlbie(address); -#endif #if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_fault_handler && regs->trap == 0x300) { debugger_fault_handler(regs);