From patchwork Thu Sep 13 20:12:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 183727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 94D1C2C007F for ; Fri, 14 Sep 2012 07:01:38 +1000 (EST) Received: from localhost ([::1]:33166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCFnN-0002es-AP for incoming@patchwork.ozlabs.org; Thu, 13 Sep 2012 16:13:53 -0400 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 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8DKCj3p009039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Sep 2012 16:12:45 -0400 Received: from redhat.com (dhcp-185-114.bos.redhat.com [10.16.185.114]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8DKCiSR028723; Thu, 13 Sep 2012 16:12:44 -0400 Date: Thu, 13 Sep 2012 16:12:44 -0400 From: Jason Baron To: qemu-devel@nongnu.org Message-Id: <0124f48cb8864cfbdf82b72cb0d95b4e93611cef.1347561356.git.jbaron@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [PATCH 14/25] q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }