Re: [PATCH v5 1/3] KVM: x86: Provide per VM capability for disabling PMU virtualization

From: Like Xu
Date: Wed Feb 09 2022 - 05:53:17 EST


cc LKML and full list of KVM reviewers.

On 25/1/2022 2:39 am, Jim Mattson wrote:
On Sun, Jan 23, 2022 at 10:45 AM David Dunn <daviddunn@xxxxxxxxxx> wrote:

KVM_CAP_PMU_DISABLE is used to disable PMU virtualization on individual
x86 VMs. PMU configuration must be done prior to creating VCPUs.

To enable future extension, KVM_CAP_PMU_CAPABILITY reports available
settings via bitmask when queried via check_extension.

For VMs that have PMU virtualization disabled, usermode will need to
clear CPUID leaf 0xA to notify guests.

Signed-off-by: David Dunn <daviddunn@xxxxxxxxxx>

Nit: The two references to CPUID leaf 0xA should be qualified as
applying only to Intel VMs.

Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>


Nit: It looks like we already have "#define KVM_CAP_SYS_ATTRIBUTES 209".

Hope it helps a little:

Reviewed-by: Like Xu <likexu@xxxxxxxxxxx>