Skip to content

KVM: x86/pmu: Counter reprogramming fixes

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: x86/pmu: Force reprogramming of all counters on PMU filter changearch/x86/include/asm/kvm_host.h arch/x86/kvm/pmu.c+23 -33 replies
2/4KVM: x86/pmu: Clear "reprogram" bit if counter is disabled or disallowedarch/x86/kvm/pmu.c+24 -142 replies
3/4KVM: x86/pmu: Defer reprogram_counter() to kvm_pmu_handle_event()arch/x86/include/asm/kvm_host.h arch/x86/kvm/pmu.c arch/x86/kvm/pmu.h +2 more+22 -100 replies
4/4KVM: x86/pmu: Defer counter emulated overflow via pmc->prev_counterarch/x86/include/asm/kvm_host.h arch/x86/kvm/pmu.c arch/x86/kvm/svm/pmu.c +1 more+22 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: x86/pmu: Counter reprogramming fixes

The headliner is Like's patches to fix a bug where KVM's sleeps with IRQs disabled due to attempting to pause and reprogram PMU counters in the VM-Exit fast path.

Patches 1 and 2 (mine) fix mostly theoretical issues found when reviewing Like's code, and would conflict with Like's patches if posted separately.

This is _very_ lightly tested, borderline RFC, but Like's updated PMU KUT tests pass, as do the filter selftests, and I'm feeling lucky.

And I'm offline until Monday, so a traditional Friday patch bomb is in order ;-)

Like Xu (2):
KVM: x86/pmu: Defer reprogram_counter() to kvm_pmu_handle_event()
KVM: x86/pmu: Defer counter emulated overflow via pmc->prev_counter

Sean Christopherson (2):
KVM: x86/pmu: Force reprogramming of all counters on PMU filter change
KVM: x86/pmu: Clear "reprogram" bit if counter is disabled or
disallowed

 arch/x86/include/asm/kvm_host.h | 17 ++++--
 arch/x86/kvm/pmu.c              | 92 +++++++++++++++++++++------------
 arch/x86/kvm/pmu.h              |  6 ++-
 arch/x86/kvm/svm/pmu.c          |  4 +-
 arch/x86/kvm/vmx/pmu_intel.c    | 10 ++--
 5 files changed, 86 insertions(+), 43 deletions(-)

base-commit: efc8a6befa592de7e2fd4927b1b9a56a5ec7d8cf

Signature · 1 line
2.37.3.998.g577e59143f-goog