The static key is only ever enabled in
__init hv_init_evmcs()
so mark it appropriately as __ro_after_init.
Reported-by: Sean Christopherson seanjc@google.com Signed-off-by: Valentin Schneider vschneid@redhat.com --- arch/x86/kvm/vmx/vmx_onhyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx_onhyperv.c b/arch/x86/kvm/vmx/vmx_onhyperv.c index b9a8b91166d02..ff3d80c9565bb 100644 --- a/arch/x86/kvm/vmx/vmx_onhyperv.c +++ b/arch/x86/kvm/vmx/vmx_onhyperv.c @@ -3,7 +3,7 @@ #include "capabilities.h" #include "vmx_onhyperv.h"
-DEFINE_STATIC_KEY_FALSE(__kvm_is_using_evmcs); +DEFINE_STATIC_KEY_FALSE_RO(__kvm_is_using_evmcs);
/* * KVM on Hyper-V always uses the latest known eVMCSv1 revision, the assumption