Merge tag 'trace-v4.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
[sfrench/cifs-2.6.git] / arch / x86 / kvm / cpuid.c
index b671fc2d0422717f06ca6291b2a76742ee45537a..82055b90a8b31480e50eb6fe5ee57febc641d32c 100644 (file)
@@ -135,6 +135,11 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu)
                        return -EINVAL;
        }
 
+       best = kvm_find_cpuid_entry(vcpu, KVM_CPUID_FEATURES, 0);
+       if (kvm_hlt_in_guest(vcpu->kvm) && best &&
+               (best->eax & (1 << KVM_FEATURE_PV_UNHALT)))
+               best->eax &= ~(1 << KVM_FEATURE_PV_UNHALT);
+
        /* Update physical-address width */
        vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu);
        kvm_mmu_reset_context(vcpu);
@@ -370,7 +375,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
                F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
                F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
                0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) |
-               F(TOPOEXT);
+               F(TOPOEXT) | F(PERFCTR_CORE);
 
        /* cpuid 0x80000008.ebx */
        const u32 kvm_cpuid_8000_0008_ebx_x86_features =