OSDN Git Service

KVM: x86/vPMU: Forbid reading from MSR_F15H_PERF MSRs when guest doesn't have X86_FEA...
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 29 Mar 2021 12:48:04 +0000 (14:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 17 Apr 2021 12:30:53 +0000 (08:30 -0400)
commitc28fa560c5bb4a58b362622beb0ca8479a480636
treefdbb61a5e6432e7bd4654bed899b09e9003fe72b
parent9a7de6ecc3ed80efb95fe1d97b6440922e55dbda
KVM: x86/vPMU: Forbid reading from MSR_F15H_PERF MSRs when guest doesn't have X86_FEATURE_PERFCTR_CORE

MSR_F15H_PERF_CTL0-5, MSR_F15H_PERF_CTR0-5 MSRs have a CPUID bit assigned
to them (X86_FEATURE_PERFCTR_CORE) and when it wasn't exposed to the guest
the correct behavior is to inject #GP an not just return zero.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210329124804.170173-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c