Skip to content

KVM in-guest performance monitoring

Avi Kivity kvm 2 versions – Applied

Status from this message: Queued them, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 45 repliesApplied
  2. v15 patches 34 repliesSuperseded

Changes in v2 from the cover letter

- don't pass perf_event handler context to the callback; extract it via the 'event' parameter instead
- RDPMC emulation and interception
- CR4.PCE emulation

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/11perf: add context field to perf_eventarch/arm/kernel/ptrace.c arch/powerpc/kernel/ptrace.c arch/sh/kernel/ptrace_32.c +9 more+44 -200 replies
2/11x86, perf: add constraints for architectural PMU v1arch/x86/kernel/cpu/perf_event_intel.c+18 -50 replies
3/11perf: export perf_event_refresh() to modulesinclude/linux/perf_event.h kernel/events/core.c+7 -10 replies
4/11KVM: Expose kvm_lapic_local_deliver()arch/x86/kvm/lapic.c arch/x86/kvm/lapic.h+2 -10 replies
5/11KVM: Expose a version 1 architectural PMU to guestsarch/x86/include/asm/kvm_host.h arch/x86/kvm/Makefile arch/x86/kvm/pmu.c +1 more+293 -96 replies
6/11KVM: Add generic RDPMC supportarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+16 -00 replies
7/11KVM: SVM: Intercept RDPMCarch/x86/kvm/svm.c+15 -00 replies
8/11KVM: VMX: Intercept RDPMCarch/x86/kvm/vmx.c+14 -17 replies
9/11KVM: Expose the architectural performance monitoring CPUID leafarch/x86/kvm/x86.c+19 -10 replies
10/11KVM: x86 emulator: fix RDPMC privilege checkarch/x86/kvm/emulate.c+1 -10 replies
11/11KVM: x86 emulator: implement RDPMC (0F 33)arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+20 -10 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 00/11] KVM in-guest performance monitoring

This patchset exposes an emulated version 1 architectural performance monitoring unit to KVM guests. The PMU is emulated using perf_events, so the host kernel can multiplex host-wide, host-user, and the guest on available resources.

Caveats:
- counters that have PMI (interrupt) enabled stop counting after the interrupt is signalled. This is because we need one-shot samples that keep counting, which perf doesn't support yet
- some combinations of INV and CMASK are not supported
- counters keep on counting in the host as well as the guest

perf maintainers: please consider the first three patches for merging (the first two make sense even without the rest). If you're familiar with the Intel PMU, please review patch 5 as well - it effectively undoes all your work of abstracting the PMU into perf_events by unabstracting perf_events into what is hoped is a very similar PMU.

v2:
- don't pass perf_event handler context to the callback; extract it via the 'event' parameter instead
- RDPMC emulation and interception
- CR4.PCE emulation