Skip to contentSkip to conversation

Fix 8xx tlbie definition

RFC In review Josh Boyer 5 participants 7 messages Nov 16, 2007 – Nov 18, 2007

lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

RFC 1/1 Fix 8xx tlbie definition

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

include/asm-powerpc/tlbflush.h +27 -6
Index: linux-2.6/include/asm-powerpc/tlbflush.h
===================================================================
@@ -28,19 +28,33 @@
 
 #include <linux/mm.h>
 
+#if defined(CONFIG_8xx)
+/* 8xx doesn't use PID for TLB invalidates */
+extern void _tlbie(unsigned address);
+#define _tlbia()	asm volatile ("tlbia; sync" : : : "memory")
+
+static inline void flush_tlb_page(struct vm_area_struct *vma,
+				  unsigned long vmaddr)
+{
+	_tlbie(vmaddr);
+}
+
+static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
+					 unsigned long vmaddr)
+{
+	_tlbie(vmaddr);
+}
+
+#else /* 4xx or FSL_BOOKE */
+
 extern void _tlbie(unsigned long address, unsigned int pid);
 
-#if defined(CONFIG_40x) || defined(CONFIG_8xx)
+#if defined(CONFIG_40x)
 #define _tlbia()	asm volatile ("tlbia; sync" : : : "memory")
 #else /* CONFIG_44x || CONFIG_FSL_BOOKE */
 extern void _tlbia(void);
 #endif
 
-static inline void flush_tlb_mm(struct mm_struct *mm)
-{
-	_tlbia();
-}
-
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 				  unsigned long vmaddr)
 {
@@ -53,6 +67,13 @@ static inline void flush_tlb_page_nohash
 	_tlbie(vmaddr, vma->vm_mm->context.id);
 }
 
+#endif /* CONFIG_8xx */
+
+static inline void flush_tlb_mm(struct mm_struct *mm)
+{
+	_tlbia();
+}
+
 static inline void flush_tlb_range(struct vm_area_struct *vma,
 				   unsigned long start, unsigned long end)
 {
#1 lore raw
Quoted 6 lines · Josh Boyer

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

That conflicts with the patch I posted to fix it differently (I kept the additional argument).

Which one do we take ?

Ben.

#2 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 5 lines · Josh Boyer

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

Quoted 6 lines
Quoted 1 line

That conflicts with the patch I posted to fix it differently (I kept the additional argument).

Which one do we take ?

Let's make _tlbia/_tlbie consistent on all archs.

- k

#3 lore raw
In reply to Benjamin Herrenschmidt
Quoted 7 lines · On Sat, 17 Nov 2007 08:06:29 +1100 Benjamin Herrenschmidt wrote:
Quoted 5 lines · Josh Boyer

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

Quoted 5 lines
Quoted 1 line

That conflicts with the patch I posted to fix it differently (I kept the additional argument).

Where can I grab it to give a try? My linuxppc archive is silent for some reason..

Quoted 2 lines

Which one do we take ?

If your solution will work out, I'd agree with Kumar to have this thing consistent. If not - It might be cheapier just to fix it this gross way, to keep 8xx stuff running.

Signature · 1 line
Sincerely, Vitaly
#4 lore raw
Quoted 10 lines · Vitaly Bordug
Quoted 7 lines · On Sat, 17 Nov 2007 08:06:29 +1100 Benjamin Herrenschmidt wrote:
Quoted 5 lines · Josh Boyer

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

That conflicts with the patch I posted to fix it differently (I kept the additional argument).

Where can I grab it to give a try? My linuxppc archive is silent for some reason..

Looks like I may have failed to post it ... weird, I was sure I posted that days ago, when Olof first mentioned the breakage. I'll check & resend.

Quoted 5 lines
Quoted 2 lines

Which one do we take ?

If your solution will work out, I'd agree with Kumar to have this thing consistent. If not - It might be cheapier just to fix it this gross way, to keep 8xx stuff running.

Ben.

#5 lore raw
Quoted 18 lines · On Sat, 17 Nov 2007 12:05:47 +1100 Benjamin Herrenschmidt…
Quoted 16 lines · Vitaly Bordug
Quoted 12 lines · On Sat, 17 Nov 2007 08:06:29 +1100 Benjamin Herrenschmidt wrote:
Quoted 6 lines · Josh Boyer

Git commit e701d269aa28996f3502780951fe1b12d5d66b49 introduced an incorrect definition for _tlbie on PowerPC 8xx platforms. Only the address should be passed to the function. This patch corrects the definition of _tlbie and the related tlb flushing functions for 8xx.

That conflicts with the patch I posted to fix it differently (I kept the additional argument).

Quoted 5 lines
Quoted 1 line

Where can I grab it to give a try? My linuxppc archive is silent for some reason..

Looks like I may have failed to post it ... weird, I was sure I posted that days ago, when Olof first mentioned the breakage. I'll check & resend.

I never saw it. If I had, I wouldn't have bothered to post my own version :)

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Which one do we take ?

If your solution will work out, I'd agree with Kumar to have this thing consistent. If not - It might be cheapier just to fix it this gross way, to keep 8xx stuff running.

Consistency is fine with me. I was going for quick and dirty to make sure it wasn't broken in .24.

josh

#6 lore raw
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Where can I grab it to give a try? My linuxppc archive is silent for some reason..

Looks like I may have failed to post it ... weird, I was sure I posted that days ago, when Olof first mentioned the breakage. I'll check & resend.

I never saw it. If I had, I wouldn't have bothered to post my own version :)

we still haven't seen ben's version :)

- k