Commit 4736ccc8 authored by Jim Mattson's avatar Jim Mattson Committed by Sasha Levin

Revert "KVM: nested VMX: disable perf cpuid reporting"

[ Upstream commit 0b4c208d ]

This reverts commit bc613494.

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

Fixes: bc613494 ("KVM: nested VMX: disable perf cpuid reporting")
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
[The issue solved by bc613494 has been resolved with ff651cb6
 ("KVM: nVMX: Add nested msr load/restore algorithm").]
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 7a07dbb8
...@@ -811,12 +811,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx) ...@@ -811,12 +811,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
if (!best) if (!best)
best = check_cpuid_limit(vcpu, function, index); 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) { if (best) {
*eax = best->eax; *eax = best->eax;
*ebx = best->ebx; *ebx = best->ebx;
......
...@@ -7540,8 +7540,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) ...@@ -7540,8 +7540,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
case EXIT_REASON_TASK_SWITCH: case EXIT_REASON_TASK_SWITCH:
return true; return true;
case EXIT_REASON_CPUID: case EXIT_REASON_CPUID:
if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa)
return false;
return true; return true;
case EXIT_REASON_HLT: case EXIT_REASON_HLT:
return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING); return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment