]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs
authorSean Christopherson <seanjc@google.com>
Thu, 6 Oct 2022 00:03:08 +0000 (00:03 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Nov 2022 17:17:58 +0000 (13:17 -0400)
commit5c9a3534c39c7f8623efac71227109553ce4e8d4
tree2f3c21c089436c57917e234640f1ceee2bf4633d
parent6a9d0f400ee4579175303bb65b0900448b163a11
KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs

Advertise LBR support to userspace via MSR_IA32_PERF_CAPABILITIES if and
only if perf fully supports LBRs.  Perf may disable LBRs (by zeroing the
number of LBRs) even on platforms the allegedly support LBRs, e.g. if
probing any LBR MSRs during setup fails.

Fixes: 380eacfeb74e ("KVM: vmx/pmu: Expose LBR_FMT in the MSR_IA32_PERF_CAPABILITIES")
Reported-by: Like Xu <like.xu.linux@gmail.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221006000314.73240-3-seanjc@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/capabilities.h