From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrHHC-0003y9-A8 for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrHHB-0006Me-2m for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:26 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:44730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrHHA-0006Kk-O4 for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:24 -0400 Received: by mail-wy0-f173.google.com with SMTP id 22so1164337wyf.4 for ; Wed, 10 Aug 2011 15:29:24 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Wed, 10 Aug 2011 15:28:13 -0700 Message-Id: <1313015300-23920-5-git-send-email-rth@twiddle.net> In-Reply-To: <1313015300-23920-1-git-send-email-rth@twiddle.net> References: <1313015300-23920-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 04/11] pc: Re-order pc_init1 to initialize the ISA bus before ISA devices. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: avi@redhat.com In particular, the i8259 was being initialized before the ISA bus, leading to a crash. Signed-off-by: Richard Henderson --- hw/pc_piix.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 709a1c3..82718ec 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -123,17 +123,7 @@ static void pc_init1(MemoryRegion *system_memory, pci_memory, &ram_memory); } - if (!xen_enabled()) { - cpu_irq = pc_allocate_cpu_irq(); - i8259 = i8259_init(cpu_irq[0]); - } else { - i8259 = xen_interrupt_controller_init(); - } isa_irq_state = qemu_mallocz(sizeof(*isa_irq_state)); - isa_irq_state->i8259 = i8259; - if (pci_enabled) { - ioapic_init(isa_irq_state); - } isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24); if (pci_enabled) { @@ -153,6 +143,18 @@ static void pc_init1(MemoryRegion *system_memory, } isa_bus_irqs(isa_irq); + if (!xen_enabled()) { + cpu_irq = pc_allocate_cpu_irq(); + i8259 = i8259_init(cpu_irq[0]); + } else { + i8259 = xen_interrupt_controller_init(); + } + + isa_irq_state->i8259 = i8259; + if (pci_enabled) { + ioapic_init(isa_irq_state); + } + pc_register_ferr_irq(isa_get_irq(13)); pc_vga_init(pci_enabled? pci_bus: NULL); -- 1.7.6