patch-2.3.30 linux/include/asm-i386/mmu_context.h

Next file: linux/include/asm-i386/page.h
Previous file: linux/include/asm-i386/io.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.29/linux/include/asm-i386/mmu_context.h linux/include/asm-i386/mmu_context.h
@@ -3,6 +3,7 @@
 
 #include <asm/desc.h>
 #include <asm/atomic.h>
+#include <asm/pgalloc.h>
 
 /*
  * possibly do the LDT unload here?
@@ -10,9 +11,12 @@
 #define destroy_context(mm)		do { } while(0)
 #define init_new_context(tsk,mm)	do { } while (0)
 
+#ifdef __SMP__
+extern unsigned int cpu_tlbbad[NR_CPUS];
+#endif
+
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, unsigned cpu)
 {
-
 	if (prev != next) {
 		/*
 		 * Re-load LDT if necessary
@@ -24,6 +28,13 @@
 		asm volatile("movl %0,%%cr3": :"r" (__pa(next->pgd)));
 		clear_bit(cpu, &prev->cpu_vm_mask);
 	}
+#ifdef __SMP__
+	else {
+		if(cpu_tlbbad[cpu])
+			local_flush_tlb();
+	}
+	cpu_tlbbad[cpu] = 0;
+#endif
 	set_bit(cpu, &next->cpu_vm_mask);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)