]> git.baikalelectronics.ru Git - kernel.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 12:24:25 +0000 (14:24 +0200)
commitc30bf9414932b84eb6696195ba69917ef47c4bbd
tree130d2a171674b461479152b4697db4005c3602d8
parent9dacc72789fb8beffd19f8b2e6b954f038f5d292
KVM: VMX: Add helper to check if the guest PMU has PERF_GLOBAL_CTRL

[ Upstream commit 825db332ac1a23d0d50265b43090f7929d8d03ef ]

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