[PATCH 2/2] intc: arm_gic_kvm: set the get_gsi callback

Eric Auger
2015-04-23T08:41:35Z

The arm_gic_kvm now sets the get_gsi_cb callback so that the
global system interrupt of a qemu_irq can be retrieved. This enables
VFIO platform signaling to be setup.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
hw/intc/arm_gic_kvm.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
index e1952ad..8a97a5b 100644
--- a/hw/intc/arm_gic_kvm.c
+++ b/hw/intc/arm_gic_kvm.c
@@ -87,6 +87,11 @@ static void kvm_arm_gic_set_irq(void *opaque, int irq, int level)
kvm_set_irq(kvm_state, kvm_irq, !!level);
}

+static int kvm_gic_get_gsi(int pin)
+{
+ return pin;
+}
+
static bool kvm_arm_gic_can_save_restore(GICState *s)
{
return s->dev_fd >= 0;
@@ -554,6 +559,11 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
*/
i += (GIC_INTERNAL * s->num_cpu);
qdev_init_gpio_in(dev, kvm_arm_gic_set_irq, i);
+
+ for (i = 0; i < s->num_irq - GIC_INTERNAL; i++) {
+ qemu_irq irq = qdev_get_gpio_in(dev, i);
+ qemu_irq_set_get_gsi_cb(irq, kvm_gic_get_gsi);
+ }
/* We never use our outbound IRQ lines but provide them so that
* we maintain the same interface as the non-KVM GIC.
*/
--
1.8.3.2