mbox series

[v5,0/3] KVM: x86: Provide per VM capability for disabling PMU virtualization

Message ID 20220123184541.993212-1-daviddunn@google.com (mailing list archive)
Headers show
Series KVM: x86: Provide per VM capability for disabling PMU virtualization | expand

Message

David Dunn Jan. 23, 2022, 6:45 p.m. UTC
Changes since v4:
- Remove automatic CPUID adjustment when PMU disabled [Like]
- Update documentation and changelog to reflect above.
- Update documentation to document arg[0] and return values.  [Like].

Original description:

This patch set allows usermode to disable PMU virtualization on
individual x86 VMs.  When disabled, the PMU is not advertised to
or accessible from the guest.

David Dunn (3):
  KVM: x86: Provide per VM capability for disabling PMU virtualization
  KVM: selftests: Allow creation of selftest 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                            | 12 +++++
 include/uapi/linux/kvm.h                      |  4 ++
 tools/include/uapi/linux/kvm.h                |  4 ++
 .../selftests/kvm/include/kvm_util_base.h     |  3 ++
 tools/testing/selftests/kvm/lib/kvm_util.c    | 48 ++++++++++++++-----
 .../kvm/x86_64/pmu_event_filter_test.c        | 35 ++++++++++++++
 10 files changed, 118 insertions(+), 15 deletions(-)