Blame SOURCES/kvm-hw-pci-host-gpex-Implement-PCI-INTx-routing.patch

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