From: Jun Sun <jsun@junsun.net>
To: linux-riscv@lists.infradead.org
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
alex@ghiti.fr, linux-kernel@vger.kernel.org,
junyan.lin@spacemit.com
Subject: [PATCH] riscv: cpufeature: remove _RO from use_hcontext for KVM=m
Date: Tue, 9 Jun 2026 11:32:50 -0700 [thread overview]
Message-ID: <20260609183250.41892-1-jsun@junsun.net> (raw)
use_hcontext is in __ro_after_init but only referenced from KVM's
__jump_table. With KVM=m, jump_label_init_ro() never sees it, so
it is never sealed. Module load then tries to write to the RO key
in jump_label_add_module() and oopses.
---
arch/riscv/kernel/cpufeature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 903e27cf908f..3a68d20156e8 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -49,7 +49,7 @@ u32 thead_vlenb_of;
atomic_t hcontext_disable;
atomic_t scontext_disable;
-DEFINE_STATIC_KEY_FALSE_RO(use_hcontext);
+DEFINE_STATIC_KEY_FALSE(use_hcontext);
EXPORT_SYMBOL(use_hcontext);
DEFINE_STATIC_KEY_FALSE_RO(use_scontext);
--
2.34.1
next reply other threads:[~2026-06-09 18:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 18:32 Jun Sun [this message]
2026-12-01 1:31 ` Paul Walmsley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260609183250.41892-1-jsun@junsun.net \
--to=jsun@junsun.net \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=junyan.lin@spacemit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®