KVM: VMX: call ept_sync_global() with enable_ept only
authorDavid Hildenbrand <david@redhat.com>
Thu, 24 Aug 2017 18:51:29 +0000 (20:51 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Oct 2017 12:01:52 +0000 (14:01 +0200)
ept_* function should only be called with enable_ept being set.

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c

index c757070a32a71638be79a0cfa25f5c4377cd5274..7d944d3feb8a68ab1f9749a5d429ddaa5a307a74 100644 (file)
@@ -3542,7 +3542,8 @@ static int hardware_enable(void)
                wrmsrl(MSR_IA32_FEATURE_CONTROL, old | test_bits);
        }
        kvm_cpu_vmxon(phys_addr);
-       ept_sync_global();
+       if (enable_ept)
+               ept_sync_global();
 
        return 0;
 }