/*
 * Initialize the context management stuff.
@@ -326,13 +344,56 @@ void __init mmu_context_init(void)
        init_mm.context.active = NR_CPUS;

        /*
+ * The MPC8xx has only 16 contexts. We rotate through them on each
+        * task switch.  A better way would be to keep track of tasks that
+        * own contexts, and implement an LRU usage.  That way very active
+        * tasks don't always have to pay the TLB reload overhead.  The
+        * kernel pages are mapped shared, so the kernel can run on behalf
+        * of any task that makes a kernel entry.  Shared does not mean they
+ * are not protected, just that the ASID comparison is not performed.
+        *      -- Dan
+        *
+        * The IBM4xx has 256 contexts, so we can just rotate through these
+        * as a way of "switching" contexts.  If the TID of the TLB is zero,
+        * the PID/TID comparison is disabled, so we can use a TID of zero
+        * to represent all kernel pages as shared among all contexts.

can expand the comment of change it to say all other nonhash parts 40x, 4xx, fsl-booke right now have 256 contexts.


+        *      -- Dan
+        */
+       if (mmu_has_feature(MMU_FTR_TYPE_8xx)) {
+               first_context = 0;
+               last_context = 15;
+       } else {
+               first_context = 1;
+               last_context = 255;
+       }


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to