mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: cpufeature: remove _RO from use_hcontext for KVM=m
@ 2026-06-09 18:32 Jun Sun
  2026-12-01  1:31 ` Paul Walmsley
  0 siblings, 1 reply; 2+ messages in thread
From: Jun Sun @ 2026-06-09 18:32 UTC (permalink / raw)
  To: linux-riscv; +Cc: pjw, palmer, aou, alex, linux-kernel, junyan.lin

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] riscv: cpufeature: remove _RO from use_hcontext for KVM=m
  2026-06-09 18:32 [PATCH] riscv: cpufeature: remove _RO from use_hcontext for KVM=m Jun Sun
@ 2026-12-01  1:31 ` Paul Walmsley
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Walmsley @ 2026-12-01  1:31 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-riscv, pjw, palmer, aou, alex, linux-kernel, junyan.lin

On Tue, 9 Jun 2026, Jun Sun wrote:

> 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.

Looks like this isn't against mainline?  


- Paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-01  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-09 18:32 [PATCH] riscv: cpufeature: remove _RO from use_hcontext for KVM=m Jun Sun
2026-12-01  1:31 ` Paul Walmsley

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®