KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 14 Oct 2020 14:33:46 +0000 (16:33 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 31 Oct 2020 14:27:58 +0000 (10:27 -0400)
commit064eedf2c50f692088e1418c553084bf9c1432f8
tree67e91cd83bf7e66d5ec00c4268f550b898aca30f
parent97a71a5455997d72adfd74e9d575d782d7c2ab9a
KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again

It was noticed that evmcs_sanitize_exec_ctrls() is not being executed
nowadays despite the code checking 'enable_evmcs' static key looking
correct. Turns out, static key magic doesn't work in '__init' section
(and it is unclear when things changed) but setup_vmcs_config() is called
only once per CPU so we don't really need it to. Switch to checking
'enlightened_vmcs' instead, it is supposed to be in sync with
'enable_evmcs'.

Opportunistically make evmcs_sanitize_exec_ctrls '__init' and drop unneeded
extra newline from it.

Reported-by: Yang Weijiang <weijiang.yang@intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20201014143346.2430936-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/evmcs.c
arch/x86/kvm/vmx/evmcs.h
arch/x86/kvm/vmx/vmx.c