[PATCH v3 0/3] KVM: x86: Intel LBR related perf cleanups.

From: Sean Christopherson
Date: Tue Aug 30 2022 - 20:01:02 EST


WAS: Bug fixes and cleanups related to KVM's handling of PERF_CAPABILITIES.

Fix a bug where KVM incorrectly advertises PMU_CAP_LBR_FMT to userspace if
perf has disabled LBRs, e.g. because probing one or more LBR MSRs during
setup hit a #GP.

The non-KVM patches remove unnecessary stubs and unreachable error paths,
which allows for a cleaner fix for said bug.

v3:
- Drop patches for bug #1 (already merged).
- Drop misguided "clean up the capability check" patch. [Like]

v2:
- https://lore.kernel.org/all/20220803192658.860033-1-seanjc@xxxxxxxxxx
- Add patches to fix bug #2. [Like]
- Add a patch to clean up the capability check.
- Tweak the changelog for the PMU refresh bug fix to call out that
KVM should disallow changing feature MSRs after KVM_RUN. [Like]

v1: https://lore.kernel.org/all/20220727233424.2968356-1-seanjc@xxxxxxxxxx

Sean Christopherson (3):
perf/x86/core: Remove unnecessary stubs provided for KVM-only helpers
perf/x86/core: Drop the unnecessary return value from
x86_perf_get_lbr()
KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs

arch/x86/events/intel/lbr.c | 6 +---
arch/x86/include/asm/perf_event.h | 55 ++++++++-----------------------
arch/x86/kvm/vmx/capabilities.h | 5 ++-
3 files changed, 19 insertions(+), 47 deletions(-)


base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2
--
2.37.2.672.g94769d06f0-goog