Skip to contentSkip to conversation

arm64: kconfig: Make STRICT_KERNEL_RWX visable.

PATCH Superseded junan 3 participants 4 messages Jan 14 – Jan 16 arm64

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

junan

author
#0 lore raw

PATCH 1/1 arm64: kconfig: Make STRICT_KERNEL_RWX visable.

Make "STRICT_KERNEL_RWX" visable to menuconfig on arm64 platform.

I can not set breakpoints when using kgdb/kdb on arm64, the document says "STRICT_KERNEL_RWX" should be "n", but it's not visable in menuconfig and the default value is "y".

kgdb/kdb doc: https://docs.kernel.org/process/debugging/kgdb.html

---
 arch/arm64/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/Kconfig +2 -0
index 93173f0a09c7..cc3aaffa1e12 100644
@@ -52,6 +52,8 @@ config ARM64
 	select ARCH_STACKWALK
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_MODULE_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX		if ARCH_HAS_STRICT_KERNEL_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_HAS_SYNC_DMA_FOR_CPU
 	select ARCH_HAS_SYSCALL_WRAPPER
Signature · 1 line
2.43.0
#1 lore raw
kernel test robot noticed the following build errors:

Hi junan,

kernel test robot noticed the following build errors:

[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on linus/master v6.19-rc5 next-20260114] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/junan/arm64-kconfig-Make-STRICT_KERNEL_RWX-visable/20260114-094935
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
patch link:    https://lore.kernel.org/r/20260114013859.498148-2-junan76%40163.com
patch subject: [PATCH] arm64: kconfig: Make STRICT_KERNEL_RWX visable.
config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20260114/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260114/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

aarch64-linux-ld: arch/arm64/mm/mmu.o: in function `map_entry_trampoline':

>> mmu.c:(.init.text+0x578): undefined reference to `rodata_enabled'
   aarch64-linux-ld: arch/arm64/mm/mmu.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `rodata_enabled' which may bind externally can not be used when making a shared object; recompile with -fPIC
>> mmu.c:(.init.text+0x578): dangerous relocation: unsupported relocation
>> aarch64-linux-ld: mmu.c:(.init.text+0x584): undefined reference to `rodata_enabled'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#2 lore raw
In reply to junan
Quoted 5 lines · junan

Make "STRICT_KERNEL_RWX" visable to menuconfig on arm64 platform.

I can not set breakpoints when using kgdb/kdb on arm64, the document says "STRICT_KERNEL_RWX" should be "n", but it's not visable in menuconfig and the default value is "y".

Does it help if you pass rodata=off on the cmdline instead?

Will

author
#3 lore raw
Quoted 1 line · Will Deacon
Quoted 1 line

Does it help if you pass rodata=off on the cmdline instead?

I tested it with qemu, "rodata=off" actually works well, thanks for your time Will!

junan