xen mmu: fix a race window causing leave_mm BUG()
[linux-flexiantxendom0-natty.git] / arch / x86 / xen / mmu.c
index 6020562..d835bc2 100644 (file)
@@ -1138,7 +1138,7 @@ static void drop_other_mm_ref(void *info)
 
        active_mm = percpu_read(cpu_tlbstate.active_mm);
 
-       if (active_mm == mm)
+       if (active_mm == mm && percpu_read(cpu_tlbstate.state) != TLBSTATE_OK)
                leave_mm(smp_processor_id());
 
        /* If this cpu still has a stale cr3 reference, then make sure