Lines Matching full:collection
148 struct its_collection *collection; member
154 * @cte_esz: collection table entry size
254 * Finds and returns a collection in the ITS collection table.
259 struct its_collection *collection; in find_collection() local
261 list_for_each_entry(collection, &its->collection_list, coll_list) { in find_collection()
262 if (coll_id == collection->collection_id) in find_collection()
263 return collection; in find_collection()
348 * Needs to be called whenever either the collection for a LPIs has
349 * changed or the collection itself got retargeted.
355 if (!its_is_collection_mapped(ite->collection)) in update_affinity_ite()
358 vcpu = collection_to_vcpu(kvm, ite->collection); in update_affinity_ite()
363 * Updates the target VCPU for every LPI targeting this collection.
373 if (ite->collection != coll) in update_affinity_collection()
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()
784 if (ite && its_is_collection_mapped(ite->collection)) { in vgic_its_cmd_handle_discard()
800 * The MOVI command moves an ITTE to a different collection.
811 struct its_collection *collection; in vgic_its_cmd_handle_movi() local
817 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
820 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_movi()
821 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_movi()
824 ite->collection = collection; in vgic_its_cmd_handle_movi()
825 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_movi()
866 /* as GITS_TYPER.CIL == 0, ITS supports 16-bit collection ID */ in vgic_its_check_id()
938 * Add a new collection into the ITS collection table.
945 struct its_collection *collection; in vgic_its_alloc_collection() local
947 collection = kzalloc(sizeof(*collection), GFP_KERNEL_ACCOUNT); in vgic_its_alloc_collection()
948 if (!collection) in vgic_its_alloc_collection()
951 collection->collection_id = coll_id; in vgic_its_alloc_collection()
952 collection->target_addr = COLLECTION_NOT_MAPPED; in vgic_its_alloc_collection()
954 list_add_tail(&collection->coll_list, &its->collection_list); in vgic_its_alloc_collection()
955 *colp = collection; in vgic_its_alloc_collection()
962 struct its_collection *collection; in vgic_its_free_collection() local
967 * Clearing the mapping for that collection ID removes the in vgic_its_free_collection()
971 collection = find_collection(its, coll_id); in vgic_its_free_collection()
972 if (!collection) 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()
980 list_del(&collection->coll_list); in vgic_its_free_collection()
981 kfree(collection); in vgic_its_free_collection()
986 struct its_collection *collection, in vgic_its_alloc_ite() argument
996 ite->collection = collection; in vgic_its_alloc_ite()
1015 struct its_collection *collection, *new_coll = NULL; in vgic_its_cmd_handle_mapi() local
1038 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapi()
1039 if (!collection) { in vgic_its_cmd_handle_mapi()
1045 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_cmd_handle_mapi()
1048 new_coll = collection; in vgic_its_cmd_handle_mapi()
1051 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
1058 if (its_is_collection_mapped(collection)) in vgic_its_cmd_handle_mapi()
1059 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_mapi()
1174 * The MAPC command maps collection IDs to redistributors.
1181 struct its_collection *collection; in vgic_its_cmd_handle_mapc() local
1197 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapc()
1199 if (!collection) { in vgic_its_cmd_handle_mapc()
1206 ret = vgic_its_alloc_collection(its, &collection, in vgic_its_cmd_handle_mapc()
1210 collection->target_addr = vcpu->vcpu_id; in vgic_its_cmd_handle_mapc()
1212 collection->target_addr = vcpu->vcpu_id; in vgic_its_cmd_handle_mapc()
1213 update_affinity_collection(kvm, its, collection); in vgic_its_cmd_handle_mapc()
1274 * collection, and we don't need to hold the its_lock, since no ITS is
1300 * The INVALL command requests flushing of all IRQ data in this collection.
1301 * Find the VCPU mapped to that collection, then iterate over the VM's list
1311 struct its_collection *collection; in vgic_its_cmd_handle_invall() local
1314 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_invall()
1315 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_invall()
1318 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_invall()
1702 * device/collection BASER are invalid in vgic_mmio_write_its_ctlr()
2096 ite->collection->collection_id; in vgic_its_save_ite()
2113 struct its_collection *collection; in vgic_its_restore_ite() local
2140 collection = find_collection(its, coll_id); in vgic_its_restore_ite()
2141 if (!collection) in vgic_its_restore_ite()
2147 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
2151 if (its_is_collection_mapped(collection)) in vgic_its_restore_ite()
2152 vcpu = kvm_get_vcpu_by_id(kvm, collection->target_addr); in vgic_its_restore_ite()
2431 struct its_collection *collection, in vgic_its_save_cte() argument
2437 ((u64)collection->target_addr << KVM_ITS_CTE_RDBASE_SHIFT) | in vgic_its_save_cte()
2438 collection->collection_id); in vgic_its_save_cte()
2444 * Restore a collection entry into the ITS collection table.
2450 struct its_collection *collection; in vgic_its_restore_cte() local
2471 collection = find_collection(its, coll_id); in vgic_its_restore_cte()
2472 if (collection) in vgic_its_restore_cte()
2478 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_restore_cte()
2481 collection->target_addr = target_addr; in vgic_its_restore_cte()
2486 * vgic_its_save_collection_table - Save the collection table into
2494 struct its_collection *collection; in vgic_its_save_collection_table() local
2504 list_for_each_entry(collection, &its->collection_list, coll_list) { in vgic_its_save_collection_table()
2505 ret = vgic_its_save_cte(its, collection, gpa, cte_esz); in vgic_its_save_collection_table()
2526 * vgic_its_restore_collection_table - reads the collection table