Received: from eggs.gnu.org ([2001:4830:134:3::10]:46795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQi6i-000142-LT for qemu-devel@nongnu.org; Wed, 25 Feb 2015 14:58:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQi6h-0000GW-Qv for qemu-devel@nongnu.org; Wed, 25 Feb 2015 14:58:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQi6h-0000GR-KM for qemu-devel@nongnu.org; Wed, 25 Feb 2015 14:58:55 -0500 From: Eduardo Habkost Date: Wed, 25 Feb 2015 16:58:24 -0300 Message-Id: <1424894306-26740-10-git-send-email-ehabkost@redhat.com> In-Reply-To: <1424894306-26740-1-git-send-email-ehabkost@redhat.com> References: <1424894306-26740-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 09/11] target-i386: Set APIC ID using cpu_index on CONFIG_USER List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org The PC CPU initialization code already sets apic-id based on the CPU topology, and CONFIG_USER doesn't need the topology-based APIC ID calculation code. Make CONFIG_USER set apic-id before realizing the CPU (just like PC already does), so we can simplify x86_cpu_initfn later. As there is no CPU topology configuration in CONFIG_USER, just use cpu_index as the APIC ID. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e8cd7b3..3e0c39c 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2145,6 +2145,12 @@ CPUX86State *cpu_x86_init_user(const char *cpu_model) goto error; } + object_property_set_int(OBJECT(cpu), CPU(cpu)->cpu_index, "apic-id", + &error); + if (error) { + goto error; + } + object_property_set_bool(OBJECT(cpu), true, "realized", &error); if (error) { goto error; -- 2.1.0