parisc: disable UP-optimized flush_tlb_mm
authorKyle McMartin <kyle@infradead.org>
Tue, 23 Dec 2008 13:44:30 +0000 (08:44 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Dec 2008 01:03:21 +0000 (17:03 -0800)
flush_tlb_mm's "optimized" uniprocessor case of allocating a new
context for userspace is exposing a race where we can suddely return
to a syscall with the protection id and space id out of sync, trapping
on the next userspace access.

Debugged-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/parisc/include/asm/tlbflush.h

index b72ec66..1f6fd4f 100644 (file)
@@ -44,9 +44,12 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 {
        BUG_ON(mm == &init_mm); /* Should never happen */
 
-#ifdef CONFIG_SMP
+#if 1 || defined(CONFIG_SMP)
        flush_tlb_all();
 #else
+       /* FIXME: currently broken, causing space id and protection ids
+        *  to go out of sync, resulting in faults on userspace accesses.
+        */
        if (mm) {
                if (mm->context != 0)
                        free_sid(mm->context);