Skip to contentSkip to conversation

riscv: cpufeature: remove _RO from use_hcontext for KVM=m

PATCH New Jun Sun 1 participant 1 message Jun 9 RISC-V

lore
Share & tools
lore

Jun Sun

author
#0 lore raw

PATCH 1/1 riscv: cpufeature: remove _RO from use_hcontext for KVM=m

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(-)
arch/riscv/kernel/cpufeature.c +1 -1
index 903e27cf908f..3a68d20156e8 100644
@@ -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);
Signature · 1 line
2.34.1