[SPARC64]: Fix bugs in SMP TLB context version expiration handling.
authorDavid S. Miller <davem@davemloft.net>
Tue, 28 Feb 2006 01:56:51 +0000 (17:56 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 20 Mar 2006 09:14:08 +0000 (01:14 -0800)
1) We must flush the TLB, duh.

2) Even if the sw context was seen to be valid, the local cpu's
   hw context can be out of date, so reload it unconditionally.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/smp.c

index 5ff2483e70bfdb8642a76d4912dd7f6ce50d8b53..eb7c0f855ba7c03e1b3c0e59061660fd083aeee1 100644 (file)
@@ -909,14 +909,18 @@ void smp_receive_signal_client(int irq, struct pt_regs *regs)
         */
        mm = current->active_mm;
        if (likely(mm)) {
-               if (unlikely(!CTX_VALID(mm->context))) {
-                       unsigned long flags;
+               unsigned long flags;
 
-                       spin_lock_irqsave(&mm->context.lock, flags);
+               spin_lock_irqsave(&mm->context.lock, flags);
+
+               if (unlikely(!CTX_VALID(mm->context)))
                        get_new_mmu_context(mm);
-                       load_secondary_context(mm);
-                       spin_unlock_irqrestore(&mm->context.lock, flags);
-               }
+
+               load_secondary_context(mm);
+               __flush_tlb_mm(CTX_HWBITS(mm->context),
+                              SECONDARY_CONTEXT);
+
+               spin_unlock_irqrestore(&mm->context.lock, flags);
        }
 }