Lines Matching refs: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)
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 != ite->collection) in update_affinity_collection()
412 update_affinity_ite(kvm, ite); in update_affinity_collection()
552 struct its_ite *ite; in vgic_its_resolve_lpi() local
557 ite = find_ite(its, devid, eventid); in vgic_its_resolve_lpi()
558 if (!ite || !its_is_collection_mapped(ite->collection)) in vgic_its_resolve_lpi()
561 vcpu = kvm_get_vcpu(kvm, ite->collection->target_addr); in vgic_its_resolve_lpi()
568 *irq = ite->irq; in vgic_its_resolve_lpi()
663 static void its_free_ite(struct kvm *kvm, struct its_ite *ite) in its_free_ite() argument
665 list_del(&ite->ite_list); in its_free_ite()
668 if (ite->irq) { in its_free_ite()
669 if (ite->irq->hw) in its_free_ite()
670 WARN_ON(its_unmap_vlpi(ite->irq->host_irq)); in its_free_ite()
672 vgic_put_irq(kvm, ite->irq); in its_free_ite()
675 kfree(ite); in its_free_ite()
702 struct its_ite *ite; in vgic_its_cmd_handle_discard() local
705 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_discard()
706 if (ite && ite->collection) { in vgic_its_cmd_handle_discard()
712 its_free_ite(kvm, ite); in vgic_its_cmd_handle_discard()
730 struct its_ite *ite; in vgic_its_cmd_handle_movi() local
733 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_movi()
734 if (!ite) in vgic_its_cmd_handle_movi()
737 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
744 ite->collection = collection; in vgic_its_cmd_handle_movi()
747 return update_affinity(ite->irq, vcpu); in vgic_its_cmd_handle_movi()
854 struct its_ite *ite; in vgic_its_free_collection() local
865 for_each_lpi_its(device, ite, its) in vgic_its_free_collection()
866 if (ite->collection && in vgic_its_free_collection()
867 ite->collection->collection_id == coll_id) in vgic_its_free_collection()
868 ite->collection = NULL; in vgic_its_free_collection()
879 struct its_ite *ite; in vgic_its_alloc_ite() local
881 ite = kzalloc(sizeof(*ite), GFP_KERNEL); in vgic_its_alloc_ite()
882 if (!ite) in vgic_its_alloc_ite()
885 ite->event_id = event_id; in vgic_its_alloc_ite()
886 ite->collection = collection; in vgic_its_alloc_ite()
888 list_add_tail(&ite->ite_list, &device->itt_head); in vgic_its_alloc_ite()
889 return ite; in vgic_its_alloc_ite()
902 struct its_ite *ite; in vgic_its_cmd_handle_mapi() local
936 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
937 if (IS_ERR(ite)) { in vgic_its_cmd_handle_mapi()
940 return PTR_ERR(ite); in vgic_its_cmd_handle_mapi()
950 its_free_ite(kvm, ite); in vgic_its_cmd_handle_mapi()
953 ite->irq = irq; in vgic_its_cmd_handle_mapi()
961 struct its_ite *ite, *temp; in vgic_its_free_device() local
968 list_for_each_entry_safe(ite, temp, &device->itt_head, ite_list) in vgic_its_free_device()
969 its_free_ite(kvm, ite); in vgic_its_free_device()
1105 struct its_ite *ite; in vgic_its_cmd_handle_clear() local
1108 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_clear()
1109 if (!ite) in vgic_its_cmd_handle_clear()
1112 ite->irq->pending_latch = false; in vgic_its_cmd_handle_clear()
1114 if (ite->irq->hw) in vgic_its_cmd_handle_clear()
1115 return irq_set_irqchip_state(ite->irq->host_irq, in vgic_its_cmd_handle_clear()
1130 struct its_ite *ite; in vgic_its_cmd_handle_inv() local
1133 ite = find_ite(its, device_id, event_id); in vgic_its_cmd_handle_inv()
1134 if (!ite) in vgic_its_cmd_handle_inv()
1137 return update_lpi_config(kvm, ite->irq, NULL, true); in vgic_its_cmd_handle_inv()
1850 static u32 compute_next_eventid_offset(struct list_head *h, struct its_ite *ite) in compute_next_eventid_offset() argument
1855 if (list_is_last(&ite->ite_list, h)) in compute_next_eventid_offset()
1857 next = list_next_entry(ite, ite_list); in compute_next_eventid_offset()
1858 next_offset = next->event_id - ite->event_id; in compute_next_eventid_offset()
1927 struct its_ite *ite, gpa_t gpa, int ite_esz) in vgic_its_save_ite() argument
1933 next_offset = compute_next_eventid_offset(&dev->itt_head, ite); in vgic_its_save_ite()
1935 ((u64)ite->irq->intid << KVM_ITS_ITE_PINTID_SHIFT) | in vgic_its_save_ite()
1936 ite->collection->collection_id; in vgic_its_save_ite()
1958 struct its_ite *ite; in vgic_its_restore_ite() local
1982 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
1983 if (IS_ERR(ite)) in vgic_its_restore_ite()
1984 return PTR_ERR(ite); in vgic_its_restore_ite()
1992 ite->irq = irq; in vgic_its_restore_ite()
2013 struct its_ite *ite; in vgic_its_save_itt() local
2019 list_for_each_entry(ite, &device->itt_head, ite_list) { in vgic_its_save_itt()
2020 gpa_t gpa = base + ite->event_id * ite_esz; in vgic_its_save_itt()
2028 if (ite->irq->hw) in vgic_its_save_itt()
2031 ret = vgic_its_save_ite(its, device, ite, gpa, ite_esz); in vgic_its_save_itt()