Blame SOURCES/kvm-hw-pci-host-gpex-Set-INTx-index-gsi-mapping.patch

9bac43
From 1cd93911c6a461bbe8585b9d4e2d76ba42abead3 Mon Sep 17 00:00:00 2001
9bac43
From: Auger Eric <eric.auger@redhat.com>
9bac43
Date: Mon, 6 Nov 2017 17:08:42 +0100
9bac43
Subject: [PATCH 6/9] hw/pci-host/gpex: Set INTx index/gsi mapping
9bac43
9bac43
RH-Author: Auger Eric <eric.auger@redhat.com>
9bac43
Message-id: <1509988125-30275-2-git-send-email-eric.auger@redhat.com>
9bac43
Patchwork-id: 77509
9bac43
O-Subject: [RHV7.5 qemu-kvm-ma PATCH 1/4] hw/pci-host/gpex: Set INTx index/gsi mapping
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
To implement INTx to gsi routing we need to pass the gpex host
9bac43
bridge the gsi associated to each INTx index. Let's introduce
9bac43
irq_num array and gpex_set_irq_num setter function.
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
Tested-by: Feng Kan <fkan@apm.com>
9bac43
Reviewed-by: Andrew Jones <drjones@redhat.com>
9bac43
Message-id: 1505296004-6798-2-git-send-email-eric.auger@redhat.com
9bac43
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9bac43
(cherry picked from commit 70bfdce6a1263fd06144ecc1c3727c44e562d89b)
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         | 10 ++++++++++
9bac43
 include/hw/pci-host/gpex.h |  3 +++
9bac43
 2 files changed, 13 insertions(+)
9bac43
9bac43
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
9bac43
index 59f3132..d6cf621 100644
9bac43
--- a/hw/pci-host/gpex.c
9bac43
+++ b/hw/pci-host/gpex.c
9bac43
@@ -43,6 +43,16 @@ static void gpex_set_irq(void *opaque, int irq_num, int level)
9bac43
     qemu_set_irq(s->irq[irq_num], level);
9bac43
 }
9bac43
 
9bac43
+int gpex_set_irq_num(GPEXHost *s, int index, int gsi)
9bac43
+{
9bac43
+    if (index >= GPEX_NUM_IRQS) {
9bac43
+        return -EINVAL;
9bac43
+    }
9bac43
+
9bac43
+    s->irq_num[index] = gsi;
9bac43
+    return 0;
9bac43
+}
9bac43
+
9bac43
 static void gpex_host_realize(DeviceState *dev, Error **errp)
9bac43
 {
9bac43
     PCIHostState *pci = PCI_HOST_BRIDGE(dev);
9bac43
diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h
9bac43
index 68c9348..aef38b8 100644
9bac43
--- a/include/hw/pci-host/gpex.h
9bac43
+++ b/include/hw/pci-host/gpex.h
9bac43
@@ -51,6 +51,9 @@ typedef struct GPEXHost {
9bac43
     MemoryRegion io_ioport;
9bac43
     MemoryRegion io_mmio;
9bac43
     qemu_irq irq[GPEX_NUM_IRQS];
9bac43
+    int irq_num[GPEX_NUM_IRQS];
9bac43
 } GPEXHost;
9bac43
 
9bac43
+int gpex_set_irq_num(GPEXHost *s, int index, int gsi);
9bac43
+
9bac43
 #endif /* HW_GPEX_H */
9bac43
-- 
9bac43
1.8.3.1
9bac43