|
|
4a2fec |
From aeb5a8995d3eb533fb870f0493c7844679062610 Mon Sep 17 00:00:00 2001
|
|
|
4a2fec |
From: Auger Eric <eric.auger@redhat.com>
|
|
|
4a2fec |
Date: Mon, 6 Nov 2017 17:08:44 +0100
|
|
|
4a2fec |
Subject: [PATCH 8/9] hw/pci-host/gpex: Implement PCI INTx routing
|
|
|
4a2fec |
|
|
|
4a2fec |
RH-Author: Auger Eric <eric.auger@redhat.com>
|
|
|
4a2fec |
Message-id: <1509988125-30275-4-git-send-email-eric.auger@redhat.com>
|
|
|
4a2fec |
Patchwork-id: 77510
|
|
|
4a2fec |
O-Subject: [RHV7.5 qemu-kvm-ma PATCH 3/4] hw/pci-host/gpex: Implement PCI INTx routing
|
|
|
4a2fec |
Bugzilla: 1460957
|
|
|
4a2fec |
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
4a2fec |
|
|
|
4a2fec |
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
|
|
|
4a2fec |
|
|
|
4a2fec |
Now we are able to retrieve the gsi from the INTx pin, let's
|
|
|
4a2fec |
enable intx_to_irq routing. From that point on, irqfd becomes
|
|
|
4a2fec |
usable along with INTx when assigning a PCIe device.
|
|
|
4a2fec |
|
|
|
4a2fec |
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
|
|
|
4a2fec |
Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org>
|
|
|
4a2fec |
Signed-off-by: Eric Auger <eric.auger@redhat.com>
|
|
|
4a2fec |
Reviewed-by: Andrew Jones <drjones@redhat.com>
|
|
|
4a2fec |
Tested-by: Feng Kan <fkan@apm.com>
|
|
|
4a2fec |
Message-id: 1505296004-6798-4-git-send-email-eric.auger@redhat.com
|
|
|
4a2fec |
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
|
4a2fec |
(cherry picked from commit d464814ae729f3200234ff74d5f050ddad4f1f20)
|
|
|
4a2fec |
Signed-off-by: Eric Auger <eric.auger@redhat.com>
|
|
|
4a2fec |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
4a2fec |
---
|
|
|
4a2fec |
hw/pci-host/gpex.c | 12 ++++++++++++
|
|
|
4a2fec |
1 file changed, 12 insertions(+)
|
|
|
4a2fec |
|
|
|
4a2fec |
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
|
|
|
4a2fec |
index d6cf621..4090793 100644
|
|
|
4a2fec |
--- a/hw/pci-host/gpex.c
|
|
|
4a2fec |
+++ b/hw/pci-host/gpex.c
|
|
|
4a2fec |
@@ -53,6 +53,17 @@ int gpex_set_irq_num(GPEXHost *s, int index, int gsi)
|
|
|
4a2fec |
return 0;
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
+static PCIINTxRoute gpex_route_intx_pin_to_irq(void *opaque, int pin)
|
|
|
4a2fec |
+{
|
|
|
4a2fec |
+ PCIINTxRoute route;
|
|
|
4a2fec |
+ GPEXHost *s = opaque;
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+ route.mode = PCI_INTX_ENABLED;
|
|
|
4a2fec |
+ route.irq = s->irq_num[pin];
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+ return route;
|
|
|
4a2fec |
+}
|
|
|
4a2fec |
+
|
|
|
4a2fec |
static void gpex_host_realize(DeviceState *dev, Error **errp)
|
|
|
4a2fec |
{
|
|
|
4a2fec |
PCIHostState *pci = PCI_HOST_BRIDGE(dev);
|
|
|
4a2fec |
@@ -77,6 +88,7 @@ static void gpex_host_realize(DeviceState *dev, Error **errp)
|
|
|
4a2fec |
&s->io_ioport, 0, 4, TYPE_PCIE_BUS);
|
|
|
4a2fec |
|
|
|
4a2fec |
qdev_set_parent_bus(DEVICE(&s->gpex_root), BUS(pci->bus));
|
|
|
4a2fec |
+ pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq);
|
|
|
4a2fec |
qdev_init_nofail(DEVICE(&s->gpex_root));
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
--
|
|
|
4a2fec |
1.8.3.1
|
|
|
4a2fec |
|