kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] KVM: VMX: Add full nested support for IA32_PERF_GLOBAL_CTRL
@ 2019-08-28 23:41 Oliver Upton
  2019-08-28 23:41 ` [PATCH 1/7] KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on vmexit Oliver Upton
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Oliver Upton @ 2019-08-28 23:41 UTC (permalink / raw)
  To: kvm, Paolo Bonzini, Radim Krčmář
  Cc: Jim Mattson, Peter Shier, Oliver Upton

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) 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 vmentry
  KVM: VMX: Add helper to check reserved bits in
    MSR_CORE_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: Enable load IA32_PERF_GLOBAL_CTRL vm control if supported

 arch/x86/kvm/pmu.h           | 11 +++++++++++
 arch/x86/kvm/vmx/nested.c    | 35 ++++++++++++++++++++++++++++++++---
 arch/x86/kvm/vmx/pmu_intel.c |  3 +++
 arch/x86/kvm/vmx/vmx.c       | 21 +++++++++++++++++++++
 arch/x86/kvm/vmx/vmx.h       |  1 +
 5 files changed, 68 insertions(+), 3 deletions(-)

-- 
2.23.0.187.g17f5b7556c-goog


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-08-30 20:12 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-28 23:41 [PATCH 0/7] KVM: VMX: Add full nested support for IA32_PERF_GLOBAL_CTRL Oliver Upton
2019-08-28 23:41 ` [PATCH 1/7] KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on vmexit Oliver Upton
2019-08-29  1:30   ` Krish Sadhukhan
2019-08-29  2:02     ` Oliver Upton
2019-08-29  7:19       ` Krish Sadhukhan
2019-08-29  8:07         ` Oliver Upton
2019-08-29 16:47           ` Krish Sadhukhan
2019-08-29 17:02   ` Jim Mattson
2019-08-28 23:41 ` [PATCH 2/7] KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on vmentry Oliver Upton
2019-08-30 17:58   ` Sean Christopherson
2019-08-28 23:41 ` [PATCH 3/7] KVM: VMX: Add helper to check reserved bits in MSR_CORE_PERF_GLOBAL_CTRL Oliver Upton
2019-08-30 18:26   ` Sean Christopherson
2019-08-30 19:20     ` Jim Mattson
2019-08-30 19:50       ` Oliver Upton
2019-08-28 23:41 ` [PATCH 4/7] KVM: nVMX: check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry Oliver Upton
2019-08-30 18:37   ` Sean Christopherson
2019-08-30 20:12     ` Oliver Upton
2019-08-28 23:41 ` [PATCH 5/7] KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-entry Oliver Upton
2019-08-28 23:41 ` [PATCH 6/7] KVM: nVMX: Enable load IA32_PERF_GLOBAL_CTRL vm control if supported Oliver Upton
2019-08-29 17:28   ` Jim Mattson
2019-08-28 23:41 ` [kvm-unit-tests PATCH 7/7] x86: VMX: Add tests for nested "load IA32_PERF_GLOBAL_CTRL" Oliver Upton
2019-08-29 17:33   ` Jim Mattson
2019-08-29 19:58     ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).