KVM: VMX: call ept_sync_global() with enable_ept only

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>
This commit is contained in:
David Hildenbrand 2017-08-24 20:51:29 +02:00 committed by Paolo Bonzini
parent 0e1252dc46
commit fdf288bf72
1 changed files with 2 additions and 1 deletions

View 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;
}