Skip to content

Use static_call for kvm_pmu_ops

Like Xu kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 5 repliesIn review
  2. v13 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- Export kvm_pmu_is_valid_msr() for nVMX [Sean]
- Land memcpy() above kvm_ops_static_call_update() [Sean]
- Move the pmu_ops to kvm_x86_init_ops and tagged as __initdata. [Sean]
- Move the kvm_ops_static_call_update() to x86.c [Sean]
- Drop kvm_pmu_ops_static_call_update() [Sean]
- Fix WARNING that macros KVM_X86_OP should not use a trailing semicolon

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7KVM: x86: Export kvm_pmu_is_valid_msr() for nVMXarch/x86/kvm/pmu.c arch/x86/kvm/vmx/nested.c+2 -11 reply
2/7KVM: x86: Fix WARNING that macros should not use a trailing semicolonarch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+112 -1120 replies
3/7KVM: x86: Move kvm_ops_static_call_update() to x86.carch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+8 -80 replies
4/7KVM: x86: Copy kvm_pmu_ops by value to eliminate layer of indirectionarch/x86/kvm/pmu.c arch/x86/kvm/pmu.h arch/x86/kvm/x86.c+26 -201 reply
5/7KVM: x86: Move .pmu_ops to kvm_x86_init_ops and tagged as __initdataarch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/pmu.c arch/x86/kvm/svm/svm.c +3 more+7 -71 reply
6/7KVM: x86: Introduce definitions to support static calls for kvm_pmu_opsarch/x86/include/asm/kvm-x86-pmu-ops.h arch/x86/kvm/pmu.c arch/x86/kvm/pmu.h+43 -02 replies
7/7KVM: x86: Use static calls to reduce kvm_pmu_ops overheadarch/x86/kvm/pmu.c arch/x86/kvm/pmu.h arch/x86/kvm/x86.c+23 -200 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchSean Christopherson
1/7
2/7
3/7
4/7
5/7R-b
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] Use static_call for kvm_pmu_ops

Hi,

This is a successor to a previous patch set from Jason Baron. Let's convert kvm_pmu_ops to use static_call. Shows good performance gains for a typical perf use case [2] in the guest (results in patch 3/3).

V1 -> V2 Changelog:
- Export kvm_pmu_is_valid_msr() for nVMX [Sean]
- Land memcpy() above kvm_ops_static_call_update() [Sean]
- Move the pmu_ops to kvm_x86_init_ops and tagged as __initdata. [Sean]
- Move the kvm_ops_static_call_update() to x86.c [Sean]
- Drop kvm_pmu_ops_static_call_update() [Sean]
- Fix WARNING that macros KVM_X86_OP should not use a trailing semicolon

Previous:
https://lore.kernel.org/kvm/[email protected]/

[1] https://lore.kernel.org/lkml/[email protected]/
[2] perf record -e branch-instructions -e branch-misses \
-e cache-misses -e cache-references -e cpu-cycles \
-e instructions ./workload

Thanks,

Like Xu (7):
KVM: x86: Export kvm_pmu_is_valid_msr() for nVMX
KVM: x86: Fix WARNING that macros should not use a trailing semicolon
KVM: x86: Move kvm_ops_static_call_update() to x86.c
KVM: x86: Copy kvm_pmu_ops by value to eliminate layer of indirection
KVM: x86: Move .pmu_ops to kvm_x86_init_ops and tagged as __initdata
KVM: x86: Introduce definitions to support static calls for
kvm_pmu_ops
KVM: x86: Use static calls to reduce kvm_pmu_ops overhead

 arch/x86/include/asm/kvm-x86-ops.h     | 218 ++++++++++++-------------
 arch/x86/include/asm/kvm-x86-pmu-ops.h |  32 ++++
 arch/x86/include/asm/kvm_host.h        |  14 +-
 arch/x86/kvm/pmu.c                     |  46 +++---
 arch/x86/kvm/pmu.h                     |   9 +-
 arch/x86/kvm/svm/pmu.c                 |   2 +-
 arch/x86/kvm/svm/svm.c                 |   2 +-
 arch/x86/kvm/vmx/nested.c              |   2 +-
 arch/x86/kvm/vmx/pmu_intel.c           |   2 +-
 arch/x86/kvm/vmx/vmx.c                 |   2 +-
 arch/x86/kvm/x86.c                     |  16 +-
 11 files changed, 199 insertions(+), 146 deletions(-)
 create mode 100644 arch/x86/include/asm/kvm-x86-pmu-ops.h
Signature · 1 line
2.33.0