These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / powerpc / kernel / setup_64.c
index c69671c..5c03a6a 100644 (file)
@@ -108,6 +108,14 @@ static void setup_tlb_core_data(void)
        for_each_possible_cpu(cpu) {
                int first = cpu_first_thread_sibling(cpu);
 
+               /*
+                * If we boot via kdump on a non-primary thread,
+                * make sure we point at the thread that actually
+                * set up this TLB.
+                */
+               if (cpu_first_thread_sibling(boot_cpuid) == first)
+                       first = boot_cpuid;
+
                paca[cpu].tcd_ptr = &paca[first].tcd;
 
                /*
@@ -332,11 +340,26 @@ void early_setup_secondary(void)
 #endif /* CONFIG_SMP */
 
 #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
+static bool use_spinloop(void)
+{
+       if (!IS_ENABLED(CONFIG_PPC_BOOK3E))
+               return true;
+
+       /*
+        * When book3e boots from kexec, the ePAPR spin table does
+        * not get used.
+        */
+       return of_property_read_bool(of_chosen, "linux,booted-from-kexec");
+}
+
 void smp_release_cpus(void)
 {
        unsigned long *ptr;
        int i;
 
+       if (!use_spinloop())
+               return;
+
        DBG(" -> smp_release_cpus()\n");
 
        /* All secondary cpus are spinning on a common spinloop, release them
@@ -516,14 +539,15 @@ void __init setup_system(void)
         * Freescale Book3e parts spin in a loop provided by firmware,
         * so smp_release_cpus() does nothing for them
         */
-#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_FSL_BOOK3E)
+#if defined(CONFIG_SMP)
        /* Release secondary cpus out of their spinloops at 0x60 now that
         * we can map physical -> logical CPU ids
         */
        smp_release_cpus();
 #endif
 
-       pr_info("Starting Linux PPC64 %s\n", init_utsname()->version);
+       pr_info("Starting Linux %s %s\n", init_utsname()->machine,
+                init_utsname()->version);
 
        pr_info("-----------------------------------------------------\n");
        pr_info("ppc64_pft_size    = 0x%llx\n", ppc64_pft_size);
@@ -685,6 +709,9 @@ void __init setup_arch(char **cmdline_p)
        init_mm.brk = klimit;
 #ifdef CONFIG_PPC_64K_PAGES
        init_mm.context.pte_frag = NULL;
+#endif
+#ifdef CONFIG_SPAPR_TCE_IOMMU
+       mm_iommu_init(&init_mm.context);
 #endif
        irqstack_early_init();
        exc_lvl_early_init();