From patchwork Fri Oct 16 08:16:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 36180 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 647DDB7E2C for ; Fri, 16 Oct 2009 19:20:27 +1100 (EST) Received: by ozlabs.org (Postfix) id EE46AB7BB2; Fri, 16 Oct 2009 19:20:20 +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 88045B7B8D for ; Fri, 16 Oct 2009 19:20:20 +1100 (EST) Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id D0E9A650002; Fri, 16 Oct 2009 10:20:15 +0200 (CEST) In-Reply-To: <20091015165650.GA3837@compile2.chatsunix.int.mrv.com> References: <1255597466-30976-1-git-send-email-Joakim.Tjernlund@transmode.se> <20091015165650.GA3837@compile2.chatsunix.int.mrv.com> Subject: Re: [PATCH 0/8] Fix 8xx MMU/TLB X-KeepSent: F665748B:AAF26319-C1257651:00296F23; type=4; name=$KeepSent To: Rex Feany X-Mailer: Lotus Notes Release 8.5.1 September 28, 2009 Message-ID: From: Joakim Tjernlund Date: Fri, 16 Oct 2009 10:16:07 +0200 X-MIMETrack: Serialize by Router on sesr04/Transmode(Release 8.5 HF942|October 08, 2009) at 2009-10-16 10:20:15 MIME-Version: 1.0 Cc: Scott Wood , "linuxppc-dev@ozlabs.org" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Rex Feany wrote on 15/10/2009 18:56:50: > > arch/powerpc/kernel/head_8xx.o: In function `FixupDAR': > /home/rfeany/src/lnxnm/linux-dev/arch/powerpc/kernel/head_8xx.S:576: undefined > reference to `DARfix' > > With all of your patches applied I have this problem: > > open("/proc/mounts", O_RDONLY) = 3 > fstat64(0x3, 0x7fc6ad58) = 0 > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3001f000 > read(3, 0x3001f000, 1024) = -1 EFAULT (Bad address) > exit_group(0) = ? > > but it works fine with /dev/zero: > > open("/dev/zero", O_RDONLY) = 3 > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x30001000 > read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 > \0"..., 1024) = 1024 > > If I revert "8xx: start using dcbX instructions in various copy > routines" then it works again. I think it is the cache instructions > added to __copy_tofrom_user: reading from /dev/zero is OK (it uses > __clear_user, no dcbX), but copy_to_user() fails. Yes, only copy_tofrom_user will actually case a TLBError with the dcbX insn. > > It seems stable with all but the dcbX patch applied. I haven't been able > to crash it yet, anyway :) Right, it is the pte table walk that is blowing up. I just noted that 2.6 lacks a tophys() call in its table walk so I removed that one(there is one more tophys call but I don't think it should be removed). Try this addon patch: diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 3df4a17..0e91da4 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -540,7 +540,6 @@ DARFixed:/* Return from dcbx instruction bug workaround, r10 holds value of DAR mtspr SPRN_MD_EPN, r10 mfspr r11, SPRN_M_TWB /* Get level 1 table entry address */ lwz r11, 0(r11) /* Get the level 1 entry */ - tophys (r11, r11) DO_8xx_CPU6(0x3b80, r3) mtspr SPRN_MD_TWC, r11 /* Load pte table base address */ mfspr r11, SPRN_MD_TWC /* ....and get the pte address */