Russell Currey 970d54f99c powerpc/book3s64/hash: Disable 16M linear mapping size if not aligned
With STRICT_KERNEL_RWX on in a relocatable kernel under the hash MMU,
if the position the kernel is loaded at is not 16M aligned things go
horribly wrong. Specifically hash__mark_initmem_nx() will call
hash__change_memory_range() which then aligns down the start address,
and due to the text not being 16M aligned causes some of the kernel
text to be marked non-executable.

We can avoid this when selecting the linear mapping size, so do so and
print a warning. I tested this for various alignments and as long as
the position is 64K aligned it's fine (the base requirement for
powerpc).

Signed-off-by: Russell Currey <ruscur@russell.cc>
[mpe: Add details of the failure mode]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191224064126.183670-1-ruscur@russell.cc
2020-01-16 14:59:36 +10:00
..
2019-12-09 10:36:44 -08:00
2019-12-18 17:47:38 +01:00
2019-11-28 11:16:43 -08:00
2020-01-04 13:55:09 -08:00
2020-01-04 14:16:57 -08:00
2019-12-12 16:34:33 +08:00
2019-12-02 17:18:43 -08:00
2019-12-09 10:36:44 -08:00
2019-11-28 10:57:12 -08:00
2019-12-04 19:44:12 -08:00