Revert "KVM: nested VMX: disable perf cpuid reporting"
authorJim Mattson <jmattson@google.com>
Wed, 21 Dec 2016 00:34:50 +0000 (16:34 -0800)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 20 Jan 2017 21:18:55 +0000 (22:18 +0100)
This reverts commit bc6134942dbbf31c25e9bd7c876be5da81c9e1ce.

A CPUID instruction executed in VMX non-root mode always causes a
VM-exit, regardless of the leaf being queried.

Fixes: bc6134942dbb ("KVM: nested VMX: disable perf cpuid reporting")
Signed-off-by: Jim Mattson <jmattson@google.com>
[The issue solved by bc6134942dbb has been resolved with ff651cb613b4
 ("KVM: nVMX: Add nested msr load/restore algorithm").]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/vmx.c

index 09c2ac741567ba26a4c16b3c7a7829baabea1458..c0e2036217ada0895284c4df8d4629f3bdd73a3c 100644 (file)
@@ -861,12 +861,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
        if (!best)
                best = check_cpuid_limit(vcpu, function, index);
 
-       /*
-        * Perfmon not yet supported for L2 guest.
-        */
-       if (is_guest_mode(vcpu) && function == 0xa)
-               best = NULL;
-
        if (best) {
                *eax = best->eax;
                *ebx = best->ebx;
index 4e691035a32d392bc050a98ff216e77d495469c3..c7bafa1457e2954407cdfc2fff560a2c9ef4caa9 100644 (file)
@@ -8203,8 +8203,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
        case EXIT_REASON_TASK_SWITCH:
                return true;
        case EXIT_REASON_CPUID:
-               if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa)
-                       return false;
                return true;
        case EXIT_REASON_HLT:
                return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING);