diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-05-03 07:57:40 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-05-03 08:07:54 -0400 |
commit | 04144108a1ab9792e7a60b3a9e30c614cd3e0e9f (patch) | |
tree | 599314893f8576d820ada453b0fb7973666e1522 /arch/x86/kvm/cpuid.c | |
parent | 4f510c8bb1dd0edc5f8f82cbe990c6174ceb5a06 (diff) | |
parent | 5a1bde46f98b893cda6122b00e94c0c40a6ead3c (diff) |
Merge branch 'kvm-amd-pmu-fixes' into HEAD
Diffstat (limited to 'arch/x86/kvm/cpuid.c')
-rw-r--r-- | arch/x86/kvm/cpuid.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 598334ed5fbc..0c1ba6aa0765 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -887,6 +887,11 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) union cpuid10_eax eax; union cpuid10_edx edx; + if (!static_cpu_has(X86_FEATURE_ARCH_PERFMON)) { + entry->eax = entry->ebx = entry->ecx = entry->edx = 0; + break; + } + perf_get_x86_pmu_capability(&cap); /* |