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