From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJQ4-0005DG-C2 for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:43:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPJPx-0006YR-4i for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:43:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJPw-0006Xi-SI for qemu-devel@nongnu.org; Fri, 19 Oct 2012 16:43:41 -0400 Date: Fri, 19 Oct 2012 16:43:38 -0400 From: Jason Baron Message-Id: <6c33f0f470e365764998589bee6dfc885ca60185.1350677362.git.jbaron@redhat.com> In-Reply-To: References: Subject: [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: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, juzhang@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, armbru@redhat.com, agraf@suse.de, 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 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 --- 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