NOTE: this is unfinished, and will break live-migration between older
and newer QEMU versions if applied as-is. We need to make the older
machine-types keep the existing behavior when generating APIC IDs.

Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
---
 target-i386/cpu.h |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index e983c10..860aeaa 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -21,6 +21,8 @@
 
 #include "config.h"
 #include "qemu-common.h"
+#include "topology.h"
+#include "cpus.h"
 
 #ifdef TARGET_X86_64
 #define TARGET_LONG_BITS 64
@@ -918,10 +920,7 @@ void host_cpuid(uint32_t function, uint32_t count,
  */
 static inline uint8_t apic_id_for_cpu(int cpu_index)
 {
-    /* right now APIC ID == CPU index. this will eventually change to use
-     * the CPU topology configuration properly
-     */
-    return cpu_index;
+    return topo_make_apicid(smp_cores, smp_threads, cpu_index);
 }
 
 
-- 
1.7.10.4


Reply via email to