irqchip/gic-v3: Advertise GICv4 support to KVM
authorMarc Zyngier <marc.zyngier@arm.com>
Sun, 25 Jun 2017 13:10:46 +0000 (14:10 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 31 Aug 2017 14:31:42 +0000 (15:31 +0100)
As KVM needs to know about the availability of GICv4 to enable
direct injection of interrupts, let's advertise the feature in
the gic_kvm_info structure.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-gic-v3.c
include/linux/irqchip/arm-gic-common.h

index 65fabd5f2ec6e4ce2ce34f67240de49d8edbbe95..cc968eae6c36d77ea73c6055037758d1490833f2 100644 (file)
@@ -1159,6 +1159,7 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
        if (!ret)
                gic_v3_kvm_info.vcpu = r;
 
+       gic_v3_kvm_info.has_v4 = gic_data.rdists.has_vlpis;
        gic_set_kvm_info(&gic_v3_kvm_info);
 }
 
@@ -1452,6 +1453,7 @@ static void __init gic_acpi_setup_kvm_info(void)
                vcpu->end = vcpu->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
        }
 
+       gic_v3_kvm_info.has_v4 = gic_data.rdists.has_vlpis;
        gic_set_kvm_info(&gic_v3_kvm_info);
 }
 
index c647b0547bcd8a7c303a4e0ab153654ca335053e..0a83b4379f34627f2ae3d0deb927b82210fdb215 100644 (file)
@@ -27,6 +27,8 @@ struct gic_kvm_info {
        unsigned int    maint_irq;
        /* Virtual control interface */
        struct resource vctrl;
+       /* vlpi support */
+       bool            has_v4;
 };
 
 const struct gic_kvm_info *gic_get_kvm_info(void);