riscv: KVM: Switch has_svinval() to riscv_has_extension_unlikely()
authorAndrew Jones <ajones@ventanamicro.com>
Sat, 28 Jan 2023 17:28:55 +0000 (01:28 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 1 Feb 2023 07:29:44 +0000 (23:29 -0800)
Switch has_svinval() from static branch to the new helper
riscv_has_extension_unlikely().

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Acked-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20230128172856.3814-13-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kvm/tlb.c

index 309d79b..aa3da18 100644 (file)
@@ -15,8 +15,7 @@
 #include <asm/hwcap.h>
 #include <asm/insn-def.h>
 
-#define has_svinval()  \
-       static_branch_unlikely(&riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_SVINVAL])
+#define has_svinval()  riscv_has_extension_unlikely(RISCV_ISA_EXT_SVINVAL)
 
 void kvm_riscv_local_hfence_gvma_vmid_gpa(unsigned long vmid,
                                          gpa_t gpa, gpa_t gpsz,