[S390] 1K/2K page table pages.
[firefly-linux-kernel-4.4.55.git] / include / asm-s390 / mmu_context.h
index a77d4ba3c8ebc5c63ef4fbaa60104ffa6d296fc3..3eaac5efc632aa601aee752e5b2de47a13eea305 100644 (file)
 #define __S390_MMU_CONTEXT_H
 
 #include <asm/pgalloc.h>
+#include <asm/uaccess.h>
 #include <asm-generic/mm_hooks.h>
 
 static inline int init_new_context(struct task_struct *tsk,
                                   struct mm_struct *mm)
 {
-       mm->context = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
+       mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
 #ifdef CONFIG_64BIT
-       mm->context |= _ASCE_TYPE_REGION3;
+       mm->context.asce_bits |= _ASCE_TYPE_REGION3;
 #endif
+       mm->context.noexec = s390_noexec;
        return 0;
 }
 
@@ -32,11 +34,13 @@ static inline int init_new_context(struct task_struct *tsk,
 
 static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
 {
-       S390_lowcore.user_asce = mm->context | __pa(mm->pgd);
+       pgd_t *pgd = mm->pgd;
+
+       S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
        if (switch_amode) {
                /* Load primary space page table origin. */
-               pgd_t *shadow_pgd = get_shadow_table(mm->pgd) ? : mm->pgd;
-               S390_lowcore.user_exec_asce = mm->context | __pa(shadow_pgd);
+               pgd = mm->context.noexec ? get_shadow_table(pgd) : pgd;
+               S390_lowcore.user_exec_asce = mm->context.asce_bits | __pa(pgd);
                asm volatile(LCTL_OPCODE" 1,1,%0\n"
                             : : "m" (S390_lowcore.user_exec_asce) );
        } else