Merge git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[powerpc.git] / include / asm-arm / mmu_context.h
index 9fadb01..f8755c8 100644 (file)
@@ -16,6 +16,9 @@
 #include <linux/compiler.h>
 #include <asm/cacheflush.h>
 #include <asm/proc-fns.h>
+#include <asm-generic/mm_hooks.h>
+
+void __check_kvm_seq(struct mm_struct *mm);
 
 #if __LINUX_ARM_ARCH__ >= 6
 
@@ -45,13 +48,21 @@ static inline void check_context(struct mm_struct *mm)
 {
        if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS))
                __new_context(mm);
+
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
 }
 
 #define init_new_context(tsk,mm)       (__init_new_context(tsk,mm),0)
 
 #else
 
-#define check_context(mm)              do { } while (0)
+static inline void check_context(struct mm_struct *mm)
+{
+       if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
+               __check_kvm_seq(mm);
+}
+
 #define init_new_context(tsk,mm)       0
 
 #endif