]> www.infradead.org Git - users/willy/xarray.git/commitdiff
KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM
authorLike Xu <like.xu.linux@gmail.com>
Mon, 28 Jun 2021 07:43:54 +0000 (15:43 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 Jul 2021 16:17:56 +0000 (12:17 -0400)
The AMD platform does not support the functions Ah CPUID leaf. The returned
results for this entry should all remain zero just like the native does:

AMD host:
   0x0000000a 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00000000
(uncanny) AMD guest:
   0x0000000a 0x00: eax=0x00000000 ebx=0x00000000 ecx=0x00000000 edx=0x00008000

Fixes: cadbaa039b99 ("perf/x86/intel: Make anythread filter support conditional")
Signed-off-by: Like Xu <likexu@tencent.com>
Message-Id: <20210628074354.33848-1-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c

index ca7866d63e982db38bea98aeab86d5008d72d92c..739be5da3bca788515358f77cb2d39551990138d 100644 (file)
@@ -765,7 +765,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
 
                edx.split.num_counters_fixed = min(cap.num_counters_fixed, MAX_FIXED_COUNTERS);
                edx.split.bit_width_fixed = cap.bit_width_fixed;
-               edx.split.anythread_deprecated = 1;
+               if (cap.version)
+                       edx.split.anythread_deprecated = 1;
                edx.split.reserved1 = 0;
                edx.split.reserved2 = 0;