KVM: VMX: Add full nested support for IA32_PERF_GLOBAL_CTRL
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest9 patches 12 repliesIn review
- v38 patches 6 repliesSuperseded
- v28 patches 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 7 patches | 15 replies | Superseded |
Changes in v4 from the cover letter
- Allow tests to set the guest func multiple times
- Style fixes throughout kvm-unit-tests patches, per Krish's review
Patches in v4 No applies recorded yet
Reviews trailers per patch
All 9 patches have a Reviewed-by or Acked-by.
| Patch | Jim Mattson | Peter Shier | Krish Sadhukhan |
|---|---|---|---|
| 1/9 | R-b | R-b | |
| 2/9 | R-b | R-b | |
| 3/9 | R-b | R-b | |
| 4/9 | R-b | R-b | |
| 5/9 | R-b | R-b | |
| 6/9 | R-b | R-b | |
| 7/9 | R-b | ||
| 8/9 | R-b | ||
| 9/9 | R-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.
Cover letter [PATCH v4 0/9] KVM: VMX: Add full nested support for IA32_PERF_GLOBAL_CTRL
[v1] https://lore.kernel.org/r/[email protected]
[v2] https://lore.kernel.org/r/[email protected]
[v3] 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
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.
Purpose of each patch:
(1) Change the existing code that implemented the VM-exit functionality to use kvm_set_msr() to avoid being overwritten by atomic_perf_switch_msrs().
(2) Update prepare_vmcs02() to implement the VM-entry functionality, again using kvm_set_msr().
(3) Create a helper function for checking the validity of an
IA32_PERF_GLOBAL_CTRL value against pmu->global_ctrl_mask.
(4) Check guest state on VM-entry as described in the SDM.
(5) Check host state on VM-entry as described in the SDM.
(6) Expose the "load IA32_PERF_GLOBAL_CTRL" VM-entry and VM-exit controls if IA32_PERF_GLOBAL_CTRL is a valid MSR.
(7) Modify guest_state_test_main() to check guest state MSRs
(8) Tests in kvm-unit-tests to check the VM-entry and VM-exit controls work properly
Oliver Upton (6):
KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on vmexit
KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on vm-entry
KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL
KVM: nVMX: check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry
KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-entry
KVM: nVMX: Expose load IA32_PERF_GLOBAL_CTRL vm control if supported
arch/x86/kvm/pmu.h | 6 ++++++ arch/x86/kvm/vmx/nested.c | 37 +++++++++++++++++++++++++++++++++--- arch/x86/kvm/vmx/pmu_intel.c | 5 ++++- arch/x86/kvm/vmx/vmx.c | 21 ++++++++++++++++++++ arch/x86/kvm/vmx/vmx.h | 1 + 5 files changed, 66 insertions(+), 4 deletions(-)
Signature · 1 line
2.23.0.187.g17f5b7556c-goog