Skip to content

Commit 89a3496

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Use the right page size for vmemmap mapping
We use mmu_vmemmap_psize to find the page size for mapping the vmmemap area. With radix translation, we are suboptimally setting this value to PAGE_SIZE. We do check for 2M page size support and update mmu_vmemap_psize to use hugepage size but we suboptimally reset the value to PAGE_SIZE in radix__early_init_mmu(). This resulted in always mapping vmemmap area with 64K page size. Fixes: 2bfd65e ("powerpc/mm/radix: Add radix callbacks for early init routines") Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 78c9498 commit 89a3496

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

arch/powerpc/mm/book3s64/radix_pgtable.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,6 @@ void __init radix__early_init_devtree(void)
520520
mmu_psize_defs[MMU_PAGE_64K].shift = 16;
521521
mmu_psize_defs[MMU_PAGE_64K].ap = 0x5;
522522
found:
523-
#ifdef CONFIG_SPARSEMEM_VMEMMAP
524-
if (mmu_psize_defs[MMU_PAGE_2M].shift) {
525-
/*
526-
* map vmemmap using 2M if available
527-
*/
528-
mmu_vmemmap_psize = MMU_PAGE_2M;
529-
}
530-
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
531523
return;
532524
}
533525

@@ -592,7 +584,13 @@ void __init radix__early_init_mmu(void)
592584

593585
#ifdef CONFIG_SPARSEMEM_VMEMMAP
594586
/* vmemmap mapping */
595-
mmu_vmemmap_psize = mmu_virtual_psize;
587+
if (mmu_psize_defs[MMU_PAGE_2M].shift) {
588+
/*
589+
* map vmemmap using 2M if available
590+
*/
591+
mmu_vmemmap_psize = MMU_PAGE_2M;
592+
} else
593+
mmu_vmemmap_psize = mmu_virtual_psize;
596594
#endif
597595
/*
598596
* initialize page table size

0 commit comments

Comments
 (0)