Comments
Patch
@@ -903,19 +903,19 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)
}
}
-static X86CPU *pc_new_cpu(PC *pc, const char *cpu_model)
+static X86CPU *pc_new_cpu(PC *pc, const char *cpu_model, uint32_t apic_id)
{
X86CPU *cpu;
CPUX86State *env;
- cpu = cpu_x86_init(cpu_model, -1);
+ cpu = cpu_x86_init(cpu_model, apic_id);
if (cpu == NULL) {
fprintf(stderr, "Unable to find x86 CPU definition\n");
exit(1);
}
env = &cpu->env;
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
- env->apic_state = apic_init(env, env->cpuid_apic_id);
+ env->apic_state = apic_init(env, apic_id);
}
cpu_reset(CPU(cpu));
return cpu;
@@ -935,7 +935,7 @@ void pc_cpus_init(PC *pc, const char *cpu_model)
}
for(i = 0; i < smp_cpus; i++) {
- pc_new_cpu(pc, cpu_model);
+ pc_new_cpu(pc, cpu_model, i);
}
}
The current behavior (setting APIC ID = CPU index) is kept, but this will allow the PC code to set the proper CPU topology, later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/pc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)