From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFmP-0001E2-0g for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCFmI-0002wK-VO for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFmI-0002w2-Mg for qemu-devel@nongnu.org; Thu, 13 Sep 2012 16:12:46 -0400 Date: Thu, 13 Sep 2012 16:12:44 -0400 From: Jason Baron Message-Id: <0124f48cb8864cfbdf82b72cb0d95b4e93611cef.1347561356.git.jbaron@redhat.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH 14/25] 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, alex.williamson@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, agraf@suse.de, armbru@redhat.com, yamahata@valinux.co.jp, juzhang@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, lcapitulino@redhat.com, afaerber@suse.de From: Jan Kiszka Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers an assertion. Signed-off-by: Jan Kiszka Signed-off-by: Jason Baron --- hw/q35.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/q35.c b/hw/q35.c index 09e8bd7..8b6a2e5 100644 --- a/hw/q35.c +++ b/hw/q35.c @@ -657,9 +657,11 @@ static void ich9_lpc_update_apic(ICH9_LPCIrqState *irq_state, int gsi) { GMCH_PCIHost *s = container_of(irq_state, GMCH_PCIHost, irq_state); ICH9_LPCState *lpc = irq_state->lpc; - int level; + int level = 0; - level = pci_bus_get_irq_level(s->host.pci.bus, ich9_gsi_to_pirq(gsi)); + if (gsi >= ICH9_LPC_PIC_NUM_PINS) { + level |= pci_bus_get_irq_level(s->host.pci.bus, ich9_gsi_to_pirq(gsi)); + } if (gsi == ich9_lpc_sci_irq(lpc)) { level |= lpc->sci_level; } -- 1.7.1