Received: from eggs.gnu.org ([208.118.235.92]:37146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJP00-0004BJ-2e for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJOzt-0006bb-HH for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJOzt-0006aY-4n for qemu-devel@nongnu.org; Wed, 03 Oct 2012 09:28:21 -0400 From: Eduardo Habkost Date: Wed, 3 Oct 2012 10:29:09 -0300 Message-Id: <1349270954-4657-14-git-send-email-ehabkost@redhat.com> In-Reply-To: <1349270954-4657-1-git-send-email-ehabkost@redhat.com> References: <1349270954-4657-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC 13/18] pc: set explicit APIC ID for CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gleb Natapov , Paolo Bonzini 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 --- hw/pc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index a8788de..c64c218 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -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); } } -- 1.7.11.4