Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[cascardo/linux.git] / arch / powerpc / mm / mmu_context_64.c
index 65d18dc..1db38ba 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -44,14 +43,19 @@ again:
                return err;
 
        if (index > MAX_CONTEXT) {
+               spin_lock(&mmu_context_lock);
                idr_remove(&mmu_context_idr, index);
+               spin_unlock(&mmu_context_lock);
                return -ENOMEM;
        }
 
+       /* The old code would re-promote on fork, we don't do that
+        * when using slices as it could cause problem promoting slices
+        * that have been forced down to 4K
+        */
+       if (slice_mm_new_context(mm))
+               slice_set_user_psize(mm, mmu_virtual_psize);
        mm->context.id = index;
-       mm->context.user_psize = mmu_virtual_psize;
-       mm->context.sllp = SLB_VSID_USER |
-               mmu_psize_defs[mmu_virtual_psize].sllp;
 
        return 0;
 }