Lines Matching full:ite
226 struct its_ite *ite; in find_ite() local
232 list_for_each_entry(ite, &device->itt_head, ite_list) in find_ite()
233 if (ite->event_id == event_id) in find_ite()
234 return ite; in find_ite()
240 #define for_each_lpi_its(dev, ite, its) \ argument
242 list_for_each_entry(ite, &(dev)->itt_head, ite_list)
351 static void update_affinity_ite(struct kvm *kvm, struct its_ite *ite) in update_affinity_ite() argument
355 if (!its_is_collection_mapped(ite->collection)) in update_affinity_ite()
358 vcpu = collection_to_vcpu(kvm, ite->collection); in update_affinity_ite()
359 update_affinity(ite->irq, vcpu); in update_affinity_ite()
370 struct its_ite *ite; in update_affinity_collection() local
372 for_each_lpi_its(device, ite, its) { in update_affinity_collection()
373 if (ite->collection != coll) in update_affinity_collection()
376 update_affinity_ite(kvm, ite); in update_affinity_collection()
571 * its_lock, as the ITE (and the reference it holds) cannot be freed. in vgic_its_cache_translation()
620 struct its_ite *ite; in vgic_its_resolve_lpi() local
625 ite = find_ite(its, devid, eventid); in vgic_its_resolve_lpi()
626 if (!ite || !its_is_collection_mapped(ite->collection)) in vgic_its_resolve_lpi()
629 vcpu = collection_to_vcpu(kvm, ite->collection); in vgic_its_resolve_lpi()
636 vgic_its_cache_translation(kvm, its, devid, eventid, ite->irq); in vgic_its_resolve_lpi()
638 *irq = ite->irq; in vgic_its_resolve_lpi()
742 static void its_free_ite(struct kvm *kvm, struct its_ite *ite) in its_free_ite() argument
744 list_del(&ite->ite_list); in its_free_ite()
747 if (ite->irq) { in its_free_ite()
748 if (ite->irq->hw) in its_free_ite()
749 WARN_ON(its_unmap_vlpi(ite->irq->host_irq)); in its_free_ite()
751 vgic_put_irq(kvm, ite->irq); in its_free_ite()
754 kfree(ite); in its_free_ite()
781 struct its_ite *ite; in vgic_its_cmd_handle_discard() local
783 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_discard()
784 if (ite && its_is_collection_mapped(ite->collection)) { in vgic_its_cmd_handle_discard()
792 its_free_ite(kvm, ite); in vgic_its_cmd_handle_discard()
810 struct its_ite *ite; in vgic_its_cmd_handle_movi() local
813 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_movi()
814 if (!ite) in vgic_its_cmd_handle_movi()
817 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
824 ite->collection = collection; in vgic_its_cmd_handle_movi()
829 return update_affinity(ite->irq, vcpu); in vgic_its_cmd_handle_movi()
964 struct its_ite *ite; in vgic_its_free_collection() local
975 for_each_lpi_its(device, ite, its) in vgic_its_free_collection()
976 if (ite->collection && in vgic_its_free_collection()
977 ite->collection->collection_id == coll_id) in vgic_its_free_collection()
978 ite->collection = NULL; in vgic_its_free_collection()
989 struct its_ite *ite; in vgic_its_alloc_ite() local
991 ite = kzalloc(sizeof(*ite), GFP_KERNEL_ACCOUNT); in vgic_its_alloc_ite()
992 if (!ite) in vgic_its_alloc_ite()
995 ite->event_id = event_id; in vgic_its_alloc_ite()
996 ite->collection = collection; in vgic_its_alloc_ite()
998 list_add_tail(&ite->ite_list, &device->itt_head); in vgic_its_alloc_ite()
999 return ite; in vgic_its_alloc_ite()
1012 struct its_ite *ite; in vgic_its_cmd_handle_mapi() local
1051 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
1052 if (IS_ERR(ite)) { in vgic_its_cmd_handle_mapi()
1055 return PTR_ERR(ite); in vgic_its_cmd_handle_mapi()
1065 its_free_ite(kvm, ite); in vgic_its_cmd_handle_mapi()
1068 ite->irq = irq; in vgic_its_cmd_handle_mapi()
1077 struct its_ite *ite, *temp; in vgic_its_free_device() local
1084 list_for_each_entry_safe(ite, temp, &device->itt_head, ite_list) in vgic_its_free_device()
1085 its_free_ite(kvm, ite); in vgic_its_free_device()
1229 struct its_ite *ite; in vgic_its_cmd_handle_clear() local
1232 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_clear()
1233 if (!ite) in vgic_its_cmd_handle_clear()
1236 ite->irq->pending_latch = false; in vgic_its_cmd_handle_clear()
1238 if (ite->irq->hw) in vgic_its_cmd_handle_clear()
1239 return irq_set_irqchip_state(ite->irq->host_irq, in vgic_its_cmd_handle_clear()
1259 struct its_ite *ite; in vgic_its_cmd_handle_inv() local
1262 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_inv()
1263 if (!ite) in vgic_its_cmd_handle_inv()
1266 return vgic_its_inv_lpi(kvm, ite->irq); in vgic_its_cmd_handle_inv()
2006 static u32 compute_next_eventid_offset(struct list_head *h, struct its_ite *ite) in compute_next_eventid_offset() argument
2011 if (list_is_last(&ite->ite_list, h)) in compute_next_eventid_offset()
2013 next = list_next_entry(ite, ite_list); in compute_next_eventid_offset()
2014 next_offset = next->event_id - ite->event_id; in compute_next_eventid_offset()
2087 struct its_ite *ite, gpa_t gpa, int ite_esz) in vgic_its_save_ite() argument
2093 next_offset = compute_next_eventid_offset(&dev->itt_head, ite); in vgic_its_save_ite()
2095 ((u64)ite->irq->intid << KVM_ITS_ITE_PINTID_SHIFT) | in vgic_its_save_ite()
2096 ite->collection->collection_id; in vgic_its_save_ite()
2106 * @ptr: pointer to the ITE entry
2120 struct its_ite *ite; in vgic_its_restore_ite() local
2147 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
2148 if (IS_ERR(ite)) in vgic_its_restore_ite()
2149 return PTR_ERR(ite); in vgic_its_restore_ite()
2156 its_free_ite(kvm, ite); in vgic_its_restore_ite()
2159 ite->irq = irq; in vgic_its_restore_ite()
2180 struct its_ite *ite; in vgic_its_save_itt() local
2186 list_for_each_entry(ite, &device->itt_head, ite_list) { in vgic_its_save_itt()
2187 gpa_t gpa = base + ite->event_id * ite_esz; in vgic_its_save_itt()
2195 if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1) in vgic_its_save_itt()
2198 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz); in vgic_its_save_itt()