qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 13/18] pc: set explicit APIC ID for CPUs


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 13/18] pc: set explicit APIC ID for CPUs
Date: Wed, 3 Oct 2012 10:29:09 -0300

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]