Skip to content

Commit 57f0253

Browse files
xhackerustcPaul Walmsley
authored andcommitted
riscv: make runtime const not usable by modules
Similar as commit 284922f ("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> Link: https://patch.msgid.link/20260221023731.3476-1-jszhang@kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 6b60a12 commit 57f0253

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/riscv/include/asm/runtime-const.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#ifndef _ASM_RISCV_RUNTIME_CONST_H
33
#define _ASM_RISCV_RUNTIME_CONST_H
44

5+
#ifdef MODULE
6+
#error "Cannot use runtime-const infrastructure from modules"
7+
#endif
8+
59
#include <asm/asm.h>
610
#include <asm/alternative.h>
711
#include <asm/cacheflush.h>

0 commit comments

Comments
 (0)