From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: [PATCH 3/6] qemu: piix: Introduce functions to get pin number from irq and vice versa Date: Tue, 28 Oct 2008 17:44:58 +0200 Message-ID: <20081028154458.GC6737@il.ibm.com> References: <1224861988-22781-1-git-send-email-amit.shah@redhat.com> <1224861988-22781-2-git-send-email-amit.shah@redhat.com> <1224861988-22781-3-git-send-email-amit.shah@redhat.com> <1224861988-22781-4-git-send-email-amit.shah@redhat.com> <4904712C.1080307@redhat.com> <20081028101252.GG7102@il.ibm.com> <4906ED8F.3040608@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Amit Shah , kvm@vger.kernel.org, anthony@codemonkey.ws, weidong.han@intel.com, allen.m.kay@intel.com, Ben-Ami Yassour1 To: Avi Kivity Return-path: Received: from mtagate5.de.ibm.com ([195.212.29.154]:54103 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbYJ1Ppn (ORCPT ); Tue, 28 Oct 2008 11:45:43 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id m9SFjf9e560816 for ; Tue, 28 Oct 2008 15:45:41 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9SFjf1H3551372 for ; Tue, 28 Oct 2008 16:45:41 +0100 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9SFje9f002155 for ; Tue, 28 Oct 2008 16:45:41 +0100 Content-Disposition: inline In-Reply-To: <4906ED8F.3040608@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Oct 28, 2008 at 12:46:39PM +0200, Avi Kivity wrote: > Muli Ben-Yehuda wrote: >> On Sun, Oct 26, 2008 at 03:31:24PM +0200, Avi Kivity wrote: >> >>> Amit Shah wrote: >>> >>>> +int piix3_get_pin(int pic_irq) >>>> +{ >>>> + int i; >>>> + for (i = 0; i < 4; i++) >>>> + if (piix3_dev->config[0x60+i] == pic_irq) >>>> + return i; >>>> + return -1; >>>> +} >>>> >>> What happens if two pci interrupts are routed to one irq line? >>> >> >> This one I'm still thinking about. >> > > Well, what is this needed for in the first place? This specific function is not used. I assume Amit added it for completeness with piix_get_irq. piix_get_irq, as far as I can tell, is used in only one place (when the guest updates a device's configuration space interrupt register) to go from interrupt pin (intx) to guest IRQ line. Cheers, Muli -- The First Workshop on I/O Virtualization (WIOV '08) Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/ <-> SYSTOR 2009---The Israeli Experimental Systems Conference http://www.haifa.il.ibm.com/conferences/systor2009/