@@ -306,6 +306,7 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
init_topo_info(&topo_info, x86ms);
env->nr_dies = ms->smp.dies;
+ env->nr_modules = ms->smp.clusters;
/*
* If APIC ID is not set,
@@ -7698,6 +7698,7 @@ static void x86_cpu_initfn(Object *obj)
CPUX86State *env = &cpu->env;
env->nr_dies = 1;
+ env->nr_modules = 1;
object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo",
x86_cpu_get_feature_words,
@@ -1904,6 +1904,11 @@ typedef struct CPUArchState {
/* Number of dies within this CPU package. */
unsigned nr_dies;
+ /*
+ * Number of modules within this CPU package.
+ * Module level in x86 cpu topology is corresponding to smp.clusters.
+ */
+ unsigned nr_modules;
} CPUX86State;
struct kvm_msrs;