KVM: VMX: Treat UMIP as emulated if and only if the host doesn't have UMIP
[sfrench/cifs-2.6.git] / arch / x86 / kvm / vmx / capabilities.h
index 45162c1bcd8f5cff68d026140cd4c03efe224955..d0abee35d7ba48fd134d4c52c262e1e9471eb4ae 100644 (file)
@@ -152,8 +152,8 @@ static inline bool cpu_has_vmx_ept(void)
 
 static inline bool vmx_umip_emulated(void)
 {
-       return vmcs_config.cpu_based_2nd_exec_ctrl &
-               SECONDARY_EXEC_DESC;
+       return !boot_cpu_has(X86_FEATURE_UMIP) &&
+              (vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_DESC);
 }
 
 static inline bool cpu_has_vmx_rdtscp(void)