[Devel,RHEL7,COMMIT] ms: Revert "KVM: nested VMX: disable perf cpuid reporting"

Submitted by Konstantin Khorenko on Aug. 7, 2017, 9:35 a.m.


Message ID 201708070935.v779ZuFC006906@finist_cl7.x64_64.work.ct
State New
Series "Revert "KVM: nested VMX: disable perf cpuid reporting""
Headers show

Commit Message

Konstantin Khorenko Aug. 7, 2017, 9:35 a.m.
The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.33.22
commit 3b09bcc0f85a65df5ae48f5744805f2c71045f5b
Author: Jim Mattson <jmattson@google.com>
Date:   Mon Aug 7 13:35:55 2017 +0400

    ms: Revert "KVM: nested VMX: disable perf cpuid reporting"
    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>
    (cherry picked from commit 0b4c208d443ba2af82b4c70f99ca8df31e9a0020)
    Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
 arch/x86/kvm/cpuid.c | 6 ------
 arch/x86/kvm/vmx.c   | 2 --
 2 files changed, 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index e245bf66..f6be926 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -831,12 +831,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;
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 16ca8fa..6fd1049 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7663,8 +7663,6 @@  static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
 		return true;
-		if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa)
-			return false;
 		return true;
 		return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING);