From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEJmp-0003hM-Er for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:07:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEJmk-0003WU-DC for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:07:58 -0400 Received: from [199.232.76.173] (port=44449 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEJmk-0003Vi-3K for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:07:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]:60708) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEJmf-0001Hl-UG for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:07:52 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5A97n5l024627 for ; Wed, 10 Jun 2009 05:07:49 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5A97mm7000994 for ; Wed, 10 Jun 2009 05:07:48 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5A97lPf018852 for ; Wed, 10 Jun 2009 05:07:47 -0400 From: Gleb Natapov Date: Wed, 10 Jun 2009 12:07:46 +0300 Message-Id: <1244624866-13205-2-git-send-email-gleb@redhat.com> In-Reply-To: <1244624866-13205-1-git-send-email-gleb@redhat.com> References: <1244624866-13205-1-git-send-email-gleb@redhat.com> Subject: [Qemu-devel] [PATCHv2 2/2] Don't register cpu reset handler for cpu with APIC. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org APIC reset handler already resets cpu. Also register cpu_reset handler directly to make it impossible to add additional code to main_cpu_reset() by mistake. Signed-off-by: Gleb Natapov --- hw/pc.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index d5b4112..0cdc2a2 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -751,12 +751,6 @@ static void load_linux(target_phys_addr_t option_rom, generate_bootsect(option_rom, gpr, seg, 0); } -static void main_cpu_reset(void *opaque) -{ - CPUState *env = opaque; - cpu_reset(env); -} - static const int ide_iobase[2] = { 0x1f0, 0x170 }; static const int ide_iobase2[2] = { 0x3f6, 0x376 }; static const int ide_irq[2] = { 14, 15 }; @@ -878,9 +872,11 @@ static void pc_init1(ram_addr_t ram_size, } if (i != 0) env->halted = 1; - qemu_register_reset(main_cpu_reset, 0, env); if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { + /* APIC reset callback resets cpu */ apic_init(env); + } else { + qemu_register_reset((QEMUResetHandler*)cpu_reset, 0, env); } } -- 1.6.2.1