From d167ed4e87ca6a3bbec85e8c5e252b0541338639 Mon Sep 17 00:00:00 2001 From: Kanglong Wang Date: Thu, 18 Jun 2026 14:30:19 +0800 Subject: [PATCH] LoongArch: Disable CONFIG_STRICT_MODULE_RWX and fix compilation error ANBZ: #38133 commit 32a08c17d8096f0fd2c6600bc5fe8464aaf68ea7 upstream. First, the LoongArch currently does not support CONFIG_STRICT_MODULE_RWX feature,so it needs to be disabled. The feature will be submitted to Anolis after it is improved upstream. Secondly, the kernel compilation failed after disabling CONFIG_STRICT_MODULE_RWX. By comparing the upstream, the inline function definitions in the 'include/linux/module.h' were removed, as the relevant cases were already handled in the 'kernel/module/strict_rwx.c'. The patch keeps the code largely consistent with the upstream code,facilitating future maintenance. Signed-off-by: Kanglong Wang --- arch/loongarch/Kconfig | 1 - include/linux/module.h | 5 ----- 2 files changed, 6 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 76aee0ed3b5b..0813262ea616 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -20,7 +20,6 @@ config LOONGARCH select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SET_MEMORY - select ARCH_HAS_STRICT_MODULE_RWX select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_INLINE_READ_LOCK if !PREEMPTION select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION diff --git a/include/linux/module.h b/include/linux/module.h index e0223172a574..82f6ecc9360a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -891,13 +891,8 @@ extern const struct kobj_type module_ktype; #define __MODULE_STRING(x) __stringify(x) -#ifdef CONFIG_STRICT_MODULE_RWX extern void module_enable_ro(const struct module *mod, bool after_init); extern void module_disable_ro(const struct module *mod); -#else -static inline void module_enable_ro(const struct module *mod, bool after_init) { } -static inline void module_disable_ro(const struct module *mod) { } -#endif #ifdef CONFIG_GENERIC_BUG void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, -- Gitee