* [PATCH] KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM
@ 2021-06-28 7:43 Like Xu
2021-07-08 16:44 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Like Xu @ 2021-06-28 7:43 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
Joerg Roedel, Stephane Eranian, Peter Zijlstra, Borislav Petkov,
x86, kvm, linux-kernel
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>
---
arch/x86/kvm/cpuid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 0edda1fc4fe7..b1808e4fc7d5 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -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;
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM
2021-06-28 7:43 [PATCH] KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM Like Xu
@ 2021-07-08 16:44 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-07-08 16:44 UTC (permalink / raw)
To: Like Xu
Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
Joerg Roedel, Stephane Eranian, Peter Zijlstra, Borislav Petkov,
x86, kvm, linux-kernel
On 28/06/21 09:43, Like Xu wrote:
> 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>
> ---
> arch/x86/kvm/cpuid.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 0edda1fc4fe7..b1808e4fc7d5 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -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;
>
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-08 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 7:43 [PATCH] KVM: x86/pmu: Clear anythread deprecated bit when 0xa leaf is unsupported on the SVM Like Xu
2021-07-08 16:44 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.