Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
[pandora-kernel.git] / arch / powerpc / mm / mmu_context_nohash.c
index 1f2d9ff..5ce9984 100644 (file)
@@ -334,7 +334,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
        /* We don't touch CPU 0 map, it's allocated at aboot and kept
         * around forever
         */
-       if (cpu == 0)
+       if (cpu == boot_cpuid)
                return NOTIFY_OK;
 
        switch (action) {
@@ -395,10 +395,18 @@ void __init mmu_context_init(void)
         * the PID/TID comparison is disabled, so we can use a TID of zero
         * to represent all kernel pages as shared among all contexts.
         *      -- Dan
+        *
+        * The IBM 47x core supports 16-bit PIDs, thus 65535 contexts. We
+        * should normally never have to steal though the facility is
+        * present if needed.
+        *      -- BenH
         */
        if (mmu_has_feature(MMU_FTR_TYPE_8xx)) {
                first_context = 0;
                last_context = 15;
+       } else if (mmu_has_feature(MMU_FTR_TYPE_47x)) {
+               first_context = 1;
+               last_context = 65535;
        } else {
                first_context = 1;
                last_context = 255;
@@ -412,9 +420,11 @@ void __init mmu_context_init(void)
         */
        context_map = alloc_bootmem(CTX_MAP_SIZE);
        context_mm = alloc_bootmem(sizeof(void *) * (last_context + 1));
+#ifndef CONFIG_SMP
        stale_map[0] = alloc_bootmem(CTX_MAP_SIZE);
+#else
+       stale_map[boot_cpuid] = alloc_bootmem(CTX_MAP_SIZE);
 
-#ifdef CONFIG_SMP
        register_cpu_notifier(&mmu_context_cpu_nb);
 #endif