powerpc/mmu: add is_strict_kernel_rwx() helper

Add a helper to know whether STRICT_KERNEL_RWX is enabled.

This is based on rodata_enabled flag which is defined only
when CONFIG_STRICT_KERNEL_RWX is selected.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Christophe Leroy
2019-02-21 19:08:45 +00:00
gecommit door Michael Ellerman
bovenliggende 02d5d13b45
commit 28ea38b9cb
2 gewijzigde bestanden met toevoegingen van 12 en 3 verwijderingen

Bestand weergeven

@@ -108,12 +108,10 @@ static void __init MMU_setup(void)
__map_without_bats = 1;
__map_without_ltlbs = 1;
}
#ifdef CONFIG_STRICT_KERNEL_RWX
if (rodata_enabled) {
if (strict_kernel_rwx_enabled()) {
__map_without_bats = 1;
__map_without_ltlbs = 1;
}
#endif
}
/*