All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
@ 2004-06-05 19:56 Mikael Pettersson
  2004-06-05 22:29 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Pettersson @ 2004-06-05 19:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev, paulus

The current 2.6.7-rc2 kernel hangs after starting INIT
on my PowerMac 4400. I traced the problem to the
ptep_set_access_flags() patch in 2.6.7-rc1-bk4, which
replaces ptep_establish()'s set_pte();flush_tlb_page()
sequence with a single pte_update() in two places in
mm/memory.c.

The patch below disables this change on ppc32, and
allows my 603ev-based PM4400 to finally boot 2.6.7-rc2.

/Mikael

diff -ruN linux-2.6.7-rc2/include/asm-ppc/pgtable.h linux-2.6.7-rc2.ppc-pgtable-fix/include/asm-ppc/pgtable.h
--- linux-2.6.7-rc2/include/asm-ppc/pgtable.h	2004-06-05 19:56:55.000000000 +0200
+++ linux-2.6.7-rc2.ppc-pgtable-fix/include/asm-ppc/pgtable.h	2004-06-05 19:58:43.000000000 +0200
@@ -548,6 +548,7 @@
 	pte_update(ptep, 0, _PAGE_DIRTY);
 }
 
+#if 0
 #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
 {
@@ -557,6 +558,7 @@
 }
 #define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
         __ptep_set_access_flags(__ptep, __entry, __dirty)
+#endif
 
 /*
  * Macro to mark a page protection value as "uncacheable".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
  2004-06-05 19:56 Mikael Pettersson
@ 2004-06-05 22:29 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-05 22:29 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: Linux Kernel list, linuxppc-dev list, Paul Mackerras

On Sat, 2004-06-05 at 14:56, Mikael Pettersson wrote:
> The current 2.6.7-rc2 kernel hangs after starting INIT
> on my PowerMac 4400. I traced the problem to the
> ptep_set_access_flags() patch in 2.6.7-rc1-bk4, which
> replaces ptep_establish()'s set_pte();flush_tlb_page()
> sequence with a single pte_update() in two places in
> mm/memory.c.
> 
> The patch below disables this change on ppc32, and
> allows my 603ev-based PM4400 to finally boot 2.6.7-rc2.

Can you try just adding the flush_tlb_page() to
ptep_set_access_flags() and let me know if that helps ? I need
to figure out what's wrong with "manual" TLB loads, I suspect
it's the same problem the 8xx folks are hitting, but I don't
see why at this point.

Ben.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
@ 2004-06-06  1:39 Mikael Pettersson
  2004-06-06  1:50 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Pettersson @ 2004-06-06  1:39 UTC (permalink / raw)
  To: benh; +Cc: linux-kernel, linuxppc-dev, paulus

On Sat, 05 Jun 2004 17:29:23 -0500, Benjamin Herrenschmidt wrote:
>On Sat, 2004-06-05 at 14:56, Mikael Pettersson wrote:
>> The current 2.6.7-rc2 kernel hangs after starting INIT
>> on my PowerMac 4400. I traced the problem to the
>> ptep_set_access_flags() patch in 2.6.7-rc1-bk4, which
>> replaces ptep_establish()'s set_pte();flush_tlb_page()
>> sequence with a single pte_update() in two places in
>> mm/memory.c.
>> 
>> The patch below disables this change on ppc32, and
>> allows my 603ev-based PM4400 to finally boot 2.6.7-rc2.
>
>Can you try just adding the flush_tlb_page() to
>ptep_set_access_flags() and let me know if that helps ?

That (see below) also works and allows 2.6.7-rc2 to
boot on my PM4400.

/Mikael

--- linux-2.6.7-rc2/include/asm-ppc/pgtable.h.~1~	2004-06-06 03:17:36.000000000 +0200
+++ linux-2.6.7-rc2/include/asm-ppc/pgtable.h	2004-06-06 03:19:59.000000000 +0200
@@ -556,7 +556,10 @@
 	pte_update(ptep, 0, bits);
 }
 #define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-        __ptep_set_access_flags(__ptep, __entry, __dirty)
+do { \
+        __ptep_set_access_flags(__ptep, __entry, __dirty); \
+	flush_tlb_page(__vma, __address); \
+} while(0)
 
 /*
  * Macro to mark a page protection value as "uncacheable".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
  2004-06-06  1:39 Mikael Pettersson
@ 2004-06-06  1:50 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-06  1:50 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: Linux Kernel list, linuxppc-dev list, Paul Mackerras


> That (see below) also works and allows 2.6.7-rc2 to
> boot on my PM4400.

Ok, that's not normal though, as we are only relaxing permissions,
so we must be missing something in the DSI handler or such. Can you
try to look at what the CPU is doing when hitting that loop ? It must
be taking the same exception over and over again...

Ben.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
@ 2004-06-06 11:17 Mikael Pettersson
  2004-06-06 20:48 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Pettersson @ 2004-06-06 11:17 UTC (permalink / raw)
  To: benh; +Cc: linux-kernel, linuxppc-dev, paulus

On Sat, 05 Jun 2004 20:50:41 -0500, Benjamin Herrenschmidt wrote:
>> That (see below) also works and allows 2.6.7-rc2 to
>> boot on my PM4400.
>
>Ok, that's not normal though, as we are only relaxing permissions,
>so we must be missing something in the DSI handler or such. Can you
>try to look at what the CPU is doing when hitting that loop ? It must
>be taking the same exception over and over again...

According to Alt-SysRq, the current process is rc.sysinit,
its kernel-side is in __switch_to(), and the kernel is at
various points in page-fault/mm-fault handling.
So it's not hanging, but it's not making progress either.

/Mikael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
  2004-06-06 11:17 [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4 Mikael Pettersson
@ 2004-06-06 20:48 ` Benjamin Herrenschmidt
  2004-06-06 21:05   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-06 20:48 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: Linux Kernel list, linuxppc-dev list, Paul Mackerras

Ok, please  tell me if this patch works, I don't have a machine
to test here. If it's ok, I'll send it to andrew/linus.

===== include/asm-ppc/pgtable.h 1.33 vs edited =====
--- 1.33/include/asm-ppc/pgtable.h	2004-05-26 09:56:17 -05:00
+++ edited/include/asm-ppc/pgtable.h	2004-06-06 15:45:24 -05:00
@@ -555,8 +555,14 @@
 		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
 	pte_update(ptep, 0, bits);
 }
+
+extern void flush_one_tlb_entry_nohash(unsigned long addr);
+
 #define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-        __ptep_set_access_flags(__ptep, __entry, __dirty)
+	do {								   \
+		__ptep_set_access_flags(__ptep, __entry, __dirty);	   \
+		flush_one_tlb_entry_nohash(__address);		   	   \
+	} while(0)
 
 /*
  * Macro to mark a page protection value as "uncacheable".
===== arch/ppc/mm/tlb.c 1.10 vs edited =====
--- 1.10/arch/ppc/mm/tlb.c	2004-02-04 23:00:14 -06:00
+++ edited/arch/ppc/mm/tlb.c	2004-06-06 15:44:05 -05:00
@@ -67,6 +67,17 @@
 }
 
 /*
+ * Called by ptep_set_access_flags, must flush on CPUs for which the
+ * DSI handler can't just "fixup" the TLB on a write fault
+ */
+void flush_one_tlb_entry_nohash(unsigned long addr)
+{
+	if (Hash != 0)
+		return;
+	_tlbie(vmaddr);
+}
+
+/*
  * Called at the end of a mmu_gather operation to make sure the
  * TLB flush is completely done.
  */



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
  2004-06-06 20:48 ` Benjamin Herrenschmidt
@ 2004-06-06 21:05   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-06 21:05 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: Linux Kernel list, linuxppc-dev list, Paul Mackerras

On Sun, 2004-06-06 at 15:48, Benjamin Herrenschmidt wrote:
> Ok, please  tell me if this patch works, I don't have a machine
> to test here. If it's ok, I'll send it to andrew/linus.

Ok, here's one that builds and deals with 4xx and 8xx.

===== include/asm-ppc/pgtable.h 1.33 vs edited =====
--- 1.33/include/asm-ppc/pgtable.h	2004-05-26 09:56:17 -05:00
+++ edited/include/asm-ppc/pgtable.h	2004-06-06 16:02:27 -05:00
@@ -555,8 +555,12 @@
 		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
 	pte_update(ptep, 0, bits);
 }
+
 #define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-        __ptep_set_access_flags(__ptep, __entry, __dirty)
+	do {								   \
+		__ptep_set_access_flags(__ptep, __entry, __dirty);	   \
+		flush_tlb_page_nohash(__vma, __address);	       	   \
+	} while(0)
 
 /*
  * Macro to mark a page protection value as "uncacheable".
===== arch/ppc/mm/tlb.c 1.10 vs edited =====
--- 1.10/arch/ppc/mm/tlb.c	2004-02-04 23:00:14 -06:00
+++ edited/arch/ppc/mm/tlb.c	2004-06-06 16:01:05 -05:00
@@ -67,6 +67,17 @@
 }
 
 /*
+ * Called by ptep_set_access_flags, must flush on CPUs for which the
+ * DSI handler can't just "fixup" the TLB on a write fault
+ */
+void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
+{
+	if (Hash != 0)
+		return;
+	_tlbie(addr);
+}
+
+/*
  * Called at the end of a mmu_gather operation to make sure the
  * TLB flush is completely done.
  */



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4
@ 2004-06-06 23:26 Mikael Pettersson
  0 siblings, 0 replies; 8+ messages in thread
From: Mikael Pettersson @ 2004-06-06 23:26 UTC (permalink / raw)
  To: benh; +Cc: linux-kernel, linuxppc-dev, paulus

On Sun, 06 Jun 2004 15:48:01 -0500, Benjamin Herrenschmidt wrote:
>Ok, please  tell me if this patch works, I don't have a machine
>to test here. If it's ok, I'll send it to andrew/linus.

Yes, this (actually the two patches you already sent to Linus
and Andrew) fixes the problem on my 603.

/Mikael

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-06-06 23:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-06 11:17 [BUG] asm-ppc/pgtable.h breakage from 2.6.7-rc1-bk4 Mikael Pettersson
2004-06-06 20:48 ` Benjamin Herrenschmidt
2004-06-06 21:05   ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2004-06-06 23:26 Mikael Pettersson
2004-06-06  1:39 Mikael Pettersson
2004-06-06  1:50 ` Benjamin Herrenschmidt
2004-06-05 19:56 Mikael Pettersson
2004-06-05 22:29 ` Benjamin Herrenschmidt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.