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@xxxxxxxxxxxx> > --- > 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@xxxxxxxxxx>