Skip to content

Commit 0e65f24

Browse files
kvaneeshgregkh
authored andcommitted
powerpc/mm/radix: Use the right page size for vmemmap mapping
commit 89a3496 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 551649e commit 0e65f24

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

arch/powerpc/mm/pgtable-radix.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,6 @@ void __init radix__early_init_devtree(void)
442442
mmu_psize_defs[MMU_PAGE_64K].shift = 16;
443443
mmu_psize_defs[MMU_PAGE_64K].ap = 0x5;
444444
found:
445-
#ifdef CONFIG_SPARSEMEM_VMEMMAP
446-
if (mmu_psize_defs[MMU_PAGE_2M].shift) {
447-
/*
448-
* map vmemmap using 2M if available
449-
*/
450-
mmu_vmemmap_psize = MMU_PAGE_2M;
451-
}
452-
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
453445
return;
454446
}
455447

@@ -527,7 +519,13 @@ void __init radix__early_init_mmu(void)
527519

528520
#ifdef CONFIG_SPARSEMEM_VMEMMAP
529521
/* vmemmap mapping */
530-
mmu_vmemmap_psize = mmu_virtual_psize;
522+
if (mmu_psize_defs[MMU_PAGE_2M].shift) {
523+
/*
524+
* map vmemmap using 2M if available
525+
*/
526+
mmu_vmemmap_psize = MMU_PAGE_2M;
527+
} else
528+
mmu_vmemmap_psize = mmu_virtual_psize;
531529
#endif
532530
/*
533531
* initialize page table size

0 commit comments

Comments
 (0)