x86/kvm/hyper-v: nested_enable_evmcs() sets vmcs_version incorrectly
authorVitaly Kuznetsov <vkuznets@redhat.com>
Thu, 17 Jan 2019 17:12:09 +0000 (18:12 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Jan 2019 18:11:37 +0000 (19:11 +0100)
commit3a2f5773baab34a9943be4c77e1ff2ac79d16c75
treef2a613688f97c03a977911eef5a9c2fa2270f2a7
parent5ad6ece869d46c834976ce383ef200f9116881f8
x86/kvm/hyper-v: nested_enable_evmcs() sets vmcs_version incorrectly

Commit e2e871ab2f02 ("x86/kvm/hyper-v: Introduce nested_get_evmcs_version()
helper") broke EVMCS enablement: to set vmcs_version we now call
nested_get_evmcs_version() but this function checks
enlightened_vmcs_enabled flag which is not yet set so we end up returning
zero.

Fix the issue by re-arranging things in nested_enable_evmcs().

Fixes: e2e871ab2f02 ("x86/kvm/hyper-v: Introduce nested_get_evmcs_version() helper")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/evmcs.c