]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Use vcpu_get_perf_capabilities() to get guest-visible value
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jun 2022 00:57:53 +0000 (00:57 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Jun 2022 15:49:54 +0000 (11:49 -0400)
commit0e8d985f3c3599c05da8d22378932c64b879c5c1
tree87e977b9abebdfd0975da2516952b7247826a4fa
parent698b3a6bad3d75e35c4891e86b1c919d63d2173a
KVM: VMX: Use vcpu_get_perf_capabilities() to get guest-visible value

Use vcpu_get_perf_capabilities() when querying MSR_IA32_PERF_CAPABILITIES
from the guest's perspective, e.g. to update the vPMU and to determine
which MSRs exist.  If userspace ignores MSR_IA32_PERF_CAPABILITIES but
clear X86_FEATURE_PDCM, the guest should see '0'.

Fixes: e04a03139ab6 ("KVM: x86/pmu: Add PEBS_DATA_CFG MSR emulation to support adaptive PEBS")
Fixes: 56a759afcfa5 ("KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220611005755.753273-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/pmu_intel.c