diff options
author | Jim Mattson <jmattson@google.com> | 2016-12-20 19:34:50 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-14 08:00:17 -0400 |
commit | 39058adebbb1fa2e7eedbfa138f4abf978fede77 (patch) | |
tree | 764d68b29d2c34a45fca7a85ce9802342bd1c8c0 /arch/x86 | |
parent | b6cd52a0eeaf4e5dfc73d962b8a62211afa3f1bd (diff) |
Revert "KVM: nested VMX: disable perf cpuid reporting"
commit 0b4c208d443ba2af82b4c70f99ca8df31e9a0020 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/cpuid.c | 6 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 2 |
2 files changed, 0 insertions, 8 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index afa7bbb596cd..967e459ff1e6 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c | |||
@@ -846,12 +846,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx) | |||
846 | if (!best) | 846 | if (!best) |
847 | best = check_cpuid_limit(vcpu, function, index); | 847 | best = check_cpuid_limit(vcpu, function, index); |
848 | 848 | ||
849 | /* | ||
850 | * Perfmon not yet supported for L2 guest. | ||
851 | */ | ||
852 | if (is_guest_mode(vcpu) && function == 0xa) | ||
853 | best = NULL; | ||
854 | |||
855 | if (best) { | 849 | if (best) { |
856 | *eax = best->eax; | 850 | *eax = best->eax; |
857 | *ebx = best->ebx; | 851 | *ebx = best->ebx; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 43b55ef82bac..980133079949 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -8051,8 +8051,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) | |||
8051 | case EXIT_REASON_TASK_SWITCH: | 8051 | case EXIT_REASON_TASK_SWITCH: |
8052 | return true; | 8052 | return true; |
8053 | case EXIT_REASON_CPUID: | 8053 | case EXIT_REASON_CPUID: |
8054 | if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa) | ||
8055 | return false; | ||
8056 | return true; | 8054 | return true; |
8057 | case EXIT_REASON_HLT: | 8055 | case EXIT_REASON_HLT: |
8058 | return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING); | 8056 | return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING); |