linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5]  KVM: x86: Intel LBR related perf cleanups
@ 2022-09-01 17:32 Sean Christopherson
  2022-09-01 17:32 ` [PATCH v4 1/5] perf/x86/core: Remove unnecessary stubs provided for KVM-only helpers Sean Christopherson
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Sean Christopherson @ 2022-09-01 17:32 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Sean Christopherson, Paolo Bonzini
  Cc: Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel, kvm, Like Xu

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 (backporting is unlikely to be
necessary/requested).

v4
 - Make vmx_get_perf_capabilities() non-inline to avoid references to
   x86_perf_get_lbr() when CPU_SUP_INTEL=n. [kernel test robot]

v3:
 - https://lore.kernel.org/all/20220831000051.4015031-1-seanjc@google.com
 - 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@google.com
 - 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@google.com

Sean Christopherson (5):
  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: Move vmx_get_perf_capabilities() definition to vmx.c
  KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl()
  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   | 39 ++--------------------
 arch/x86/kvm/vmx/vmx.c            | 37 ++++++++++++++++++---
 4 files changed, 49 insertions(+), 88 deletions(-)


base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2
-- 
2.37.2.789.g6183377224-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-03 17:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01 17:32 [PATCH v4 0/5] KVM: x86: Intel LBR related perf cleanups Sean Christopherson
2022-09-01 17:32 ` [PATCH v4 1/5] perf/x86/core: Remove unnecessary stubs provided for KVM-only helpers Sean Christopherson
2022-09-02  2:39   ` kernel test robot
2022-09-02  2:53   ` kernel test robot
2022-09-02  2:54   ` kernel test robot
2022-09-01 17:32 ` [PATCH v4 2/5] perf/x86/core: Drop the unnecessary return value from x86_perf_get_lbr() Sean Christopherson
2022-09-01 17:32 ` [PATCH v4 3/5] KVM: VMX: Move vmx_get_perf_capabilities() definition to vmx.c Sean Christopherson
2022-09-01 17:32 ` [PATCH v4 4/5] KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl() Sean Christopherson
2022-09-01 17:32 ` [PATCH v4 5/5] KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs Sean Christopherson
2022-09-08 13:45 ` [PATCH v4 0/5] KVM: x86: Intel LBR related perf cleanups Peter Zijlstra
2022-09-17  1:11   ` Sean Christopherson
2022-10-03 17:22     ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).