]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/powerpc/mm/mmu_context_nohash.c
Merge tag 'powerpc-4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
[linux.git] / arch / powerpc / mm / mmu_context_nohash.c
index 4554d65276826e9719e7b69529003f7873483582..be8f5c9d4d088fad3539b1ffeb9ea3fed3dc4ff7 100644 (file)
@@ -331,6 +331,17 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
 {
        pr_hard("initing context for mm @%p\n", mm);
 
+#ifdef CONFIG_PPC_MM_SLICES
+       /*
+        * We have MMU_NO_CONTEXT set to be ~0. Hence check
+        * explicitly against context.id == 0. This ensures that we properly
+        * initialize context slice details for newly allocated mm's (which will
+        * have id == 0) and don't alter context slice inherited via fork (which
+        * will have id != 0).
+        */
+       if (mm->context.id == 0)
+               slice_init_new_context_exec(mm);
+#endif
        mm->context.id = MMU_NO_CONTEXT;
        mm->context.active = 0;
        return 0;
@@ -428,8 +439,8 @@ void __init mmu_context_init(void)
         *      -- BenH
         */
        if (mmu_has_feature(MMU_FTR_TYPE_8xx)) {
-               first_context = 0;
-               last_context = 15;
+               first_context = 1;
+               last_context = 16;
                no_selective_tlbil = true;
        } else if (mmu_has_feature(MMU_FTR_TYPE_47x)) {
                first_context = 1;