]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: VMX: Add helper to check if the guest PMU has PERF_GLOBAL_CTRL
authorSean Christopherson <seanjc@google.com>
Fri, 22 Jul 2022 22:44:07 +0000 (22:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 13:16:14 +0000 (15:16 +0200)
commit9863e9fc8ac2c13c786a26d49a69ae22201cffaf
treea49b98650e7b01a750c3037e6c715ed591089139
parentc08044267e7976a921294ade05cf986efb0c4f99
KVM: VMX: Add helper to check if the guest PMU has PERF_GLOBAL_CTRL

[ Upstream commit b663f0b5f3d665c261256d1f76e98f077c6e56af ]

Add a helper to check of the guest PMU has PERF_GLOBAL_CTRL, which is
unintuitive _and_ diverges from Intel's architecturally defined behavior.
Even worse, KVM currently implements the check using two different (but
equivalent) checks, _and_ there has been at least one attempt to add a
_third_ flavor.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220722224409.1336532-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/vmx/pmu_intel.c
arch/x86/kvm/vmx/vmx.h