Lines Matching refs:ite
230 struct its_ite *ite; in find_ite() local
236 list_for_each_entry(ite, &device->itt_head, ite_list) in find_ite()
237 if (ite->event_id == event_id) in find_ite()
238 return ite; in find_ite()
244 #define for_each_lpi_its(dev, ite, its) \ argument
246 list_for_each_entry(ite, &(dev)->itt_head, ite_list)
387 static void update_affinity_ite(struct kvm *kvm, struct its_ite *ite) in update_affinity_ite() argument
391 if (!its_is_collection_mapped(ite->collection)) in update_affinity_ite()
394 vcpu = kvm_get_vcpu(kvm, ite->collection->target_addr); in update_affinity_ite()
395 update_affinity(ite->irq, vcpu); in update_affinity_ite()
406 struct its_ite *ite; in update_affinity_collection() local
408 for_each_lpi_its(device, ite, its) { in update_affinity_collection()
409 if (ite->collection != coll) in update_affinity_collection()
412 update_affinity_ite(kvm, ite); in update_affinity_collection()
673 struct its_ite *ite; in vgic_its_resolve_lpi() local
678 ite = find_ite(its, devid, eventid); in vgic_its_resolve_lpi()
679 if (!ite || !its_is_collection_mapped(ite->collection)) in vgic_its_resolve_lpi()
682 vcpu = kvm_get_vcpu(kvm, ite->collection->target_addr); in vgic_its_resolve_lpi()
689 vgic_its_cache_translation(kvm, its, devid, eventid, ite->irq); in vgic_its_resolve_lpi()
691 *irq = ite->irq; in vgic_its_resolve_lpi()
807 static void its_free_ite(struct kvm *kvm, struct its_ite *ite) in its_free_ite() argument
809 list_del(&ite->ite_list); in its_free_ite()
812 if (ite->irq) { in its_free_ite()
813 if (ite->irq->hw) in its_free_ite()
814 WARN_ON(its_unmap_vlpi(ite->irq->host_irq)); in its_free_ite()
816 vgic_put_irq(kvm, ite->irq); in its_free_ite()
819 kfree(ite); in its_free_ite()
846 struct its_ite *ite; in vgic_its_cmd_handle_discard() local
848 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_discard()
849 if (ite && its_is_collection_mapped(ite->collection)) { in vgic_its_cmd_handle_discard()
857 its_free_ite(kvm, ite); in vgic_its_cmd_handle_discard()
875 struct its_ite *ite; in vgic_its_cmd_handle_movi() local
878 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_movi()
879 if (!ite) in vgic_its_cmd_handle_movi()
882 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
889 ite->collection = collection; in vgic_its_cmd_handle_movi()
894 return update_affinity(ite->irq, vcpu); in vgic_its_cmd_handle_movi()
1029 struct its_ite *ite; in vgic_its_free_collection() local
1040 for_each_lpi_its(device, ite, its) in vgic_its_free_collection()
1041 if (ite->collection && in vgic_its_free_collection()
1042 ite->collection->collection_id == coll_id) in vgic_its_free_collection()
1043 ite->collection = NULL; in vgic_its_free_collection()
1054 struct its_ite *ite; in vgic_its_alloc_ite() local
1056 ite = kzalloc(sizeof(*ite), GFP_KERNEL_ACCOUNT); in vgic_its_alloc_ite()
1057 if (!ite) in vgic_its_alloc_ite()
1060 ite->event_id = event_id; in vgic_its_alloc_ite()
1061 ite->collection = collection; in vgic_its_alloc_ite()
1063 list_add_tail(&ite->ite_list, &device->itt_head); in vgic_its_alloc_ite()
1064 return ite; in vgic_its_alloc_ite()
1077 struct its_ite *ite; in vgic_its_cmd_handle_mapi() local
1116 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
1117 if (IS_ERR(ite)) { in vgic_its_cmd_handle_mapi()
1120 return PTR_ERR(ite); in vgic_its_cmd_handle_mapi()
1130 its_free_ite(kvm, ite); in vgic_its_cmd_handle_mapi()
1133 ite->irq = irq; in vgic_its_cmd_handle_mapi()
1141 struct its_ite *ite, *temp; in vgic_its_free_device() local
1148 list_for_each_entry_safe(ite, temp, &device->itt_head, ite_list) in vgic_its_free_device()
1149 its_free_ite(kvm, ite); in vgic_its_free_device()
1292 struct its_ite *ite; in vgic_its_cmd_handle_clear() local
1295 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_clear()
1296 if (!ite) in vgic_its_cmd_handle_clear()
1299 ite->irq->pending_latch = false; in vgic_its_cmd_handle_clear()
1301 if (ite->irq->hw) in vgic_its_cmd_handle_clear()
1302 return irq_set_irqchip_state(ite->irq->host_irq, in vgic_its_cmd_handle_clear()
1322 struct its_ite *ite; in vgic_its_cmd_handle_inv() local
1325 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_inv()
1326 if (!ite) in vgic_its_cmd_handle_inv()
1329 return vgic_its_inv_lpi(kvm, ite->irq); in vgic_its_cmd_handle_inv()
2118 static u32 compute_next_eventid_offset(struct list_head *h, struct its_ite *ite) in compute_next_eventid_offset() argument
2123 if (list_is_last(&ite->ite_list, h)) in compute_next_eventid_offset()
2125 next = list_next_entry(ite, ite_list); in compute_next_eventid_offset()
2126 next_offset = next->event_id - ite->event_id; in compute_next_eventid_offset()
2198 struct its_ite *ite, gpa_t gpa, int ite_esz) in vgic_its_save_ite() argument
2204 next_offset = compute_next_eventid_offset(&dev->itt_head, ite); in vgic_its_save_ite()
2206 ((u64)ite->irq->intid << KVM_ITS_ITE_PINTID_SHIFT) | in vgic_its_save_ite()
2207 ite->collection->collection_id; in vgic_its_save_ite()
2229 struct its_ite *ite; in vgic_its_restore_ite() local
2256 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
2257 if (IS_ERR(ite)) in vgic_its_restore_ite()
2258 return PTR_ERR(ite); in vgic_its_restore_ite()
2265 its_free_ite(kvm, ite); in vgic_its_restore_ite()
2268 ite->irq = irq; in vgic_its_restore_ite()
2289 struct its_ite *ite; in vgic_its_save_itt() local
2295 list_for_each_entry(ite, &device->itt_head, ite_list) { in vgic_its_save_itt()
2296 gpa_t gpa = base + ite->event_id * ite_esz; in vgic_its_save_itt()
2304 if (ite->irq->hw && !kvm_vgic_global_state.has_gicv4_1) in vgic_its_save_itt()
2307 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz); in vgic_its_save_itt()