Merge branches 'fixes' and 'ioremap' into for-linus
[firefly-linux-kernel-4.4.55.git] / arch / arm / kernel / smp.c
index f11d8252707619cfcf7e1c5f214bbdca75ef90b6..3d6b7821cff8c952e73c72cad5a1f8d90cdf1758 100644 (file)
@@ -86,9 +86,11 @@ void __init smp_set_ops(struct smp_operations *ops)
 
 static unsigned long get_arch_pgd(pgd_t *pgd)
 {
-       phys_addr_t pgdir = virt_to_idmap(pgd);
-       BUG_ON(pgdir & ARCH_PGD_MASK);
-       return pgdir >> ARCH_PGD_SHIFT;
+#ifdef CONFIG_ARM_LPAE
+       return __phys_to_pfn(virt_to_phys(pgd));
+#else
+       return virt_to_phys(pgd);
+#endif
 }
 
 int __cpu_up(unsigned int cpu, struct task_struct *idle)
@@ -108,7 +110,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
 #endif
 
 #ifdef CONFIG_MMU
-       secondary_data.pgdir = get_arch_pgd(idmap_pgd);
+       secondary_data.pgdir = virt_to_phys(idmap_pgd);
        secondary_data.swapper_pg_dir = get_arch_pgd(swapper_pg_dir);
 #endif
        sync_cache_w(&secondary_data);