KVM: x86: Provide a cap to disable APERF/MPERF read intercepts
Status from this message: Applied to kvm-x86 misc, with the thean typo fixed. Thanks!
Get series with b4
b4 am [email protected]Versions newest first
Changes in v5 from the cover letter
- Rebase on top of the MSR interception rework.
- Support passthrough to L2 on VMX (it was there somewhat unintentionally for SVM).
- Expand the selftest to cover the nested case.
- Sanity check that the MSRs are inaccesible in the selftest.
- Add selftests patches to expand the task=>CPU pinning APIs.
- OR-in the new disabled exits in one batch.
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | KVM: x86: Replace growing set of *_in_guest bools with a u64arch/ arch/ arch/ +2 more | +13 | 1 reply | |
| 2/5 | KVM: x86: Provide a capability to disable APERF/MPERF read interceptsDocumentation/ arch/ arch/ +6 more | +53 | 1 reply | |
| 3/5 | KVM: selftests: Expand set of APIs for pinning tasks to a single CPUtools/ tools/ tools/ | +38 | 0 replies | |
| 4/5 | KVM: selftests: Test behavior of KVM_X86_DISABLE_EXITS_APERFMPERFtools/ tools/ | +214 | 0 replies | |
| 5/5 | KVM: selftests: Convert arch_timer tests to common helpers to pin tasktools/ tools/ | +3 | 0 replies |
Reviews trailers per patch
2 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Xiaoyao Li |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/5] KVM: x86: Provide a cap to disable APERF/MPERF read intercepts
arm64 folks, y'all got pulled in because of selftests changes. I deliberately put that patch at the end of the series so that it can be discarded/ignored without interfering with the x86 stuff.
Jim's series to allow a guest to read IA32_APERF and IA32_MPERF, so that it can determine the effective frequency multiplier for the physical LPU.
Commit b51700632e0e ("KVM: X86: Provide a capability to disable cstate msr read intercepts") allowed the userspace VMM to grant a guest read access to four core C-state residency MSRs. Do the same for IA32_APERF and IA32_MPERF.
While this isn't sufficient to claim support for CPUID.6:ECX.APERFMPERF[bit 0], it may suffice in a sufficiently restricted environment (i.e. vCPUs pinned to LPUs, no TSC multiplier, and no suspend/resume).
v5:
- Rebase on top of the MSR interception rework.
- Support passthrough to L2 on VMX (it was there somewhat unintentionally for SVM).
- Expand the selftest to cover the nested case.
- Sanity check that the MSRs are inaccesible in the selftest.
- Add selftests patches to expand the task=>CPU pinning APIs.
- OR-in the new disabled exits in one batch.
v4:
- https://lore.kernel.org/all/[email protected]
- Collect all disabled_exit flags in a u64 [Sean]
- Improve documentation [Sean]
- Add pin_task_to_one_cpu() to kvm selftests library [Sean]
v3:
- https://lore.kernel.org/all/[email protected]
- Add a selftest
v2:
- https://lore.kernel.org/all/[email protected]
- Add {IA32_APERF,IA32_MPERF} to vmx_possible_passthrough_msrs[]
v1:
- https://lore.kernel.org/all/[email protected]
Jim Mattson (3):
KVM: x86: Replace growing set of *_in_guest bools with a u64
KVM: x86: Provide a capability to disable APERF/MPERF read intercepts
KVM: selftests: Test behavior of KVM_X86_DISABLE_EXITS_APERFMPERF
Sean Christopherson (2):
KVM: selftests: Expand set of APIs for pinning tasks to a single CPU
KVM: selftests: Convert arch_timer tests to common helpers to pin task
Documentation/virt/kvm/api.rst | 23 ++ arch/x86/include/asm/kvm_host.h | 5 +- arch/x86/kvm/svm/nested.c | 4 +- arch/x86/kvm/svm/svm.c | 7 +- arch/x86/kvm/vmx/nested.c | 6 + arch/x86/kvm/vmx/vmx.c | 6 +- arch/x86/kvm/x86.c | 15 +- arch/x86/kvm/x86.h | 18 +- include/uapi/linux/kvm.h | 1 + tools/include/uapi/linux/kvm.h | 1 + tools/testing/selftests/kvm/Makefile.kvm | 1 + tools/testing/selftests/kvm/arch_timer.c | 7 +- .../kvm/arm64/arch_timer_edge_cases.c | 23 +- .../testing/selftests/kvm/include/kvm_util.h | 31 ++- tools/testing/selftests/kvm/lib/kvm_util.c | 15 +- tools/testing/selftests/kvm/lib/memstress.c | 2 +- .../selftests/kvm/x86/aperfmperf_test.c | 213 ++++++++++++++++++ 17 files changed, 321 insertions(+), 57 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86/aperfmperf_test.c
base-commit: 7ee45fdd644b138e7a213c6936474161b28d0e1a
Signature · 1 line
2.50.0.727.gbf7dc18ff4-goog