@@ -280,7 +280,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
CPUArchId *cpu_slot;
X86CPUTopoIDs topo_ids;
X86CPU *cpu = X86_CPU(dev);
- CPUX86State *env = &cpu->env;
MachineState *ms = MACHINE(hotplug_dev);
X86MachineState *x86ms = X86_MACHINE(hotplug_dev);
X86CPUTopoInfo topo_info;
@@ -304,9 +303,6 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
init_topo_info(&topo_info, x86ms);
- env->nr_dies = machine_topo_get_dies(ms);
- env->nr_modules = machine_topo_get_clusters(ms);
-
/*
* If APIC ID is not set,
* set it based on socket/die/cluster/core/thread properties.
@@ -5499,7 +5499,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
break;
case 0x1F:
/* V2 Extended Topology Enumeration Leaf */
- if (env->nr_dies < 2) {
+ if (cs->topo.dies_per_socket < 2) {
*eax = *ebx = *ecx = *edx = 0;
break;
}
@@ -6227,6 +6227,7 @@ static void x86_cpu_enable_xsave_components(X86CPU *cpu)
void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
{
CPUX86State *env = &cpu->env;
+ CPUState *cs = env_cpu(env);
FeatureWord w;
int i;
GList *l;
@@ -6316,7 +6317,7 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
* cpu->vendor_cpuid_only has been unset for compatibility with older
* machine types.
*/
- if ((env->nr_dies > 1) &&
+ if ((cs->topo.dies_per_socket > 1) &&
(IS_INTEL_CPU(env) || !cpu->vendor_cpuid_only)) {
x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
}
@@ -6840,8 +6841,6 @@ static void x86_cpu_initfn(Object *obj)
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
CPUX86State *env = &cpu->env;
- env->nr_dies = 1;
- env->nr_modules = 1;
cpu_set_cpustate_pointers(cpu);
object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo",
@@ -1825,14 +1825,6 @@ typedef struct CPUArchState {
uint32_t umwait;
TPRAccess tpr_access_type;
-
- /* Number of dies per package. */
- unsigned nr_dies;
- /*
- * Number of modules per die. Module level in x86 cpu topology is
- * corresponding to smp.clusters.
- */
- unsigned nr_modules;
} CPUX86State;
struct kvm_msrs;
@@ -1859,7 +1859,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
break;
}
case 0x1f:
- if (env->nr_dies < 2) {
+ if (cs->topo.dies_per_socket < 2) {
break;
}
/* fallthrough */