- patches.fixes/patch-2.6.11-rc1: 2.6.11-rc1.
[linux-flexiantxendom0-3.2.10.git] / include / asm-i386 / mmu_context.h
index 3fe6144..bf08218 100644 (file)
@@ -6,25 +6,13 @@
 #include <asm/atomic.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
-#include <asm/semaphore.h>
 
 /*
- * Used for LDT initialization/destruction. You cannot copy an LDT with
- * init_new_context, since it thinks you are passing it a new LDT and won't
- * deallocate its old content.
+ * Used for LDT copy/destruction.
  */
 int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
 void destroy_context(struct mm_struct *mm);
 
-/* LDT initialization for a clean environment - needed for SKAS.*/
-static inline void init_new_empty_context(struct mm_struct *mm)
-{
-       init_MUTEX(&mm->context.sem);
-       mm->context.size = 0;
-}
-
-/* LDT copy for SKAS - for the above problem.*/
-int copy_context(struct mm_struct *mm, struct mm_struct *old_mm);
 
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 {
@@ -41,10 +29,6 @@ static inline void switch_mm(struct mm_struct *prev,
 {
        int cpu = smp_processor_id();
 
-#ifdef CONFIG_SMP
-       prev = per_cpu(cpu_tlbstate, cpu).active_mm;
-#endif
-
        if (likely(prev != next)) {
                /* stop flush ipis for the previous mm */
                cpu_clear(cpu, prev->cpu_vm_mask);
@@ -66,6 +50,7 @@ static inline void switch_mm(struct mm_struct *prev,
 #ifdef CONFIG_SMP
        else {
                per_cpu(cpu_tlbstate, cpu).state = TLBSTATE_OK;
+               BUG_ON(per_cpu(cpu_tlbstate, cpu).active_mm != next);
 
                if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
                        /* We were in lazy tlb mode and leave_mm disabled