]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32s: Enable STRICT_MODULE_RWX for the 603 core
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 17 Jan 2022 10:06:39 +0000 (10:06 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 12 Feb 2022 11:47:42 +0000 (22:47 +1100)
commitf4ae3d066d757a9a7c6252fa79532779dc29273c
treeef1260794144f7f69fbbb0a12e4740fc32ae727b
parent2c8be477aed2ab5f95a7770d9ae7f42f7ee664f2
powerpc/32s: Enable STRICT_MODULE_RWX for the 603 core

The book3s/32 MMU doesn't support per page execution protection and
doesn't support RO protection for kernel pages.

However, on the 603 which implements software loaded TLBs, execution
protection is honored by the TLB Miss handler which doesn't load
Instruction TLB for non executable pages. And RO protection is
honored by clearing the C bit for RO pages, leading to DSI.

So on the 603, STRICT_MODULE_RWX is possible without much effort.
Don't disable STRICT_MODULE_RWX on book3s/32 and print a warning
in case STRICT_MODULE_RWX has been selected and the platform has
a Hardware HASH MMU.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1e6162f334167e75f1140082932e3a354b16daba.1642413973.git.christophe.leroy@csgroup.eu
arch/powerpc/Kconfig
arch/powerpc/mm/pgtable_32.c