powerpc/64s: Fix boot failure with 4K Radix
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Jun 2021 12:34:20 +0000 (22:34 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Jun 2021 14:06:54 +0000 (00:06 +1000)
commit3018fbc63632e6d30abde228f29aaeaf78b782bf
tree58f4ac7539a752e4db55cd396bb3315dcb2c64b3
parenta736143afd036f2078fe19435b16fd55abc789a9
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
arch/powerpc/mm/pgtable.c