KVM: x86: VMX: fix build without hyper-v
[muen/linux.git] / arch / x86 / kvm / vmx.c
index fc61e25966e470d82a52f915c8be9aca379be614..d0dd35d582da4c7eb7887d9063a6139ad4d1b405 100644 (file)
@@ -4429,6 +4429,7 @@ static int alloc_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
                        goto out_vmcs;
                memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE);
 
+#if IS_ENABLED(CONFIG_HYPERV)
                if (static_branch_unlikely(&enable_evmcs) &&
                    (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
                        struct hv_enlightened_vmcs *evmcs =
@@ -4436,6 +4437,8 @@ static int alloc_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
 
                        evmcs->hv_enlightenments_control.msr_bitmap = 1;
                }
+#endif
+
        }
        return 0;