From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6ySQ-00026Z-Cs for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6ySL-0003oq-Jy for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:10:09 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:55035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6yRv-0003X6-Ta for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:10:05 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2012 11:39:09 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2C68u114026590 for ; Mon, 12 Mar 2012 11:39:00 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2CBcjR7002906 for ; Mon, 12 Mar 2012 22:38:45 +1100 Date: Mon, 12 Mar 2012 14:08:50 +0800 From: Wanpeng Li Message-ID: <20120312060850.GB31217@liwp@linux.vnet.ibm.com> References: <1331449479-8197-1-git-send-email-liwp@linux.vnet.ibm.com> <4F5C585E.5020906@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F5C585E.5020906@web.de> Subject: Re: [Qemu-devel] [PATCH] fix bug of isa_bus irq Reply-To: Wanpeng Li List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On Sun, Mar 11, 2012 at 08:46:38AM +0100, Jan Kiszka wrote: >On 2012-03-11 08:04, Wanpeng Li wrote: >> ISA bus only use IRQ 0~15, so don't need to give an array qemu_irq 0~23, just >> array qemu_irq i8259 is ok. >> >> Signed-off-by: Wanpeng Li >> --- >> hw/pc_piix.c | 3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/hw/pc_piix.c b/hw/pc_piix.c >> index 63dba4e..52f7cf8 100644 >> --- a/hw/pc_piix.c >> +++ b/hw/pc_piix.c >> @@ -210,7 +210,6 @@ static void pc_init1(MemoryRegion *system_memory, >> isa_bus = isa_bus_new(NULL, system_io); >> no_hpet = 1; >> } >> - isa_bus_irqs(isa_bus, gsi); >> >> if (kvm_irqchip_in_kernel()) { >> i8259 = kvm_i8259_init(isa_bus); >> @@ -221,6 +220,8 @@ static void pc_init1(MemoryRegion *system_memory, >> i8259 = i8259_init(isa_bus, cpu_irq[0]); >> } >> >> + isa_bus_irqs(isa_bus, i8259); >> + >> for (i = 0; i < ISA_NUM_IRQS; i++) { >> gsi_state->i8259_irq[i] = i8259[i]; >> } > >This is bogus. isa_bus_irqs sets the output IRQs of the ISA bus. And >those are not only delivered to the PIC on the PIIX2, but also the >IOAPIC. Thus we have to pass in the GSI input lines which dispatch to >both. Of those lines, only the first 16 will be used by the ISA bus >(there is even an assert to ensure this). > >Did you see any concrete bug in the context of this logic? > >Jan > Yes, but actually PIC is being used at present, whether passing qemu_irq 0~23 to isa_bus is not safe or not. Wanpeng Li