kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/8] KVM: x86: Intel LBR related perf cleanups
@ 2022-10-06  0:03 Sean Christopherson
  2022-10-06  0:03 ` [PATCH v5 1/8] perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr() stub Sean Christopherson
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Sean Christopherson @ 2022-10-06  0:03 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

PeterZ, I dropped your ACK from v4 because the perf patches were completely
broken.

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 patch cleans up a KVM-specific perf API to fix a benign bug
where KVM ignores the error return from the API.

The remaining patches clean up KVM's PERF_CAPABILITIES mess, which makes
everything far more complex than it needs to be by 

v5:
 - Drop perf patches that removed stubs.  The stubs are sadly necessary
   when CPU_SUP_INTEL=n && KVM_INTEL={m,y}, which is possible due to
   KVM_INTEL effectively depending on INTEL || CENTAUR || ZHAOXIN.
   [hint provided by kernel test robot].
 - Add a patch to ignore guest CPUID on host userspace MSR writes.
 - Add supported PERF_CAPABILITIES to kvm_caps to simplify code for all
   parties.

v4
 - https://lore.kernel.org/all/20220901173258.925729-1-seanjc@google.com:
 - 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 (8):
  perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr()
    stub
  KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs
  KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl()
  KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL
  KVM: x86: Track supported PERF_CAPABILITIES in kvm_caps
  KVM: x86: Init vcpu->arch.perf_capabilities in common x86 code
  KVM: x86: Handle PERF_CAPABILITIES in common x86's
    kvm_get_msr_feature()
  KVM: x86: Directly query supported PERF_CAPABILITIES for WRMSR checks

 arch/x86/events/intel/lbr.c       |  6 +---
 arch/x86/include/asm/perf_event.h |  6 ++--
 arch/x86/kvm/svm/svm.c            |  3 +-
 arch/x86/kvm/vmx/capabilities.h   | 37 ----------------------
 arch/x86/kvm/vmx/pmu_intel.c      |  1 -
 arch/x86/kvm/vmx/vmx.c            | 51 +++++++++++++++++++++++--------
 arch/x86/kvm/x86.c                | 14 ++++-----
 arch/x86/kvm/x86.h                |  1 +
 8 files changed, 52 insertions(+), 67 deletions(-)


base-commit: e18d6152ff0f41b7f01f9817372022df04e0d354
-- 
2.38.0.rc1.362.ged0d419d3c-goog


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

end of thread, other threads:[~2022-11-02 17:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06  0:03 [PATCH v5 0/8] KVM: x86: Intel LBR related perf cleanups Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 1/8] perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr() stub Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 2/8] KVM: VMX: Advertise PMU LBRs if and only if perf supports LBRs Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 3/8] KVM: VMX: Fold vmx_supported_debugctl() into vcpu_supported_debugctl() Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 4/8] KVM: VMX: Ignore guest CPUID for host userspace writes to DEBUGCTL Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 5/8] KVM: x86: Track supported PERF_CAPABILITIES in kvm_caps Sean Christopherson
2022-10-14  9:25   ` Like Xu
2022-10-06  0:03 ` [PATCH v5 6/8] KVM: x86: Init vcpu->arch.perf_capabilities in common x86 code Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 7/8] KVM: x86: Handle PERF_CAPABILITIES in common x86's kvm_get_msr_feature() Sean Christopherson
2022-10-06  0:03 ` [PATCH v5 8/8] KVM: x86: Directly query supported PERF_CAPABILITIES for WRMSR checks Sean Christopherson
2022-11-02 17:18 ` [PATCH v5 0/8] KVM: x86: Intel LBR related perf cleanups Paolo Bonzini

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).