]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita3950c63ba4575bf1ed9da6d08ff492f11e88446
tree67e91cd83bf7e66d5ec00c4268f550b898aca30f
parent2ba3962871abc686d17759391bbe10500efd703d
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