summaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/setup.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-04-29 18:10:04 +0300
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-05-06 19:40:15 +0300
commit8d91b097335892bfbc9fd5783e80e25f0fb5bb2b (patch)
tree89b20f1deb2665fb4c8f91d58c2de524a7f1ed52 /arch/riscv/kernel/setup.c
parent0e0d4992517fba81ecbceb5b71d2851f1208a02b (diff)
downloadlinux-8d91b097335892bfbc9fd5783e80e25f0fb5bb2b.tar.xz
riscv: Consistify protect_kernel_linear_mapping_text_rodata() use
The various uses of protect_kernel_linear_mapping_text_rodata() are not consistent: - Its definition depends on "64BIT && !XIP_KERNEL", - Its forward declaration depends on MMU, - Its single caller depends on "STRICT_KERNEL_RWX && 64BIT && MMU && !XIP_KERNEL". Fix this by settling on the dependencies of the caller, which can be simplified as STRICT_KERNEL_RWX depends on "MMU && !XIP_KERNEL". Provide a dummy definition, as the caller is protected by "IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)" instead of "#ifdef CONFIG_STRICT_KERNEL_RWX". Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Alexandre Ghiti <alex@ghiti.fr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel/setup.c')
-rw-r--r--arch/riscv/kernel/setup.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 7b31779101f6..03901d3a8b02 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -293,9 +293,7 @@ void __init setup_arch(char **cmdline_p)
if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)) {
protect_kernel_text_data();
-#if defined(CONFIG_64BIT) && defined(CONFIG_MMU) && !defined(CONFIG_XIP_KERNEL)
protect_kernel_linear_mapping_text_rodata();
-#endif
}
#ifdef CONFIG_SWIOTLB