* Re: [PATCH] KVM:x86: AMD Processor Topology Information
2017-10-29 21:56 [PATCH] KVM:x86: AMD Processor Topology Information Stanislav Lanci
@ 2017-10-29 22:44 ` Nick Sarnie
2018-01-26 21:04 ` Babu Moger
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Nick Sarnie @ 2017-10-29 22:44 UTC (permalink / raw)
To: Stanislav Lanci; +Cc: kvm
On Sun, Oct 29, 2017 at 5:56 PM, Stanislav Lanci <pixo@polepetko.eu> wrote:
> This patch allow to enable x86 feature TOPOEXT and increase maximum extended function to 0x8000001E.
> Both are needed to provide information about SMT on AMD Zen CPUs to the guest.
>
> Signed-off-by: Stanislav Lanci <pixo@polepetko.eu>
> ---
> arch/x86/kvm/cpuid.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 0099e10eb045..374afdeaa6f5 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -365,7 +365,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
> F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
> F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
> - 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM);
> + 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) |
> + F(TOPOEXT);
>
> /* cpuid 0xC0000001.edx */
> const u32 kvm_cpuid_C000_0001_edx_x86_features =
> @@ -604,7 +605,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> entry->edx = 0;
> break;
> case 0x80000000:
> - entry->eax = min(entry->eax, 0x8000001a);
> + entry->eax = min(entry->eax, 0x8000001e);
> break;
> case 0x80000001:
> entry->edx &= kvm_cpuid_8000_0001_edx_x86_features;
> --
> 2.14.2
>
No idea if it's correct, it seems to work in a Win10 guest:
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] KVM:x86: AMD Processor Topology Information
2017-10-29 21:56 [PATCH] KVM:x86: AMD Processor Topology Information Stanislav Lanci
2017-10-29 22:44 ` Nick Sarnie
@ 2018-01-26 21:04 ` Babu Moger
2018-01-26 22:53 ` Paolo Bonzini
2018-01-29 16:39 ` Babu Moger
3 siblings, 0 replies; 6+ messages in thread
From: Babu Moger @ 2018-01-26 21:04 UTC (permalink / raw)
To: pixo, kvm; +Cc: babu.moger, ssg.sos.staff
Looks good to me. But needs rebase on top of linux-next tree.
One change is not required after the commit
8765d75329a3 KVM: X86: Extend CPUID range to include new leaf
Stanislav, Can you please rebase this patch. Let me know if you want
me to rebase it. Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM:x86: AMD Processor Topology Information
2017-10-29 21:56 [PATCH] KVM:x86: AMD Processor Topology Information Stanislav Lanci
2017-10-29 22:44 ` Nick Sarnie
2018-01-26 21:04 ` Babu Moger
@ 2018-01-26 22:53 ` Paolo Bonzini
2018-01-29 16:39 ` Babu Moger
3 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2018-01-26 22:53 UTC (permalink / raw)
To: Stanislav Lanci, kvm
On 29/10/2017 22:56, Stanislav Lanci wrote:
> This patch allow to enable x86 feature TOPOEXT and increase maximum extended function to 0x8000001E.
> Both are needed to provide information about SMT on AMD Zen CPUs to the guest.
>
> Signed-off-by: Stanislav Lanci <pixo@polepetko.eu>
> ---
> arch/x86/kvm/cpuid.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 0099e10eb045..374afdeaa6f5 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -365,7 +365,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
> F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
> F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
> - 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM);
> + 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) |
> + F(TOPOEXT);
>
> /* cpuid 0xC0000001.edx */
> const u32 kvm_cpuid_C000_0001_edx_x86_features =
> @@ -604,7 +605,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> entry->edx = 0;
> break;
> case 0x80000000:
> - entry->eax = min(entry->eax, 0x8000001a);
> + entry->eax = min(entry->eax, 0x8000001e);
> break;
> case 0x80000001:
> entry->edx &= kvm_cpuid_8000_0001_edx_x86_features;
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] KVM:x86: AMD Processor Topology Information
2017-10-29 21:56 [PATCH] KVM:x86: AMD Processor Topology Information Stanislav Lanci
` (2 preceding siblings ...)
2018-01-26 22:53 ` Paolo Bonzini
@ 2018-01-29 16:39 ` Babu Moger
2018-01-30 13:54 ` Radim Krčmář
3 siblings, 1 reply; 6+ messages in thread
From: Babu Moger @ 2018-01-29 16:39 UTC (permalink / raw)
To: pbonzini, rkrcmar, tglx, mingo, hpa; +Cc: x86, kvm, linux-kernel, pixo
From: Stanislav Lanci <pixo@polepetko.eu>
This patch allow to enable x86 feature TOPOEXT. This is needed to provide
information about SMT on AMD Zen CPUs to the guest.
Signed-off-by: Stanislav Lanci <pixo@polepetko.eu>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
---
Rebased on top of linux-next.
Maximum extended functions are already set to 0x8000001f after the commit
8765d75329a3 KVM: X86: Extend CPUID range to include new leaf
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 ac0041c2f5af..20e491b94f44 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -371,7 +371,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
- 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM);
+ 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) |
+ F(TOPOEXT);
/* cpuid 0xC0000001.edx */
const u32 kvm_cpuid_C000_0001_edx_x86_features =
--
2.16.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] KVM:x86: AMD Processor Topology Information
2018-01-29 16:39 ` Babu Moger
@ 2018-01-30 13:54 ` Radim Krčmář
0 siblings, 0 replies; 6+ messages in thread
From: Radim Krčmář @ 2018-01-30 13:54 UTC (permalink / raw)
To: Babu Moger; +Cc: pbonzini, tglx, mingo, hpa, x86, kvm, linux-kernel, pixo
2018-01-29 11:39-0500, Babu Moger:
> From: Stanislav Lanci <pixo@polepetko.eu>
>
> This patch allow to enable x86 feature TOPOEXT. This is needed to provide
> information about SMT on AMD Zen CPUs to the guest.
>
> Signed-off-by: Stanislav Lanci <pixo@polepetko.eu>
> Tested-by: Nick Sarnie <commendsarnex@gmail.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---
>
> Rebased on top of linux-next.
> Maximum extended functions are already set to 0x8000001f after the commit
> 8765d75329a3 KVM: X86: Extend CPUID range to include new leaf
Queued, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread