From 5d73a83b63dd657fdd46be86319836512a34302a Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Tue, 6 Feb 2024 13:54:58 +0800 Subject: [PATCH] bug: s32ilp32: Disable STRICT_KERNEL(MODULE)_RWX config This bug is come from faulting in PGD entries [1], rv32 ISA can't solve it because of its satp design. This problem has been solved in both s64ilp32 and s64lp64. Only s32ilp32 has the problem. clk: Disabling unused clocks dw-apb-uart 1900d000.serial: forbid DMA for kernel console Unable to handle kernel paging request at virtual address c0c00000 Oops [#1] Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.0 #7 Hardware name: T-HEAD C9XX (DT) epc : __memset+0x58/0xf8 ra : free_reserved_area+0x148/0x186 epc : c08483c8 ra : c014e330 sp : c206ff00 gp : c1cb8fe8 tp : c20f8000 t0 : c0c00000 t1 : 5fc00000 t2 : 00000011 s0 : c206ff50 s1 : 000000cc a0 : c0c00000 a1 : cccccccc a2 : 00001000 a3 : c0c01000 a4 : 00000000 a5 : 000000ff a6 : 00000001 a7 : 52464e43 s2 : c1017000 s3 : ffffffff s4 : 00000000 s5 : ffffbfff s6 : c1cbb834 s7 : c1ce5e80 s8 : c15f2220 s9 : c0c00000 s10: ff320000 s11: 00000001 t3 : 0000000f t4 : e0000000 t5 : 00000004 t6 : c2939011 status: 00008120 badaddr: c0c00000 cause: 0000000f [] __memset+0x58/0xf8 [] free_initmem+0x74/0x82 [] kernel_init+0x3a/0x106 [] ret_from_fork+0xa/0x1c Code: 0713 0807 82b3 40e2 0797 0000 8793 00c7 97ba 8782 (a023) 00b2 ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [1]: https://lore.kernel.org/lkml/20230529180023.289904-1-bjorn@kernel.org/ Signed-off-by: Guo Ren --- arch/riscv/configs/32-bit.config | 2 ++ arch/riscv/configs/64ilp32.config | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/configs/32-bit.config b/arch/riscv/configs/32-bit.config index 597dfa4756b3c..4ee964c38a29a 100644 --- a/arch/riscv/configs/32-bit.config +++ b/arch/riscv/configs/32-bit.config @@ -4,3 +4,5 @@ CONFIG_32BIT=y # CONFIG_PORTABLE is not set CONFIG_NONPORTABLE=y CONFIG_CGROUPS=n +CONFIG_STRICT_KERNEL_RWX=n +CONFIG_STRICT_MODULE_RWX=n diff --git a/arch/riscv/configs/64ilp32.config b/arch/riscv/configs/64ilp32.config index 98d729242afb0..1cb518b80d122 100644 --- a/arch/riscv/configs/64ilp32.config +++ b/arch/riscv/configs/64ilp32.config @@ -4,3 +4,5 @@ CONFIG_32BIT=y # CONFIG_PORTABLE is not set CONFIG_NONPORTABLE=y CONFIG_CGROUPS=n +CONFIG_STRICT_KERNEL_RWX=n +CONFIG_STRICT_MODULE_RWX=n