Lines Matching full:collection
183 struct its_collection *collection; member
189 * @cte_esz: collection table entry size
289 * Finds and returns a collection in the ITS collection table.
294 struct its_collection *collection; in find_collection() local
296 list_for_each_entry(collection, &its->collection_list, coll_list) { in find_collection()
297 if (coll_id == collection->collection_id) in find_collection()
298 return collection; in find_collection()
383 * Needs to be called whenever either the collection for a LPIs has
384 * changed or the collection itself got retargeted.
390 if (!its_is_collection_mapped(ite->collection)) in update_affinity_ite()
393 vcpu = collection_to_vcpu(kvm, ite->collection); in update_affinity_ite()
398 * Updates the target VCPU for every LPI targeting this collection.
408 if (ite->collection != coll) in update_affinity_collection()
671 if (!ite || !its_is_collection_mapped(ite->collection)) in vgic_its_resolve_lpi()
674 vcpu = collection_to_vcpu(kvm, ite->collection); in vgic_its_resolve_lpi()
829 if (ite && its_is_collection_mapped(ite->collection)) { in vgic_its_cmd_handle_discard()
849 * The MOVI command moves an ITTE to a different collection.
860 struct its_collection *collection; in vgic_its_cmd_handle_movi() local
866 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
869 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_movi()
870 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_movi()
873 ite->collection = collection; in vgic_its_cmd_handle_movi()
874 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_movi()
915 /* as GITS_TYPER.CIL == 0, ITS supports 16-bit collection ID */ in vgic_its_check_id()
987 * Add a new collection into the ITS collection table.
994 struct its_collection *collection; in vgic_its_alloc_collection() local
996 collection = kzalloc(sizeof(*collection), GFP_KERNEL_ACCOUNT); in vgic_its_alloc_collection()
997 if (!collection) in vgic_its_alloc_collection()
1000 collection->collection_id = coll_id; in vgic_its_alloc_collection()
1001 collection->target_addr = COLLECTION_NOT_MAPPED; in vgic_its_alloc_collection()
1003 list_add_tail(&collection->coll_list, &its->collection_list); in vgic_its_alloc_collection()
1004 *colp = collection; in vgic_its_alloc_collection()
1011 struct its_collection *collection; in vgic_its_free_collection() local
1016 * Clearing the mapping for that collection ID removes the in vgic_its_free_collection()
1020 collection = find_collection(its, coll_id); in vgic_its_free_collection()
1021 if (!collection) in vgic_its_free_collection()
1025 if (ite->collection && in vgic_its_free_collection()
1026 ite->collection->collection_id == coll_id) in vgic_its_free_collection()
1027 ite->collection = NULL; in vgic_its_free_collection()
1029 list_del(&collection->coll_list); in vgic_its_free_collection()
1030 kfree(collection); in vgic_its_free_collection()
1035 struct its_collection *collection, in vgic_its_alloc_ite() argument
1045 ite->collection = collection; in vgic_its_alloc_ite()
1064 struct its_collection *collection, *new_coll = NULL; in vgic_its_cmd_handle_mapi() local
1087 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapi()
1088 if (!collection) { in vgic_its_cmd_handle_mapi()
1094 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_cmd_handle_mapi()
1097 new_coll = collection; in vgic_its_cmd_handle_mapi()
1100 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
1107 if (its_is_collection_mapped(collection)) in vgic_its_cmd_handle_mapi()
1108 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_mapi()
1224 * The MAPC command maps collection IDs to redistributors.
1231 struct its_collection *collection; in vgic_its_cmd_handle_mapc() local
1247 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapc()
1249 if (!collection) { in vgic_its_cmd_handle_mapc()
1256 ret = vgic_its_alloc_collection(its, &collection, in vgic_its_cmd_handle_mapc()
1260 collection->target_addr = vcpu->vcpu_id; in vgic_its_cmd_handle_mapc()
1262 collection->target_addr = vcpu->vcpu_id; in vgic_its_cmd_handle_mapc()
1263 update_affinity_collection(kvm, its, collection); in vgic_its_cmd_handle_mapc()
1324 * collection, and we don't need to hold the its_lock, since no ITS is
1350 * The INVALL command requests flushing of all IRQ data in this collection.
1351 * Find the VCPU mapped to that collection, then iterate over the VM's list
1361 struct its_collection *collection; in vgic_its_cmd_handle_invall() local
1364 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_invall()
1365 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_invall()
1368 vcpu = collection_to_vcpu(kvm, collection); in vgic_its_cmd_handle_invall()
1752 * device/collection BASER are invalid in vgic_mmio_write_its_ctlr()
2145 ite->collection->collection_id; in vgic_its_save_ite()
2163 struct its_collection *collection; in vgic_its_restore_ite() local
2190 collection = find_collection(its, coll_id); in vgic_its_restore_ite()
2191 if (!collection) in vgic_its_restore_ite()
2197 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
2201 if (its_is_collection_mapped(collection)) in vgic_its_restore_ite()
2202 vcpu = kvm_get_vcpu_by_id(kvm, collection->target_addr); in vgic_its_restore_ite()
2478 struct its_collection *collection, in vgic_its_save_cte() argument
2484 ((u64)collection->target_addr << KVM_ITS_CTE_RDBASE_SHIFT) | in vgic_its_save_cte()
2485 collection->collection_id); in vgic_its_save_cte()
2492 * Restore a collection entry into the ITS collection table.
2498 struct its_collection *collection; in vgic_its_restore_cte() local
2518 collection = find_collection(its, coll_id); in vgic_its_restore_cte()
2519 if (collection) in vgic_its_restore_cte()
2525 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_restore_cte()
2528 collection->target_addr = target_addr; in vgic_its_restore_cte()
2533 * vgic_its_save_collection_table - Save the collection table into
2541 struct its_collection *collection; in vgic_its_save_collection_table() local
2550 list_for_each_entry(collection, &its->collection_list, coll_list) { in vgic_its_save_collection_table()
2551 ret = vgic_its_save_cte(its, collection, gpa); in vgic_its_save_collection_table()
2569 * vgic_its_restore_collection_table - reads the collection table