diff options
author | Michael Ellerman | 2021-06-24 22:34:20 +1000 |
---|---|---|
committer | Michael Ellerman | 2021-06-25 00:06:54 +1000 |
commit | 3018fbc63632e6d30abde228f29aaeaf78b782bf (patch) | |
tree | 58f4ac7539a752e4db55cd396bb3315dcb2c64b3 /arch/powerpc/mm | |
parent | a736143afd036f2078fe19435b16fd55abc789a9 (diff) |
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: e72421a085a8 ("powerpc: Define swapper_pg_dir[] in C")
Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210624123420.2784187-1-mpe@ellerman.id.au
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/pgtable.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 1707ab580ee2..cd16b407f47e 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -28,7 +28,13 @@ #include <asm/hugetlb.h> #include <asm/pte-walk.h> -pgd_t swapper_pg_dir[MAX_PTRS_PER_PGD] __page_aligned_bss; +#ifdef CONFIG_PPC64 +#define PGD_ALIGN (sizeof(pgd_t) * MAX_PTRS_PER_PGD) +#else +#define PGD_ALIGN PAGE_SIZE +#endif + +pgd_t swapper_pg_dir[MAX_PTRS_PER_PGD] __section(".bss..page_aligned") __aligned(PGD_ALIGN); static inline int is_exec_fault(void) { |