@@ -1583,6 +1583,38 @@ static int x86_parse_hybrid_core_type(MachineState *ms, const char *coretype)
return type;
}
+static const char *x86_cpu_index_to_hybrid_core_type(MachineState *machine,
+ unsigned cpu_index)
+{
+ CPUState *cs;
+
+ if (machine_topo_is_smp(machine)) {
+ return NULL;
+ }
+
+ CPU_FOREACH(cs) {
+ X86CPU *cpu = X86_CPU(cs);
+ CPUX86State *env = &cpu->env;
+
+ if (cs->cpu_index == cpu_index) {
+ const char *core_type;
+
+ switch (env->hybrid_core_type) {
+ case INTEL_ATOM_TYPE:
+ core_type = "atom";
+ break;
+ case INTEL_CORE_TYPE:
+ core_type = "core";
+ break;
+ default:
+ abort();
+ }
+ return core_type;
+ }
+ }
+ return NULL;
+}
+
static void x86_machine_initfn(Object *obj)
{
X86MachineState *x86ms = X86_MACHINE(obj);
@@ -1611,6 +1643,7 @@ static void x86_machine_class_init(ObjectClass *oc, void *data)
x86mc->fwcfg_dma_enabled = true;
nc->nmi_monitor_handler = x86_nmi;
mc->core_type = x86_parse_hybrid_core_type;
+ mc->cpu_index_to_core_type = x86_cpu_index_to_hybrid_core_type;
object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto",
x86_machine_get_smm, x86_machine_set_smm,