Skip to content

KVM: x86: Provide per VM capability for disabling PMU virtualization

David Dunn kvm 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest3 patches 2 repliesIn review
  2. v63 patches 3 repliesSuperseded
  3. v53 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v43 patches1 replySuperseded
v33 patches1 replySuperseded

Changes in v7 from the cover letter

* Incorporating feedback from Sean.
* Rephrased commit messages (borrowed from Sean).
* Added locking around kvm->created_vcpus access.
* Moved KVM_CAP_PMU_VALID_MASK out of user ABI headers.
* Changed comments on vm_create_without_vcpus.
* Directly check results in selftest TEST_ASSERT statements.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: x86: Provide per VM capability for disabling PMU virtualizationDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/pmu.c +4 more+48 -21 reply
2/3KVM: selftests: Carve out helper to create "default" VM without vCPUstools/testing/selftests/kvm/include/kvm_util_base.h tools/testing/selftests/kvm/lib/kvm_util.c+32 -61 reply
3/3KVM: selftests: Verify disabling PMU virtualization via KVM_CAP_CONFIG_PMUtools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c+33 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchSean Christopherson
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/3] KVM: x86: Provide per VM capability for disabling PMU virtualization

Allow usermode to disable PMU virtualization on individual x86 VMs. When disabled, the PMU is not accessible from the guest.

v6: https://lore.kernel.org/all/[email protected]/

v6 -> v7
* Incorporating feedback from Sean.
* Rephrased commit messages (borrowed from Sean).
* Added locking around kvm->created_vcpus access.
* Moved KVM_CAP_PMU_VALID_MASK out of user ABI headers.
* Changed comments on vm_create_without_vcpus.
* Directly check results in selftest TEST_ASSERT statements.

v5 -> v6
* resolve minor conflicts that were queued after v5 was reviewed.

v4 -> v5
* Remove automatic CPUID adjustment when PMU disabled.
* Update documentation and changelog to reflect above.
* Update documentation to document arg[0] and return values.

David Dunn (3):
KVM: x86: Provide per VM capability for disabling PMU virtualization
KVM: selftests: Carve out helper to create "default" VM without vCPUs
KVM: selftests: Verify disabling PMU virtualization via
KVM_CAP_CONFIG_PMU

 Documentation/virt/kvm/api.rst                | 22 ++++++++++++
 arch/x86/include/asm/kvm_host.h               |  1 +
 arch/x86/kvm/svm/pmu.c                        |  2 +-
 arch/x86/kvm/vmx/pmu_intel.c                  |  2 +-
 arch/x86/kvm/x86.c                            | 17 +++++++++
 include/uapi/linux/kvm.h                      |  3 ++
 tools/include/uapi/linux/kvm.h                |  3 ++
 .../selftests/kvm/include/kvm_util_base.h     |  3 ++
 tools/testing/selftests/kvm/lib/kvm_util.c    | 35 +++++++++++++++----
 .../kvm/x86_64/pmu_event_filter_test.c        | 33 +++++++++++++++++
 10 files changed, 113 insertions(+), 8 deletions(-)
Signature · 1 line
2.35.1.265.g69c8d7142f-goog