Enable x86 mediated vPMU
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | kvm: Introduce kvm_arch_pre_create_vcpu()accel/ include/ target/ +6 more | +41 | 0 replies | |
| 2/3 | target/i386: Call KVM_CAP_PMU_CAPABILITY iotcl to enable/disable PMUtarget/ | +17 | 4 replies | |
| 3/3 | target/i386: Support VMX_VM_EXIT_SAVE_IA32_PERF_GLOBAL_CTRLtarget/ target/ | +9 | 2 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Gerd Hoffmann |
|---|---|
| 1/3 | A-b |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] Enable x86 mediated vPMU
This small patch series enables the newly introduced KVM x86 mediated vPMU solution. As KVM maintainer's suggestion, KVM mediated vPMU is disabled by default unless user explicitly calls KVM_CAP_PMU_CAPABILITY ioctl to enable it.
As for mediated vPMU, it's a new pass-through vPMU solution which is designed to replace the legacy perf-based vPMU which has several drawbacks, such as high performance overhead, hard to support new PMU features, etc. Most of PMU MSRs except EVENTSELx are passed through to guest in mediated vPMU. Currently the latest mediated vPMU patch series is v3[1], the v4 patchset would be sent soon.
In this series, patch 1/3 introduces a helper kvm_arch_pre_create_vcpu() which would be called before creating vCPU. This patch comes from Xiaoyao's "QEMU TDX support" patchset[2]. Patch 2/3 leverages the patch 1/3 introduced helper to call KVM_CAP_PMU_CAPABILITY ioctl to enable/disable KVM vPMU (mediated vPMU). This patch is similar with patch 4/10 of Dongli's "target/i386/kvm/pmu: PMU Enhancement, Bugfix and Cleanup" patchset[3], but can be considered as an enhanced version. Patch 3/3 provides support for newly introduced VMCS bit SAVE_IA32_PERF_GLOBAL_CTRL.
Tests:
* Tests on Sapphire Rapids platform, both mediated vPMU and legacy perf-based vPMU can be enabled/disabled with "+/-pmu" option.
Ref:
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/
Dapeng Mi (2):
target/i386: Call KVM_CAP_PMU_CAPABILITY iotcl to enable/disable PMU target/i386: Support VMX_VM_EXIT_SAVE_IA32_PERF_GLOBAL_CTRL
Xiaoyao Li (1):
kvm: Introduce kvm_arch_pre_create_vcpu()
accel/kvm/kvm-all.c | 5 +++++ include/system/kvm.h | 1 + target/arm/kvm.c | 5 +++++ target/i386/cpu.c | 12 ++++++++---- target/i386/cpu.h | 1 + target/i386/kvm/kvm.c | 22 ++++++++++++++++++++++ target/loongarch/kvm/kvm.c | 5 +++++ target/mips/kvm.c | 5 +++++ target/ppc/kvm.c | 5 +++++ target/riscv/kvm/kvm-cpu.c | 5 +++++ target/s390x/kvm/kvm.c | 5 +++++ 11 files changed, 67 insertions(+), 4 deletions(-)
base-commit: 71119ed3651622e1c531d1294839e9f3341adaf5
Signature · 1 line
2.40.1