aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLike Xu <like.xu.linux@gmail.com>2021-06-28 15:43:54 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 14:35:34 +0200
commita87d42ae7f5db37fe3a1f93a6fcb28befe66d7fc (patch)
tree4cd90dd6908d1c1ab7672c7337f4647e3cbc4c6a
parentb990585f9b7a81f7eaa7d63b353037159d6c5ddb (diff)
downloadkernel_replicant_linux-a87d42ae7f5db37fe3a1f93a6fcb28befe66d7fc.tar.gz
kernel_replicant_linux-a87d42ae7f5db37fe3a1f93a6fcb28befe66d7fc.tar.bz2
kernel_replicant_linux-a87d42ae7f5db37fe3a1f93a6fcb28befe66d7fc.zip
KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM
[ Upstream commit 7234c362ccb3c2228f06f19f93b132de9cfa7ae4 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/x86/kvm/cpuid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7a3fbf3b796e..41b0dc37720e 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -684,7 +684,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;