]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM: arm/arm64: GICv4: Add property field and per-VM predicate
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Oct 2017 14:28:37 +0000 (15:28 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 10 Nov 2017 08:06:45 +0000 (09:06 +0100)
Add a new has_gicv4 field in the global VGIC state that indicates
whether the HW is GICv4 capable, as a per-VM predicate indicating
if there is a possibility for a VM to support direct injection
(the above being true and the VM having an ITS).

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
include/kvm/arm_vgic.h
virt/kvm/arm/vgic/vgic-mmio-v3.c
virt/kvm/arm/vgic/vgic.h

index 53f631bdec756eadbf9e78a730a837c539b55d5f..ba9fb450aa1bdc11ba219de00ed8e0a71f829e8d 100644 (file)
@@ -73,6 +73,9 @@ struct vgic_global {
        /* Only needed for the legacy KVM_CREATE_IRQCHIP */
        bool                    can_emulate_gicv2;
 
+       /* Hardware has GICv4? */
+       bool                    has_gicv4;
+
        /* GIC system register CPU interface */
        struct static_key_false gicv3_cpuif;
 
index 83786108829e38feb57267648c88acb04173f8ca..671fe81f8e1de991e1636a9901012b0a203618a4 100644 (file)
@@ -54,6 +54,11 @@ bool vgic_has_its(struct kvm *kvm)
        return dist->has_its;
 }
 
+bool vgic_supports_direct_msis(struct kvm *kvm)
+{
+       return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm);
+}
+
 static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu,
                                            gpa_t addr, unsigned int len)
 {
index 0ac85045c0c7038c351389e04fced9cb1a2ec6c0..67509b203cf52313fedf1229eaa3289858f77235 100644 (file)
@@ -241,4 +241,6 @@ int vgic_its_resolve_lpi(struct kvm *kvm, struct vgic_its *its,
                         u32 devid, u32 eventid, struct vgic_irq **irq);
 struct vgic_its *vgic_msi_to_its(struct kvm *kvm, struct kvm_msi *msi);
 
+bool vgic_supports_direct_msis(struct kvm *kvm);
+
 #endif