Re: [PATCH] powerpc: tiny memcpy_(to|from)io optimisation

2009-05-28 Thread Joakim Tjernlund
> Am 28.05.09 18:13 schrieb(en) Joakim Tjernlund: > > hmm, these do look a bit unoptimal anyway. Any reason not to write > > them something like below(written by me for uClibc long time ago). > > You will have to add eieio()/sync > > No (and I wasn't aware of th

Re: [PATCH] powerpc: tiny memcpy_(to|from)io optimisation

2009-05-31 Thread Joakim Tjernlund
> > Hi Jocke: > > Am 29.05.09 08:31 schrieb(en) Joakim Tjernlund: > > > No (and I wasn't aware of the PPC pre-inc vs. post-inc stuff) - I > > just > > > > I think this is true for most RISC based CPU's. It is a pity as > > post ops a

Re: [PATCH 2/4] 8xx: Avoid testing for kernel space in ITLB Miss.

2010-03-17 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 2010/03/16 22:19:36: > > On Fri, 2010-02-26 at 09:29 +0100, Joakim Tjernlund wrote: > > +#ifdef CONFIG_MODULES > > + /* Only modules will cause ITLB Misses as we always > > +* pin the first 8MB of kernel memory */ > >

Re: [PATCH 3/4] 8xx: Don't touch ACCESSED when no SWAP.

2010-03-17 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 2010/03/16 22:20:52: > > On Fri, 2010-02-26 at 09:29 +0100, Joakim Tjernlund wrote: > > Only the swap function cares about the ACCESSED bit in > > the pte. Do not waste cycles updateting ACCESSED when swap > > is not compiled into the

Re: Question regarding the DTLB Miss exceptions

2010-03-31 Thread Joakim Tjernlund
> > I'm tracking a problem that's leading me through DSI and DTLB miss > exceptions on an MPC8347 (e300c1 core), and I've come across an oddity > that I'm hoping someone can explain. > > When a DTLB Miss exception can't find a PTE for the virtual address being > written/read, it dummies up the SPRs

RE: JFFS2 corruption when mounting filesystem with filenames oflength> 7

2010-06-26 Thread Joakim Tjernlund
> > > -Original Message- > > From: linux-mtd-boun...@lists.infradead.org > > [mailto:linux-mtd-boun...@lists.infradead.org] On Behalf Of > > Steve Deiters > > Sent: Thursday, June 24, 2010 3:02 PM > > To: linux-...@lists.infradead.org > > Subject: RE: JFFS2 corruption when mounting filesyst

Re: machine check in kernel for a mpc870 board

2010-06-29 Thread Joakim Tjernlund
> From: Shawn Jin > > I'm porting a mpc870 board to the powerpc arch. The base is the > adder-875 board. My first try to boot the cuImage.my870 is > experiencing a machine check. And I have no clue where to look. Any > help? > > => bootm 100 > ## Booting image at 0100 ... >Image Name:

[PATCH] [spi_mpc83xx] Always enable legacy support.

2009-07-01 Thread Joakim Tjernlund
There are out of tree boards that need this legacy support too. Signed-off-by: Joakim Tjernlund --- I hope this is OK. I just discovered that spi didn't work for me in 2.6.30 and I have no time to work on coverting my boards. I don't have a clue either on how to do that, any pointers

Re: [PATCH] [spi_mpc83xx] Always enable legacy support.

2009-07-01 Thread Joakim Tjernlund
Anton Vorontsov wrote on 01/07/2009 23:12:12: > > On Wed, Jul 01, 2009 at 09:16:12PM +0200, Joakim Tjernlund wrote: > > There are out of tree boards that need this legacy support too. > > Heh. > > > Signed-off-by: Joakim Tjernlund > > --- > > I hope this i

Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-07-13 Thread Joakim Tjernlund
Anton Vorontsov wrote on 13/07/2009 17:19:11: > > Hi all, > > I've been sitting on these patches for some time, but now it appears > that the set_sync() feature is needed elsewhere. So here are the > patches. > > Joakim, I think this is what you need. Yes, it sure looks so :) I will have to look

Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-07-13 Thread Joakim Tjernlund
Joakim Tjernlund/Transmode wrote on 13/07/2009 18:01:02: > > Anton Vorontsov wrote on 13/07/2009 17:19:11: > > > > Hi all, > > > > I've been sitting on these patches for some time, but now it appears > > that the set_sync() feature is needed elsewhere. So

Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-07-13 Thread Joakim Tjernlund
Anton Vorontsov wrote on 13/07/2009 19:34:55: > > On Mon, Jul 13, 2009 at 06:01:02PM +0200, Joakim Tjernlund wrote: > > > > Anton Vorontsov wrote on 13/07/2009 17:19:11: > > > > > > Hi all, > > > > > > I've been sitting on these patche

Ang: Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-07-14 Thread Joakim Tjernlund
-Anton Vorontsov skrev: - >Till: Joakim Tjernlund >Från: Anton Vorontsov >Datum: 07/14/2009 00:20 >Kopia: David Brownell , >linux-ker...@vger.kernel.org, linuxppc-...@ozlabs.org >Ärende: Re: [PATCH 0/2] Setting GPIOs simultaneously > > >On Mon, Jul 13, 2009

Re: Ang: Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-08-04 Thread Joakim Tjernlund
Anton Vorontsov wrote on 15/07/2009 00:09:31: > > On Tue, Jul 14, 2009 at 11:20:13PM +0200, Joakim Tjernlund wrote: > [...] > > >But any users of the legacy bindings should be in-tree. > > > > ehh, it was working until you made it OF only. Why do call the native >

Re: Ang: Re: [PATCH 0/2] Setting GPIOs simultaneously

2009-08-04 Thread Joakim Tjernlund
Anton Vorontsov wrote on 04/08/2009 16:22:50: > > On Tue, Aug 04, 2009 at 03:38:40PM +0200, Joakim Tjernlund wrote: > > Anton Vorontsov wrote on 15/07/2009 00:09:31: > > > > > > On Tue, Jul 14, 2009 at 11:20:13PM +0200, Joakim Tjernlund wrote: > > > [..

Re: MPC866 FEC's Receive processing thru pre allocated buffers

2009-09-03 Thread Joakim Tjernlund
Ganesh Kumar wrote on 03/09/2009 06:45:14: > > Hi Tjernlund, > > Thanks a lot for the reply. > > I checked in my code regarding to the invalidate/flushing of the > data cache. In the fec_init its been done by calling the sequence > >/* Make it uncached.

[PATCH] i2c-mpc: Do not generate STOP after read.

2009-09-22 Thread Joakim Tjernlund
. Signed-off-by: Joakim Tjernlund --- This should also fix a problem reported by Esben Haabendal: [PATCH v2] i2c-mpc: generate START condition after STOP caused by read i2c_msg This fixes MAL (arbitration lost) bug caused by illegal use of RSTA (repeated START) after STOP condition generated after

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-25 Thread Joakim Tjernlund
> > > > I think there's more finishyness to 8xx than we thought. IE. That > > tlbil_va might have more reasons to be there than what the comment > > seems to advertize. Can you try to move it even higher up ? IE. > > Unconditionally at the beginning of set_pte_filter ? > > > > Also, if that doesn't

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-25 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 25/09/2009 11:47:34: > > On Fri, 2009-09-25 at 10:31 +0200, Joakim Tjernlund wrote: > > > > The main problem with 8xx it does not update the DAR register in > > the TLB Miss/Fault handlers for cache instructions :( It on old bug > >

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-27 Thread Joakim Tjernlund
> > Thus spake Benjamin Herrenschmidt (b...@kernel.crashing.org): > > > > > > I think there's more finishyness to 8xx than we thought. IE. That > > > tlbil_va might have more reasons to be there than what the comment > > > seems to advertize. Can you try to move it even higher up ? IE. > > > Uncond

Re: [PATCH] i2c-mpc: Do not generate STOP after read.

2009-09-27 Thread Joakim Tjernlund
Jean, I just noticed you pull request for i2c on LKML but I didn't see this patch nor have I got any feedback from you. What is your view? Jocke Wolfgang Grandegger wrote on 25/09/2009 12:01:17: > > Joakim Tjernlund wrote: > > The driver always ends a read with a STO

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-28 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 28/09/2009 05:21:00: > > On Sun, 2009-09-27 at 15:22 +0200, Joakim Tjernlund wrote: > > > However, adding tlbil_va() to ptep_set_access_flags() as you suggested > > > makes everything happy. I need to test it some more, but it looks good >

Re: [PATCH] i2c-mpc: Do not generate STOP after read.

2009-09-28 Thread Joakim Tjernlund
Jean Delvare wrote on 28/09/2009 09:28:09: > > On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > > Jean, I just noticed you pull request for i2c on LKML but I didn't see this > > patch nor have I got any feedback from you. What is your view? > > My view is

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-28 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 28/09/2009 09:34:46: > > On Mon, 2009-09-28 at 09:22 +0200, Joakim Tjernlund wrote: > > > > > happy to stick with it until somebody comes up with a real good > > reason > > > to do more :-) 8xx is on life support and has been aro

Re: [PATCH] i2c-mpc: Do not generate STOP after read.

2009-09-28 Thread Joakim Tjernlund
Jean Delvare wrote on 28/09/2009 09:34:34: > > On Mon, 28 Sep 2009 09:30:32 +0200, Joakim Tjernlund wrote: > > Jean Delvare wrote on 28/09/2009 09:28:09: > > > > > > On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > > > > Jean, I just noti

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-28 Thread Joakim Tjernlund
> > Benjamin Herrenschmidt wrote on 28/09/2009 > 05:21:00: > > > > On Sun, 2009-09-27 at 15:22 +0200, Joakim Tjernlund wrote: > > > > However, adding tlbil_va() to ptep_set_access_flags() as you suggested > > > > makes everything happy. I need to te

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-28 Thread Joakim Tjernlund
> > Thus spake Benjamin Herrenschmidt (b...@kernel.crashing.org): > > > On Thu, 2009-09-24 at 18:35 -0700, Rex Feany wrote: > > > > > > Then I can boot and get to a shell, but userspace is slow. 8 seconds > > > to mount > > > /proc (vs. less then a second using my old kernel)! Maybe this is an > >

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-29 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 29/09/2009 09:07:37: > > On Tue, 2009-09-29 at 08:26 +0200, Joakim Tjernlund wrote: > > > I've tried sticking tlbil_va() in those places, nothing seems to > > help. > > > In some cases userspace is slow, in other cases userspa

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-29 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 29/09/2009 10:16:38: > > > > hmm, yes. You do get this and mysterious SEGV if you hit the but so does > > other bugs too so this is probably due to missing invalidation. > > > > I suspect that something like below will fix the problem and > > is the "correct" fix(un

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-29 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 29/09/2009 10:16:38: > > > > hmm, yes. You do get this and mysterious SEGV if you hit the but so does > > other bugs too so this is probably due to missing invalidation. > > > > I suspect that something like below will fix the problem and > > is the "correct" fix(un

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-30 Thread Joakim Tjernlund
Rex Feany wrote on 29/09/2009 23:03:31: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > Benjamin Herrenschmidt wrote on 29/09/2009 > > 10:16:38: > > > > > > > > > > hmm, yes. You do get this and mysterious SEGV if you hi

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-30 Thread Joakim Tjernlund
> > Rex Feany wrote on 29/09/2009 23:03:31: > > > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > > Benjamin Herrenschmidt wrote on 29/09/2009 > > > 10:16:38: > > > > > > > > > > > > > hm

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-30 Thread Joakim Tjernlund
Rex Feany wrote on 30/09/2009 11:00:02: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > Ok, I have made some minor tweaks and added debug code in > > > do_page_fault(). Would be great if you could try on both > > > .31 and top of t

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-30 Thread Joakim Tjernlund
Rex Feany wrote on 30/09/2009 11:00:02: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > Ok, I have made some minor tweaks and added debug code in > > > do_page_fault(). Would be great if you could try on both > > > .31 and top of t

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-09-30 Thread Joakim Tjernlund
> > Rex Feany wrote on 30/09/2009 11:00:02: > > > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > > > Ok, I have made some minor tweaks and added debug code in > > > > do_page_fault(). Would be great if y

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-01 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 01/10/2009 00:35:59: > > > > > Had a look at linus tree and there is something I don't understand. > > > Your fix, e0908085fc2391c85b85fb814ae1df377c8e0dcb, fixes a problem > > > that was introduced by 8d30c14cab30d405a05f2aaceda1e9ad57800f36 but > > > 8d30c14cab30d

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-02 Thread Joakim Tjernlund
also fix the problem, though Rex seems to indicate > that is not the case. > > Now, we -might- have something else broken on 8xx, hard to tell. You may > want to try to bisect, adding back the removed tlbil_va() as you go > backward, between .31 and upstream... Found something odd, perha

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-02 Thread Joakim Tjernlund
ix the problem, though Rex seems to indicate > > that is not the case. > > > > Now, we -might- have something else broken on 8xx, hard to tell. You may > > want to try to bisect, adding back the removed tlbil_va() as you go > > backward, between .31 and upstream... &g

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-03 Thread Joakim Tjernlund
a load (assuming trap is 0x400) Do you know what insn this is? I am adding a patch last in this mail for catching dcbX insn in do_page_fault() You need the patch I posted yesterday too: >From c5f1a70561730b8a443f7081fbd9c5b023147043 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Fri, 2 Oc

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-03 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 03/10/2009 10:31:18: > > On Sat, 2009-10-03 at 10:05 +0200, Joakim Tjernlund wrote: > > Cannot shake the feeling that it this snip of code that causes it > > lwz r11, 0(r10) /* Get the level 1 entry */ > > rlwinm. r1

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-03 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 03/10/2009 12:57:28: > On Sat, 2009-10-03 at 11:24 +0200, Joakim Tjernlund wrote: > > > > So yes, there is a missing _tlbil_va() missing for 8xx somewhere > > but there is something more too. > > Maybe your new filter functions and

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-04 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 03/10/2009 12:57:28: > > On Sat, 2009-10-03 at 11:24 +0200, Joakim Tjernlund wrote: > > > > So yes, there is a missing _tlbil_va() missing for 8xx somewhere > > but there is something more too. > > Maybe your new filter functions

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-04 Thread Joakim Tjernlund
Scott Wood wrote on 02/10/2009 23:49:49: > > On Thu, Oct 01, 2009 at 08:35:59AM +1000, Benjamin Herrenschmidt wrote: > > >From what I can see, the TLB miss code will check _PAGE_PRESENT, and > > when not set, it will -still- insert something into the TLB (unlike > > all other CPU types that go str

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-04 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 04/10/2009 22:26:42: > On Sun, 2009-10-04 at 10:35 +0200, Joakim Tjernlund wrote: > > Benjamin Herrenschmidt wrote on 03/10/2009 > > 12:57:28: > > > > > > On Sat, 2009-10-03 at 11:24 +0200, Joakim Tjernlund wrote: > >

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-04 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 04/10/2009 22:28:38: > > > I have managed to update the TLB code to make proper use of dirty and > > accessed states. > > Advantages are: > > - I/D TLB Miss never needs to write to the linux pte, saving a few cycles > > That's good, that leaves us with only 40x to

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-05 Thread Joakim Tjernlund
tree but I can port it to 2.6 if you guys > > can test it for me. So it was easy to update the patch for 2.6, this is on top of "powerpc, 8xx: DTLB Error must check for more errors." You probably need the extra tlbil_va(), but let us know if you can get away without it. Scott and R

[PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
disregard other patches from me and try these out instead. Joakim Tjernlund (6): 8xx: DTLB Error must check for more errors. 8xx, fault: Add some debug code to do_page_fault() 8xx: get rid of _PAGE_HWWRITE dependency in MMU. 8xx: Tag DAR with 0x00f0 to catch buggy instructions. 8xx: Fixup DAR

[PATCH 1/6] 8xx: DTLB Error must check for more errors.

2009-10-05 Thread Joakim Tjernlund
DataTLBError currently does: if ((err & 0x0200) == 0) DSI(); This won't handle a store with no valid translation. Change this to if ((err & 0x4800) != 0) DSI(); that is, branch to DSI if either !permission or !translation. --- arch/powerpc/kernel/head_8xx.S |4 ++-- 1 files c

[PATCH 5/6] 8xx: Fixup DAR from buggy dcbX instructions.

2009-10-05 Thread Joakim Tjernlund
This is an assembler version to fixup DAR not being set by dcbX, icbi instructions. There are two versions, one uses selfmodifing code(default), the other uses jump table but is much bigger. --- arch/powerpc/kernel/head_8xx.S | 146 +++- 1 files changed, 145 in

[PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED. Pros: - I/D TLB Miss never needs to write to the linux pte. - _PAGE_ACCESSED is only set on I/D TLB Error fixing accounting - _PAGE_DIRTY is mapped to 0x100, the changed bit, and is set directly when a page has been made

[PATCH 2/6] 8xx, fault: Add some debug code to do_page_fault()

2009-10-05 Thread Joakim Tjernlund
--- arch/powerpc/mm/fault.c | 82 +++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 7699394..c33c6de 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -139,6

[PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions.

2009-10-05 Thread Joakim Tjernlund
dcbz, dcbf, dcbi, dcbst and icbi do not set DAR when they cause a DTLB Error. Dectect this by tagging DAR with 0x00f0 at every exception exit that modifies DAR. Test for DAR=0x00f0 in DataTLBError and bail to handle_page_fault(). --- arch/powerpc/kernel/head_8xx.S | 19 --- 1 fil

[PATCH 6/6] 8xx: start using dcbX instructions in various copy routines

2009-10-05 Thread Joakim Tjernlund
Now that 8xx can fixup dcbX instructions, start using them where possible like every other PowerPc arch do. --- arch/powerpc/kernel/misc_32.S | 18 -- arch/powerpc/lib/copy_32.S| 24 2 files changed, 0 insertions(+), 42 deletions(-) diff --git a/ar

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Scott Wood wrote on 05/10/2009 20:12:34: > > On Mon, Oct 05, 2009 at 02:16:33PM +0200, Joakim Tjernlund wrote: > > Here are my latest code to fixup 8xx's TLB code. > > This code needs some serious testing before it > > can be commited. > > The "8xx, fau

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-05 Thread Joakim Tjernlund
Scott Wood wrote on 05/10/2009 20:24:29: > > On Sat, Oct 03, 2009 at 10:05:46AM +0200, Joakim Tjernlund wrote: > > Scott Wood wrote on 02/10/2009 23:49:49: > > > Adding a tlbil_va to do_page_fault makes the problem go away for me (on > > > top of your "merge&qu

Re: [PATCH] powerpc/8xx: fix regression introduced by cache coherency rewrite

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 04/10/2009 22:28:38: > > > > I have managed to update the TLB code to make proper use of dirty and > > accessed states. > > Advantages are: > > - I/D TLB Miss never needs to write to the linux pte, saving a few cycles > > That's good, that leaves us with only 40x

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Scott Wood wrote on 05/10/2009 22:09:41: > > On Mon, Oct 05, 2009 at 08:27:39PM +0200, Joakim Tjernlund wrote: > > > After resolving the conflict, without adding tlbil_va in do_page_fault(), > > > I > > > get the same stuck behavior as before. > > >

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 05/10/2009 22:17:04: > > On Mon, 2009-10-05 at 14:16 +0200, Joakim Tjernlund wrote: > > Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED. > > Pros: > > - I/D TLB Miss never needs to write to the linux pte. > >

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 05/10/2009 23:31:39: > > > > Yes, every ld.so uses dcbX and icbi insn when relocatin code. > > Even with -msecure-plt ? hmm, maybe not. Can't remember now. But perhaps LAZY relocs still need dcbX? Easiest is to check in uClibc. I impl. it, but was to long time ago

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 05/10/2009 23:37:23: > > On Mon, 2009-10-05 at 23:25 +0200, Joakim Tjernlund wrote: > > > > Benjamin Herrenschmidt wrote on 05/10/2009 > > 22:17:04: > > > > > > On Mon, 2009-10-05 at 14:16 +0200, Joakim Tjernlund wrote:

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Rex Feany wrote on 06/10/2009 00:04:20: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > Scott and Rex, please disregard other patches from me and > > try these out instead. > > I have results similar to Scott's. I tried both with and withou

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 00:09:16: > > On Tue, 2009-10-06 at 00:00 +0200, Joakim Tjernlund wrote: > > Benjamin Herrenschmidt wrote on 05/10/2009 > > 23:37:23: > > > > > > On Mon, 2009-10-05 at 23:25 +0200, Joakim Tjernlund wrote: > >

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Rex Feany wrote on 06/10/2009 00:42:18: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > I got this oops: > > > > > > Unable to handle kernel paging request for data at address 0x > > > Faulting instruction address: 0xc

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 00:37:28: > > On Tue, 2009-10-06 at 00:31 +0200, Joakim Tjernlund wrote: > > > > regs or regs->nip is NULL? Either one does not make sense > > In any case it might be a secondary problem as DAR is NULL already > >

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 01:15:39: > > On Tue, 2009-10-06 at 00:55 +0200, Joakim Tjernlund wrote: > > > Sure but if dirty is cleared by the kernel, then you also need to > > remove > > > write permission in the TLB or it will miss setting dirty on t

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 00:37:28: > > On Tue, 2009-10-06 at 00:31 +0200, Joakim Tjernlund wrote: > > > > regs or regs->nip is NULL? Either one does not make sense > > In any case it might be a secondary problem as DAR is NULL already > >

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-05 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 02:34:15: > > On Tue, 2009-10-06 at 01:35 +0200, Joakim Tjernlund wrote: > > > > > Well, if the HW has the ability to enforce trap when store with ! > > DIRTY, > > > > Yes, provided that the kernel invalidates the

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-05 Thread Joakim Tjernlund
Rex Feany wrote on 06/10/2009 00:42:18: > > Thus spake Joakim Tjernlund (joakim.tjernl...@transmode.se): > > > > I got this oops: > > > > > > Unable to handle kernel paging request for data at address 0x > > > Faulting instruction address: 0xc

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 08:45:47: > > On Tue, 2009-10-06 at 08:15 +0200, Joakim Tjernlund wrote: > > > Yes, I would too but TLB Miss knows nothing about load/store, protection > > etc. > > because DSISR isn't set. So I cannot see any other

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 03:52:15: > > \ > > So how does this look? Does it change anything? > > It should as the previous way was way off :( > > > > diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c > > index c33c6de..08a392f 100644 > > --- a/arch/powerpc/mm/fault.c

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-06 Thread Joakim Tjernlund
> > > > > No, use get_user() not __get_user() or if you use the later, also use > > > access_ok(), and test the result in case it errors (if it does, you > > > probably want to just goto bad access and SEGV). > > > > OK, lets see what this gives us: > > Hrm... did you change anything ? :-) Yes, se

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 13:06:26: > From: > > Benjamin Herrenschmidt > > To: > > Joakim Tjernlund > > Cc: > > "linuxppc-...@ozlabs.org" , Rex Feany > , Scott Wood > > Date: > > 06/10/2009 13:06 > > Subject: &

Re: [PATCH 0/6] PowerPc 8xx TLB/MMU fixes

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 13:06:26: > > On Tue, 2009-10-06 at 12:58 +0200, Joakim Tjernlund wrote: > > > Here I don't care if err. insn will be 0 if it fails and the following > > if will be false > > I'd rather you use get_user() so i

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 08:45:47: > > On Tue, 2009-10-06 at 08:15 +0200, Joakim Tjernlund wrote: > > > Yes, I would too but TLB Miss knows nothing about load/store, protection > > etc. > > because DSISR isn't set. So I cannot see any other

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-06 Thread Joakim Tjernlund
> > Benjamin Herrenschmidt wrote on 06/10/2009 > 08:45:47: > > > > On Tue, 2009-10-06 at 08:15 +0200, Joakim Tjernlund wrote: > > > > > Yes, I would too but TLB Miss knows nothing about load/store, protection > > > etc. > > > because DSISR

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-06 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 06/10/2009 02:34:15: > > On Tue, 2009-10-06 at 01:35 +0200, Joakim Tjernlund wrote: > > > > > Well, if the HW has the ability to enforce trap when store with ! > > DIRTY, > > > > Yes, provided that the kernel invalidates the

Re: [PATCH 3/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 07/10/2009 03:07:35: > > Allright, did a bit of reading of doco and code.. hey, this is a super, thanks! > > Doco isn't totally clear though. At some stage, it -hints- that in case > of a TLB "error" (match on EA/ASID but incorrect > protection/valid/changed/...)

[PATCH 3/6] 8xx: invalidate non present TLBs

2009-10-07 Thread Joakim Tjernlund
8xx sometimes need to load a invalid/non-present TLBs in it DTLB asm handler. These must be invalidated separaly as linux mm don't. --- arch/powerpc/mm/fault.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 76

[PATCH 1/6] 8xx: DTLB Error must check for more errors.

2009-10-07 Thread Joakim Tjernlund
DataTLBError currently does: if ((err & 0x0200) == 0) DSI(); This won't handle a store with no valid translation. Change this to if ((err & 0x4800) != 0) DSI(); that is, branch to DSI if either !permission or !translation. --- arch/powerpc/kernel/head_8xx.S |4 ++-- 1 files c

[PATCH 0/6] 8xx TLB fixes.

2009-10-07 Thread Joakim Tjernlund
OK, here is the next try att fixing the MPC8xx MMU problems. Pleas add one(or two) patches at a time and test. Expect some trivial merge conflicts in 8xx header file, sorry about that. Joakim Tjernlund (6): 8xx: DTLB Error must check for more errors. 8xx: get rid of _PAGE_HWWRITE dependency

[PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED. Pros: - I/D TLB Miss never needs to write to the linux pte. - _PAGE_ACCESSED is only set on TLB Error fixing accounting - _PAGE_DIRTY is mapped to 0x100, the changed bit, and is set directly when a page has been made dir

[PATCH 5/6] 8xx: Fixup DAR from buggy dcbX instructions.

2009-10-07 Thread Joakim Tjernlund
This is an assembler version to fixup DAR not being set by dcbX, icbi instructions. There are two versions, one uses selfmodifing code(default), the other uses jump table but is much bigger. --- arch/powerpc/kernel/head_8xx.S | 146 +++- 1 files changed, 145 in

[PATCH 6/6] 8xx: start using dcbX instructions in various copy routines

2009-10-07 Thread Joakim Tjernlund
Now that 8xx can fixup dcbX instructions, start using them where possible like every other PowerPc arch do. --- arch/powerpc/kernel/misc_32.S | 18 -- arch/powerpc/lib/copy_32.S| 24 2 files changed, 0 insertions(+), 42 deletions(-) diff --git a/ar

[PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions.

2009-10-07 Thread Joakim Tjernlund
dcbz, dcbf, dcbi, dcbst and icbi do not set DAR when they cause a DTLB Error. Dectect this by tagging DAR with 0x00f0 at every exception exit that modifies DAR. Test for DAR=0x00f0 in DataTLBError and bail to handle_page_fault(). --- arch/powerpc/kernel/head_8xx.S | 19 --- 1 fil

Re: [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 07/10/2009 23:14:52: > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund wrote: > > > + andi. r11, r10, _PAGE_USER | _PAGE_ACCESSED > > + cmpwi cr0, r11, _PAGE_USER | _PAGE_ACCESSED > > + bne- cr0, 2f >

Re: [PATCH 3/6] 8xx: invalidate non present TLBs

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 07/10/2009 23:18:05: > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund wrote: > > 8xx sometimes need to load a invalid/non-present TLBs in > > it DTLB asm handler. > > These must be invalidated separaly as linux mm don't. >

Re: [PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 07/10/2009 23:18:21: > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund wrote: > > dcbz, dcbf, dcbi, dcbst and icbi do not set DAR when they > > cause a DTLB Error. Dectect this by tagging DAR with 0x00f0 > > at every exception exit tha

Re: [PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 08/10/2009 00:21:24: > > On Thu, 2009-10-08 at 00:13 +0200, Joakim Tjernlund wrote: > > Benjamin Herrenschmidt wrote on 07/10/2009 > > 23:18:21: > > > > > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund wrote: > > &

Re: [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 08/10/2009 00:20:17: > > On Thu, 2009-10-08 at 00:08 +0200, Joakim Tjernlund wrote: > > > > Benjamin Herrenschmidt wrote on 07/10/2009 > > 23:14:52: > > > > > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund

Re: [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Joakim Tjernlund/Transmode wrote on 08/10/2009 01:11:23: > > Benjamin Herrenschmidt wrote on 08/10/2009 > 00:20:17: > > > > On Thu, 2009-10-08 at 00:08 +0200, Joakim Tjernlund wrote: > > > > > > Benjamin Herrenschmidt wrote on 07/10/2009 > > > 23

Re: [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 08/10/2009 02:04:56: > > > > Yes it does. If one adds HWEXEC it will fail, right? > > Why ? We can just filter out DSISR, we don't really care why it failed > as long as we know whether it was a store or not. > > > Also this count as a read and you could easily end

Re: [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU.

2009-10-07 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 08/10/2009 02:28:19: > > On Thu, 2009-10-08 at 02:19 +0200, Joakim Tjernlund wrote: > > Benjamin Herrenschmidt wrote on 08/10/2009 > > 02:04:56: > > > > > > > > > > Yes it does. If one adds HWEXEC it will fail,

[PATCH 0/6] 8xx MMU fixes

2009-10-08 Thread Joakim Tjernlund
So here we go again. This time I am fairly confindent I got most things correct :) Also manged to use even less instructions in the TLB Miss handlers. Scott and Rex, forget previous versions and try this one out. Once this works we can discuss further enchantments. Joakim Tjernlund (6): 8xx

[PATCH 3/6] 8xx: invalidate non present TLBs

2009-10-08 Thread Joakim Tjernlund
8xx sometimes need to load a invalid/non-present TLBs in it DTLB asm handler. These must be invalidated separaly as linux mm don't. --- arch/powerpc/mm/fault.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 76

[PATCH 5/6] 8xx: Fixup DAR from buggy dcbX instructions.

2009-10-08 Thread Joakim Tjernlund
This is an assembler version to fixup DAR not being set by dcbX, icbi instructions. There are two versions, one uses selfmodifing code, the other uses a jump table but is much bigger(default). --- arch/powerpc/kernel/head_8xx.S | 146 +++- 1 files changed, 145

[PATCH 1/6] 8xx: DTLB Error must check for more errors.

2009-10-08 Thread Joakim Tjernlund
DataTLBError currently does: if ((err & 0x0200) == 0) DSI(); This won't handle a store with no valid translation. Change this to if ((err & 0x4800) != 0) DSI(); that is, branch to DSI if either !permission or !translation. --- arch/powerpc/kernel/head_8xx.S |4 ++-- 1 files c

[PATCH 2/6] 8xx: Update TLB asm so it behaves as linux mm expects.

2009-10-08 Thread Joakim Tjernlund
Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED. Get rid of _PAGE_HWWRITE too. Pros: - I/D TLB Miss never needs to write to the linux pte. - _PAGE_ACCESSED is only set on TLB Error fixing accounting - _PAGE_DIRTY is mapped to 0x100, the changed bit, and is set directly

[PATCH 6/6] 8xx: start using dcbX instructions in various copy routines

2009-10-08 Thread Joakim Tjernlund
Now that 8xx can fixup dcbX instructions, start using them where possible like every other PowerPc arch do. --- arch/powerpc/kernel/misc_32.S | 18 -- arch/powerpc/lib/copy_32.S| 24 2 files changed, 0 insertions(+), 42 deletions(-) diff --git a/ar

[PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions.

2009-10-08 Thread Joakim Tjernlund
dcbz, dcbf, dcbi, dcbst and icbi do not set DAR when they cause a DTLB Error. Dectect this by tagging DAR with 0x00f0 at every exception exit that modifies DAR. Test for DAR=0x00f0 in DataTLBError and bail to handle_page_fault(). --- arch/powerpc/kernel/head_8xx.S | 15 ++- 1 files c

Re: [PATCH 3/6] 8xx: invalidate non present TLBs

2009-10-08 Thread Joakim Tjernlund
Benjamin Herrenschmidt wrote on 07/10/2009 23:18:05: > > On Wed, 2009-10-07 at 22:46 +0200, Joakim Tjernlund wrote: > > 8xx sometimes need to load a invalid/non-present TLBs in > > it DTLB asm handler. > > These must be invalidated separaly as linux mm don't. >

<    1   2   3   4   5   6   7   8   >