From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sogwn-000538-1V for qemu-devel@nongnu.org; Tue, 10 Jul 2012 16:22:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sogwg-0001uM-Ux for qemu-devel@nongnu.org; Tue, 10 Jul 2012 16:22:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sogwg-0001th-N8 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 16:22:06 -0400 From: Eduardo Habkost Date: Tue, 10 Jul 2012 17:22:22 -0300 Message-Id: <1341951743-2285-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1341951743-2285-1-git-send-email-ehabkost@redhat.com> References: <1341951743-2285-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [QEMU RFC PATCH 7/7] generate APIC IDs according to CPU topology List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , seabios@seabios.org, Gleb Natapov , Anthony Liguori 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 --- 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