From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLUdr-0004lN-8K for qemu-devel@nongnu.org; Tue, 09 Oct 2012 03:54:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLUdl-0004Wh-6a for qemu-devel@nongnu.org; Tue, 09 Oct 2012 03:54:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLUdk-0004WR-Tg for qemu-devel@nongnu.org; Tue, 09 Oct 2012 03:54:09 -0400 Message-ID: <5073D817.8010700@redhat.com> Date: Tue, 09 Oct 2012 09:53:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <7ea11a735259819620b49c3e0f127f9fe6c89248.1349749915.git.jbaron@redhat.com> In-Reply-To: <7ea11a735259819620b49c3e0f127f9fe6c89248.1349749915.git.jbaron@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 15/21] 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: aliguori@us.ibm.com, juzhang@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, yamahata@valinux.co.jp, alex.williamson@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, lcapitulino@redhat.com, afaerber@suse.de, armbru@redhat.com, kraxel@redhat.com Il 09/10/2012 05:30, Jason Baron ha scritto: > 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 ff570ce..5d256cb 100644 > --- a/hw/q35.c > +++ b/hw/q35.c > @@ -663,9 +663,11 @@ static void ich9_lpc_update_apic(ICH9LPCIrqState *irq_state, int gsi) > { > GMCHPCIHost *s = container_of(irq_state, GMCHPCIHost, irq_state); > ICH9LPCState *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; > } > Reviewed-by: Paolo Bonzini