Skip to content

KVM: nVMX: Add full nested support for "load IA32_PERF_GLOBAL_CTRL" VM-{Entry,Exit} control

Oliver Upton kvm 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v5 Latest8 patches 2 repliesApplied

Changes in v5 from the cover letter

- Rebased kernel and kvm-unit-tests patches
- Reordered and reworked patches to now WARN on a failed kvm_set_msr()
- Dropped patch to alow resetting guest in kvm-unit-tests, as the functionality is no longer needed.

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/8KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRLarch/x86/kvm/pmu.h arch/x86/kvm/vmx/pmu_intel.c+7 -10 replies
2/8KVM: nVMX: Check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entryarch/x86/kvm/vmx/nested.c+6 -00 replies
3/8KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-Entryarch/x86/kvm/vmx/nested.c+5 -00 replies
4/8KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on VM-Exitarch/x86/kvm/vmx/nested.c+12 -20 replies
5/8KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on VM-Entryarch/x86/kvm/vmx/nested.c+5 -00 replies
6/8KVM: nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} controlarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/nested.h arch/x86/kvm/vmx/pmu_intel.c+25 -00 replies
7/8x86: VMX: Make guest_state_test_main() check state from nested VMx86/vmx_tests.c+18 -30 replies
8/8x86: VMX: Add tests for nested "load IA32_PERF_GLOBAL_CTRL"x86/vmx_tests.c+160 -00 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchJim MattsonPeter ShierKrish Sadhukhan
1/8R-b R-b
2/8R-b R-b
3/8R-b R-b
4/8R-b R-b
5/8R-b R-b
6/8R-b R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/8] KVM: nVMX: Add full nested support for "load IA32_PERF_GLOBAL_CTRL" VM-{Entry,Exit} control

[v1] https://lore.kernel.org/r/[email protected]
[v2] https://lore.kernel.org/r/[email protected]
[v3] https://lore.kernel.org/r/[email protected]
[v4] https://lore.kernel.org/r/[email protected]

v1 => v2:
- Add Krish's Co-developed-by and Signed-off-by tags.
- Fix minor nit to kvm-unit-tests to use 'host' local variable throughout test_load_pgc()
- Teach guest_state_test_main() to check guest state from within nested VM
- Update proposed tests to use guest/host state checks, wherein the value is checked from MSR_CORE_PERF_GLOBAL_CTRL.
- Changelog line wrapping

v2 => v3:
- Remove the value unchanged condition from
kvm_is_valid_perf_global_ctrl
- Add line to changelog for patch 3/8

v3 => v4:
- Allow tests to set the guest func multiple times
- Style fixes throughout kvm-unit-tests patches, per Krish's review

v4 => v5:
- Rebased kernel and kvm-unit-tests patches
- Reordered and reworked patches to now WARN on a failed kvm_set_msr()
- Dropped patch to alow resetting guest in kvm-unit-tests, as the functionality is no longer needed.

This patchset exposes the "load IA32_PERF_GLOBAL_CTRL" to guests for nested VM-entry and VM-exit. There already was some existing code that supported the VM-exit ctrl, though it had an issue and was not exposed to the guest anyway. These patches are based on the original set that Krish Sadhukhan sent out earlier this year.

Oliver Upton (6):
KVM: nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control
KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on VM-Entry
KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on VM-Exit
KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-Entry
KVM: nVMX: Check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry
KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL

 arch/x86/kvm/pmu.h           |  6 ++++++
 arch/x86/kvm/vmx/nested.c    | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 arch/x86/kvm/vmx/nested.h    |  1 +
 arch/x86/kvm/vmx/pmu_intel.c |  5 ++++-
Signature · 1 line
2.23.0.187.g17f5b7556c-goog