Skip to content

kvm: x86: Fix PMU virtualization for some basic events

Jim Mattson kvm linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: x86: Update vPMCs when retiring instructionsarch/x86/kvm/pmu.c arch/x86/kvm/pmu.h arch/x86/kvm/x86.c+35 -08 replies
2/2KVM: x86: Update vPMCs when retiring branch instructionsarch/x86/kvm/emulate.c arch/x86/kvm/kvm_emulate.h arch/x86/kvm/vmx/nested.c +1 more+39 -260 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/2] kvm: x86: Fix PMU virtualization for some basic events

Google Cloud has a customer that needs accurate virtualization of two architected PMU events on Intel hardware: "instructions retired" and "branch instructions retired." The existing PMU virtualization code fails to account for instructions that are emulated by kvm.

Accurately virtualizing all PMU events for all microarchitectures is a herculean task, but there are only 8 architected events, so maybe we can at least try to get those right.

Eric Hankland wrote this code originally, but his plate is full, so I've volunteered to shepherd the changes through upstream acceptance.

Jim Mattson (2):
KVM: x86: Update vPMCs when retiring instructions
KVM: x86: Update vPMCs when retiring branch instructions

 arch/x86/kvm/emulate.c     | 57 +++++++++++++++++++++-----------------
 arch/x86/kvm/kvm_emulate.h |  1 +
 arch/x86/kvm/pmu.c         | 31 +++++++++++++++++++++
 arch/x86/kvm/pmu.h         |  1 +
 arch/x86/kvm/vmx/nested.c  |  6 +++-
 arch/x86/kvm/x86.c         |  5 ++++
 6 files changed, 75 insertions(+), 26 deletions(-)
Signature · 1 line
2.34.0.rc1.387.gb447b232ab-goog