Skip to content

Commit

Permalink
powerpc/mm: Move slb_addr_linit to early_init_mmu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aneesh Kumar K.V authored and Michael Ellerman committed Apr 21, 2019
1 parent 60458fb commit 67fda38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
11 changes: 0 additions & 11 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/mm/hash_utils_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/mm/tlb_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 67fda38

Please sign in to comment.