]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/arm64/mm/context.c
Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc...
[linux.git] / arch / arm64 / mm / context.c
index c90c3c5f46af5e87c60c594949f22c3b1436266e..efcf1f7ef1e4c27b4c0c40546dc542122f824933 100644 (file)
@@ -75,8 +75,7 @@ void verify_cpu_asid_bits(void)
                 */
                pr_crit("CPU%d: smaller ASID size(%u) than boot CPU (%u)\n",
                                smp_processor_id(), asid, asid_bits);
-               update_cpu_boot_status(CPU_PANIC_KERNEL);
-               cpu_park_loop();
+               cpu_panic_kernel();
        }
 }
 
@@ -180,7 +179,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
                                                 &asid_generation);
        flush_context(cpu);
 
-       /* We have at least 1 ASID per CPU, so this will always succeed */
+       /* We have more ASIDs than CPUs, so this will always succeed */
        asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
 
 set_asid:
@@ -228,8 +227,11 @@ void check_and_switch_context(struct mm_struct *mm, unsigned int cpu)
 static int asids_init(void)
 {
        asid_bits = get_cpu_asid_bits();
-       /* If we end up with more CPUs than ASIDs, expect things to crash */
-       WARN_ON(NUM_USER_ASIDS < num_possible_cpus());
+       /*
+        * Expect allocation after rollover to fail if we don't have at least
+        * one more ASID than CPUs. ASID #0 is reserved for init_mm.
+        */
+       WARN_ON(NUM_USER_ASIDS - 1 <= num_possible_cpus());
        atomic64_set(&asid_generation, ASID_FIRST_VERSION);
        asid_map = kzalloc(BITS_TO_LONGS(NUM_USER_ASIDS) * sizeof(*asid_map),
                           GFP_KERNEL);