From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtsBk-0003Wg-7o for qemu-devel@nongnu.org; Thu, 19 Dec 2013 23:59:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtsBf-00089A-BP for qemu-devel@nongnu.org; Thu, 19 Dec 2013 23:59:52 -0500 Date: Fri, 20 Dec 2013 07:03:26 +0200 From: "Michael S. Tsirkin" Message-ID: <20131220050326.GA26190@redhat.com> References: <1385620533-17685-1-git-send-email-Bharat.Bhushan@freescale.com> <1385620533-17685-3-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385620533-17685-3-git-send-email-Bharat.Bhushan@freescale.com> Subject: Re: [Qemu-devel] [PATCH 2/2] ppc-e500: implement PCI INTx routing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharat Bhushan Cc: scottwood@freescale.com, Bharat Bhushan , qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org On Thu, Nov 28, 2013 at 12:05:33PM +0530, Bharat Bhushan wrote: > This patch adds pci pin to irq_num routing callback > Without this patch we gets below warning > > " > PCI: Bug - unimplemented PCI INTx routing (e500-pcihost) > qemu-system-ppc64: PCI: Bug - unimplemented PCI INTx routing (e500-pcihost) > " > > Signed-off-by: Bharat Bhushan Please tweak commit log to explain thereal motivation for the change which is to use vfio on ppc. Besides that Acked-by: Michael S. Tsirkin > --- > hw/pci-host/ppce500.c | 20 ++++++++++++++++++-- > 1 files changed, 18 insertions(+), 2 deletions(-) > > diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c > index 49bfcc6..3c4cf9e 100644 > --- a/hw/pci-host/ppce500.c > +++ b/hw/pci-host/ppce500.c > @@ -88,6 +88,7 @@ struct PPCE500PCIState { > struct pci_inbound pib[PPCE500_PCI_NR_PIBS]; > uint32_t gasket_time; > qemu_irq irq[PCI_NUM_PINS]; > + uint32_t irq_num[PCI_NUM_PINS]; > uint32_t first_slot; > /* mmio maps */ > MemoryRegion container; > @@ -267,13 +268,26 @@ static int mpc85xx_pci_map_irq(PCIDevice *pci_dev, int pin) > > static void mpc85xx_pci_set_irq(void *opaque, int pin, int level) > { > - qemu_irq *pic = opaque; > + PPCE500PCIState *s = opaque; > + qemu_irq *pic = s->irq;; > > pci_debug("%s: PCI irq %d, level:%d\n", __func__, pin , level); > > qemu_set_irq(pic[pin], level); > } > > +static PCIINTxRoute e500_route_intx_pin_to_irq(void *opaque, int pin) > +{ > + PCIINTxRoute route; > + PPCE500PCIState *s = opaque; > + > + route.mode = PCI_INTX_ENABLED; > + route.irq = s->irq_num[pin]; > + > + pci_debug("%s: PCI irq-pin = %d, irq_num= %d\n", __func__, pin, route.irq); > + return route; > +} > + > static const VMStateDescription vmstate_pci_outbound = { > .name = "pci_outbound", > .version_id = 0, > @@ -350,12 +364,13 @@ static int e500_pcihost_initfn(SysBusDevice *dev) > > for (i = 0; i < ARRAY_SIZE(s->irq); i++) { > sysbus_init_irq(dev, &s->irq[i]); > + s->irq_num[i] = i + 1; > } > > memory_region_init(&s->pio, OBJECT(s), "pci-pio", PCIE500_PCI_IOLEN); > > b = pci_register_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq, > - mpc85xx_pci_map_irq, s->irq, address_space_mem, > + mpc85xx_pci_map_irq, s, address_space_mem, > &s->pio, PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS); > h->bus = b; > > @@ -373,6 +388,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev) > memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem); > sysbus_init_mmio(dev, &s->container); > sysbus_init_mmio(dev, &s->pio); > + pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq); > > return 0; > } > -- > 1.7.0.4 > >