From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQHeR-0004KP-Nt for qemu-devel@nongnu.org; Mon, 22 Oct 2012 09:02:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQHeK-0002MO-TL for qemu-devel@nongnu.org; Mon, 22 Oct 2012 09:02:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQHeK-0002MI-L8 for qemu-devel@nongnu.org; Mon, 22 Oct 2012 09:02:32 -0400 Date: Mon, 22 Oct 2012 16:04:16 +0200 From: "Michael S. Tsirkin" Message-ID: <20121022140416.GA18658@redhat.com> References: <6c33f0f470e365764998589bee6dfc885ca60185.1350677362.git.jbaron@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c33f0f470e365764998589bee6dfc885ca60185.1350677362.git.jbaron@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 19/26] q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Baron Cc: agraf@suse.de, aliguori@us.ibm.com, juzhang@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, armbru@redhat.com, blauwirbel@gmail.com, yamahata@valinux.co.jp, alex.williamson@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, afaerber@suse.de, kraxel@redhat.com On Fri, Oct 19, 2012 at 04:43:38PM -0400, Jason Baron wrote: > From: Jan Kiszka > > Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers > an assertion. > > Reviewed-by: Paolo Bonzini > Signed-off-by: Jan Kiszka > Signed-off-by: Jason Baron Thanks, applied. > --- > hw/lpc_ich9.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c > index d9fd9de..a47d7a9 100644 > --- a/hw/lpc_ich9.c > +++ b/hw/lpc_ich9.c > @@ -264,9 +264,11 @@ static int ich9_gsi_to_pirq(int gsi) > > static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi) > { > - int level; > + int level = 0; > > - level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi)); > + if (gsi >= ICH9_LPC_PIC_NUM_PINS) { > + level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi)); > + } > if (gsi == ich9_lpc_sci_irq(lpc)) { > level |= lpc->sci_level; > } > -- > 1.7.1