aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/hyperv.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/hyperv.c')
-rw-r--r--arch/x86/kvm/hyperv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index c10a8b10b203..fff790a3f4ee 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -1781,7 +1781,7 @@ int kvm_vm_ioctl_hv_eventfd(struct kvm *kvm, struct kvm_hyperv_eventfd *args)
1781int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, 1781int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
1782 struct kvm_cpuid_entry2 __user *entries) 1782 struct kvm_cpuid_entry2 __user *entries)
1783{ 1783{
1784 uint16_t evmcs_ver = kvm_x86_ops->nested_get_evmcs_version(vcpu); 1784 uint16_t evmcs_ver = 0;
1785 struct kvm_cpuid_entry2 cpuid_entries[] = { 1785 struct kvm_cpuid_entry2 cpuid_entries[] = {
1786 { .function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS }, 1786 { .function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS },
1787 { .function = HYPERV_CPUID_INTERFACE }, 1787 { .function = HYPERV_CPUID_INTERFACE },
@@ -1793,6 +1793,9 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
1793 }; 1793 };
1794 int i, nent = ARRAY_SIZE(cpuid_entries); 1794 int i, nent = ARRAY_SIZE(cpuid_entries);
1795 1795
1796 if (kvm_x86_ops->nested_get_evmcs_version)
1797 evmcs_ver = kvm_x86_ops->nested_get_evmcs_version(vcpu);
1798
1796 /* Skip NESTED_FEATURES if eVMCS is not supported */ 1799 /* Skip NESTED_FEATURES if eVMCS is not supported */
1797 if (!evmcs_ver) 1800 if (!evmcs_ver)
1798 --nent; 1801 --nent;