Lines Matching +full:gic +full:- +full:v3 +full:- +full:its

1 /* SPDX-License-Identifier: GPL-2.0-only */
8 #include <linux/irqchip/arm-gic-common.h>
14 #define VGIC_ADDR_UNDEF (-1)
19 #define VGIC_LPI_MAX_INTID ((1 << INTERRUPT_ID_BITS_ITS) - 1)
47 * As per Documentation/virt/kvm/devices/arm-vgic-v3.rst,
68 * As per Documentation/virt/kvm/devices/arm-vgic-its.rst,
69 * below macros are defined for ITS table entry encoding.
105 return vcpu->kvm->arch.vgic.implementation_rev; in vgic_get_implementation_rev()
111 if (irq->config == VGIC_CONFIG_EDGE) in irq_is_pending()
112 return irq->pending_latch; in irq_is_pending()
114 return irq->pending_latch || irq->line_level; in irq_is_pending()
119 return irq->config == VGIC_CONFIG_LEVEL && irq->hw; in vgic_irq_is_mapped_level()
125 if (vgic_irq_is_sgi(irq->intid) && irq->source) in vgic_irq_get_lr_count()
126 return hweight8(irq->source) + irq->active; in vgic_irq_get_lr_count()
128 return irq_is_pending(irq) || irq->active; in vgic_irq_get_lr_count()
139 struct vgic_dist *dist = &kvm->arch.vgic; in vgic_write_guest_lock()
142 dist->table_write_in_progress = true; in vgic_write_guest_lock()
144 dist->table_write_in_progress = false; in vgic_write_guest_lock()
151 * in the GICH_VMCR and ICH_VMCR registers, such that code exporting the GIC
153 * registers regardless of the hardware backed GIC used.
189 unsigned long flags) __releases(&irq->irq_lock);
227 if (irq->intid < VGIC_MIN_LPI) in vgic_try_get_irq_kref()
230 return kref_get_unless_zero(&irq->refcount); in vgic_try_get_irq_kref()
283 struct vgic_cpu *cpu_if = &vcpu->arch.vgic_cpu; in vgic_v3_max_apr_idx()
290 switch (cpu_if->num_pri_bits) { in vgic_v3_max_apr_idx()
300 if (!region->count) in vgic_v3_redist_region_full()
303 return (region->free_index >= region->count); in vgic_v3_redist_region_full()
311 if (!rdreg->count) in vgic_v3_rd_region_size()
312 return atomic_read(&kvm->online_vcpus) * KVM_VGIC_V3_REDIST_SIZE; in vgic_v3_rd_region_size()
314 return rdreg->count * KVM_VGIC_V3_REDIST_SIZE; in vgic_v3_rd_region_size()
325 struct vgic_dist *d = &kvm->arch.vgic; in vgic_dist_overlap()
327 return (base + size > d->vgic_dist_base) && in vgic_dist_overlap()
328 (base < d->vgic_dist_base + KVM_VGIC_V3_DIST_SIZE); in vgic_dist_overlap()
332 int vgic_its_resolve_lpi(struct kvm *kvm, struct vgic_its *its,
353 return kvm_has_feat(kvm, ID_AA64PFR0_EL1, GIC, IMP); in kvm_has_gicv3()