diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-10-27 10:28:37 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-11-10 03:06:45 -0500 |
commit | e7c48059248e013772d8da69351ac8b262d8fce2 (patch) | |
tree | b0d66dccf94acd24b5ed91b53554c91afe77510d /virt | |
parent | 08c9fd04211754a34dddbb1471d6265a717ef7fd (diff) |
KVM: arm/arm64: GICv4: Add property field and per-VM predicate
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>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic/vgic-mmio-v3.c | 5 | ||||
-rw-r--r-- | virt/kvm/arm/vgic/vgic.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c index 83786108829e..671fe81f8e1d 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c | |||
@@ -54,6 +54,11 @@ bool vgic_has_its(struct kvm *kvm) | |||
54 | return dist->has_its; | 54 | return dist->has_its; |
55 | } | 55 | } |
56 | 56 | ||
57 | bool vgic_supports_direct_msis(struct kvm *kvm) | ||
58 | { | ||
59 | return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm); | ||
60 | } | ||
61 | |||
57 | static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu, | 62 | static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu, |
58 | gpa_t addr, unsigned int len) | 63 | gpa_t addr, unsigned int len) |
59 | { | 64 | { |
diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h index 0ac85045c0c7..67509b203cf5 100644 --- a/virt/kvm/arm/vgic/vgic.h +++ b/virt/kvm/arm/vgic/vgic.h | |||
@@ -241,4 +241,6 @@ int vgic_its_resolve_lpi(struct kvm *kvm, struct vgic_its *its, | |||
241 | u32 devid, u32 eventid, struct vgic_irq **irq); | 241 | u32 devid, u32 eventid, struct vgic_irq **irq); |
242 | struct vgic_its *vgic_msi_to_its(struct kvm *kvm, struct kvm_msi *msi); | 242 | struct vgic_its *vgic_msi_to_its(struct kvm *kvm, struct kvm_msi *msi); |
243 | 243 | ||
244 | bool vgic_supports_direct_msis(struct kvm *kvm); | ||
245 | |||
244 | #endif | 246 | #endif |