* [PATCH] riscv: make runtime const not usable by modules
@ 2026-02-21 2:37 Jisheng Zhang
2026-03-23 23:59 ` Paul Walmsley
0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2026-02-21 2:37 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti
Cc: linux-riscv, linux-kernel
Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const
rewriting in modules") does, make riscv's runtime const not usable by
modules too, to "make sure this doesn't get forgotten the next time
somebody wants to do runtime constant optimizations". The reason is
well explained in the above commit: "The runtime-const infrastructure
was never designed to handle the modular case, because the constant
fixup is only done at boot time for core kernel code."
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
arch/riscv/include/asm/runtime-const.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/riscv/include/asm/runtime-const.h b/arch/riscv/include/asm/runtime-const.h
index d766e2b9e6df..900db0a103d0 100644
--- a/arch/riscv/include/asm/runtime-const.h
+++ b/arch/riscv/include/asm/runtime-const.h
@@ -2,6 +2,10 @@
#ifndef _ASM_RISCV_RUNTIME_CONST_H
#define _ASM_RISCV_RUNTIME_CONST_H
+#ifdef MODULE
+ #error "Cannot use runtime-const infrastructure from modules"
+#endif
+
#include <asm/asm.h>
#include <asm/alternative.h>
#include <asm/cacheflush.h>
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] riscv: make runtime const not usable by modules
2026-02-21 2:37 [PATCH] riscv: make runtime const not usable by modules Jisheng Zhang
@ 2026-03-23 23:59 ` Paul Walmsley
0 siblings, 0 replies; 2+ messages in thread
From: Paul Walmsley @ 2026-03-23 23:59 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, linux-kernel
On Sat, 21 Feb 2026, Jisheng Zhang wrote:
> Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const
> rewriting in modules") does, make riscv's runtime const not usable by
> modules too, to "make sure this doesn't get forgotten the next time
> somebody wants to do runtime constant optimizations". The reason is
> well explained in the above commit: "The runtime-const infrastructure
> was never designed to handle the modular case, because the constant
> fixup is only done at boot time for core kernel code."
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Thanks, queued for v7.0-rc.
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-24 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-21 2:37 [PATCH] riscv: make runtime const not usable by modules Jisheng Zhang
2026-03-23 23:59 ` Paul Walmsley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox