On Fri, Jun 08, 2018 at 06:56:19PM -0400, Babu Moger wrote: > Enable TOPOEXT feature on EPYC CPU. This is required to support > hyperthreading on VM guests. Also extend xlevel to 0x8000001E. > > TOPOEXT feature is disabled for legacy machines. > > Signed-off-by: Babu Moger <babu.moger@xxxxxxx> > --- > target/i386/cpu.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > index d3411ed..4dd9a82 100644 > --- a/target/i386/cpu.c > +++ b/target/i386/cpu.c > @@ -2574,6 +2574,7 @@ static X86CPUDefinition builtin_x86_defs[] = { > .xlevel = 0x8000000A, > .model_id = "AMD EPYC Processor", > .cache_info = &epyc_cache_info, > + .auto_topoext = 1, > }, > { > .name = "EPYC-IBPB", > @@ -2621,6 +2622,7 @@ static X86CPUDefinition builtin_x86_defs[] = { > .xlevel = 0x8000000A, > .model_id = "AMD EPYC Processor (with IBPB)", > .cache_info = &epyc_cache_info, > + .auto_topoext = 1, > }, > }; > > @@ -4672,6 +4674,11 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp) > x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); > } > > + /* TOPOEXT feature requires 0x8000001E */ > + if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) { > + x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001E); > + } I suggest moving this hunk to a separate patch. I'm not 100% sure yet if this will require compat_props code to disable auto-xlevel-increase on older machine-types. -- Eduardo