OSDN Git Service

KVM: selftests: define and use EVMCS_VERSION
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 9 Mar 2020 15:52:14 +0000 (16:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 17:19:31 +0000 (18:19 +0100)
KVM allows to use revision_id from MSR_IA32_VMX_BASIC as eVMCS revision_id
to workaround a bug in genuine Hyper-V (see the comment in
nested_vmx_handle_enlightened_vmptrld()), this shouldn't be used by
default. Switch to using KVM_EVMCS_VERSION(1).

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/evmcs.h
tools/testing/selftests/kvm/lib/x86_64/vmx.c

index 4912d23..d8f4d6b 100644 (file)
@@ -16,6 +16,8 @@
 #define u32 uint32_t
 #define u64 uint64_t
 
+#define EVMCS_VERSION 1
+
 extern bool enable_evmcs;
 
 struct hv_vp_assist_page {
index ff0a657..6f17f69 100644 (file)
@@ -191,7 +191,7 @@ bool load_vmcs(struct vmx_pages *vmx)
                if (evmcs_vmptrld(vmx->enlightened_vmcs_gpa,
                                  vmx->enlightened_vmcs))
                        return false;
-               current_evmcs->revision_id = vmcs_revision();
+               current_evmcs->revision_id = EVMCS_VERSION;
        }
 
        return true;