Skip to content

Commit 3018fbc

Browse files
committed
powerpc/64s: Fix boot failure with 4K Radix
When using the Radix MMU our PGD is always 64K, and must be naturally aligned. For a 4K page size kernel that means page alignment of swapper_pg_dir is not sufficient, leading to failure to boot. Use the existing MAX_PTRS_PER_PGD which has the correct value, and avoids us hard-coding 64K here. Fixes: e72421a ("powerpc: Define swapper_pg_dir[] in C") Reported-by: Daniel Axtens <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a736143 commit 3018fbc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/powerpc/mm/pgtable.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
#include <asm/hugetlb.h>
2929
#include <asm/pte-walk.h>
3030

31-
pgd_t swapper_pg_dir[MAX_PTRS_PER_PGD] __page_aligned_bss;
31+
#ifdef CONFIG_PPC64
32+
#define PGD_ALIGN (sizeof(pgd_t) * MAX_PTRS_PER_PGD)
33+
#else
34+
#define PGD_ALIGN PAGE_SIZE
35+
#endif
36+
37+
pgd_t swapper_pg_dir[MAX_PTRS_PER_PGD] __section(".bss..page_aligned") __aligned(PGD_ALIGN);
3238

3339
static inline int is_exec_fault(void)
3440
{

0 commit comments

Comments
 (0)