From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1iRV-0005HV-7N for qemu-devel@nongnu.org; Wed, 06 May 2009 10:49:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1iRP-0005FG-4V for qemu-devel@nongnu.org; Wed, 06 May 2009 10:49:51 -0400 Received: from [199.232.76.173] (port=60949 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1iRO-0005Ek-HP for qemu-devel@nongnu.org; Wed, 06 May 2009 10:49:46 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38807) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1iRN-0000Yf-PC for qemu-devel@nongnu.org; Wed, 06 May 2009 10:49:46 -0400 From: Glauber Costa Date: Wed, 6 May 2009 10:49:41 -0400 Message-Id: <1241621382-21577-4-git-send-email-glommer@redhat.com> In-Reply-To: <1241621382-21577-3-git-send-email-glommer@redhat.com> References: <1241621382-21577-1-git-send-email-glommer@redhat.com> <1241621382-21577-2-git-send-email-glommer@redhat.com> <1241621382-21577-3-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 3/4] move halted state setting to inside of cpu_x86_init List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com cpus other than the first one starting at the halted state is a safe assumption to anyone. Move it to where it belongs. Signed-off-by: Glauber Costa --- hw/pc.c | 2 -- target-i386/helper.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index b726c17..06d1fca 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -849,8 +849,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, fprintf(stderr, "Unable to find x86 CPU definition\n"); exit(1); } - if (i != 0) - env->halted = 1; if (pci_enabled) { apic_init(env); } diff --git a/target-i386/helper.c b/target-i386/helper.c index 2c11cd3..a0d0273 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1694,6 +1694,9 @@ CPUX86State *cpu_x86_init(const char *cpu_model) cpu_x86_close(env); return NULL; } + + /* cpu 0 can run, others start at halted state */ + env->halted = !!env->cpu_index; cpu_reset(env); qemu_register_reset(main_cpu_reset, env); -- 1.5.6.6