powerpc/mm: Move slb_addr_linit to early_init_mmu
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Wed, 17 Apr 2019 13:03:49 +0000 (18:33 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 21 Apr 2019 13:12:39 +0000 (23:12 +1000)
Avoid #ifdef in generic code. Also enables us to do this specific to
MMU translation mode on book3s64

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/tlb_nohash.c

index 2e5dfb6e0823999d967eadfb9b569d396192f910..a07de8608484c0529258f89f52f57940befe1f2f 100644 (file)
@@ -947,17 +947,6 @@ void __init setup_arch(char **cmdline_p)
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
 
-#ifdef CONFIG_PPC_MM_SLICES
-#ifdef CONFIG_PPC64
-       if (!radix_enabled())
-               init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64;
-#elif defined(CONFIG_PPC_8xx)
-       init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW;
-#else
-#error "context.addr_limit not initialized."
-#endif
-#endif
-
 #ifdef CONFIG_SPAPR_TCE_IOMMU
        mm_iommu_init(&init_mm);
 #endif
index fee0270618ac06fe17a0c4536c31388f8df7ac93..fe2fc43a8664b3d11be4f6d71f7f522e834de0bd 100644 (file)
@@ -1036,6 +1036,8 @@ void __init hash__early_init_mmu(void)
         */
        htab_initialize();
 
+       init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64;
+
        pr_info("Initializing hash mmu with SLB\n");
        /* Initialize SLB management */
        slb_initialize();
index ac23dc1c653520d3e152e9807919f5080c408819..088e0a6b5adea5191381efe9cd9221d6c7dead5b 100644 (file)
@@ -800,5 +800,11 @@ void __init early_init_mmu(void)
 #ifdef CONFIG_PPC_47x
        early_init_mmu_47x();
 #endif
+
+#ifdef CONFIG_PPC_MM_SLICES
+#if defined(CONFIG_PPC_8xx)
+       init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW;
+#endif
+#endif
 }
 #endif /* CONFIG_PPC64 */