Lines Matching full:collection
144 struct its_collection *collection; member
158 * @cte_esz: collection table entry size
256 * Finds and returns a collection in the ITS collection table.
261 struct its_collection *collection; in find_collection() local
263 list_for_each_entry(collection, &its->collection_list, coll_list) { in find_collection()
264 if (coll_id == collection->collection_id) in find_collection()
265 return collection; in find_collection()
384 * Needs to be called whenever either the collection for a LPIs has
385 * changed or the collection itself got retargeted.
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()
399 * Updates the target VCPU for every LPI targeting this collection.
409 if (ite->collection != coll) in update_affinity_collection()
686 if (!ite || !its_is_collection_mapped(ite->collection)) in vgic_its_resolve_lpi()
689 vcpu = kvm_get_vcpu(kvm, ite->collection->target_addr); in vgic_its_resolve_lpi()
857 if (ite && its_is_collection_mapped(ite->collection)) { in vgic_its_cmd_handle_discard()
877 * The MOVI command moves an ITTE to a different collection.
888 struct its_collection *collection; in vgic_its_cmd_handle_movi() local
894 if (!its_is_collection_mapped(ite->collection)) in vgic_its_cmd_handle_movi()
897 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_movi()
898 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_movi()
901 ite->collection = collection; in vgic_its_cmd_handle_movi()
902 vcpu = kvm_get_vcpu(kvm, collection->target_addr); in vgic_its_cmd_handle_movi()
943 /* as GITS_TYPER.CIL == 0, ITS supports 16-bit collection ID */ in vgic_its_check_id()
1015 * Add a new collection into the ITS collection table.
1022 struct its_collection *collection; in vgic_its_alloc_collection() local
1024 collection = kzalloc(sizeof(*collection), GFP_KERNEL_ACCOUNT); in vgic_its_alloc_collection()
1025 if (!collection) in vgic_its_alloc_collection()
1028 collection->collection_id = coll_id; in vgic_its_alloc_collection()
1029 collection->target_addr = COLLECTION_NOT_MAPPED; in vgic_its_alloc_collection()
1031 list_add_tail(&collection->coll_list, &its->collection_list); in vgic_its_alloc_collection()
1032 *colp = collection; in vgic_its_alloc_collection()
1039 struct its_collection *collection; in vgic_its_free_collection() local
1044 * Clearing the mapping for that collection ID removes the in vgic_its_free_collection()
1048 collection = find_collection(its, coll_id); in vgic_its_free_collection()
1049 if (!collection) in vgic_its_free_collection()
1053 if (ite->collection && in vgic_its_free_collection()
1054 ite->collection->collection_id == coll_id) in vgic_its_free_collection()
1055 ite->collection = NULL; in vgic_its_free_collection()
1057 list_del(&collection->coll_list); in vgic_its_free_collection()
1058 kfree(collection); in vgic_its_free_collection()
1063 struct its_collection *collection, in vgic_its_alloc_ite() argument
1073 ite->collection = collection; in vgic_its_alloc_ite()
1092 struct its_collection *collection, *new_coll = NULL; in vgic_its_cmd_handle_mapi() local
1115 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapi()
1116 if (!collection) { in vgic_its_cmd_handle_mapi()
1122 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_cmd_handle_mapi()
1125 new_coll = collection; in vgic_its_cmd_handle_mapi()
1128 ite = vgic_its_alloc_ite(device, collection, event_id); in vgic_its_cmd_handle_mapi()
1135 if (its_is_collection_mapped(collection)) in vgic_its_cmd_handle_mapi()
1136 vcpu = kvm_get_vcpu(kvm, collection->target_addr); in vgic_its_cmd_handle_mapi()
1252 * The MAPC command maps collection IDs to redistributors.
1260 struct its_collection *collection; in vgic_its_cmd_handle_mapc() local
1274 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_mapc()
1276 if (!collection) { in vgic_its_cmd_handle_mapc()
1283 ret = vgic_its_alloc_collection(its, &collection, in vgic_its_cmd_handle_mapc()
1287 collection->target_addr = target_addr; in vgic_its_cmd_handle_mapc()
1289 collection->target_addr = target_addr; in vgic_its_cmd_handle_mapc()
1290 update_affinity_collection(kvm, its, collection); in vgic_its_cmd_handle_mapc()
1351 * collection, and we don't need to hold the its_lock, since no ITS is
1381 * The INVALL command requests flushing of all IRQ data in this collection.
1382 * Find the VCPU mapped to that collection, then iterate over the VM's list
1392 struct its_collection *collection; in vgic_its_cmd_handle_invall() local
1395 collection = find_collection(its, coll_id); in vgic_its_cmd_handle_invall()
1396 if (!its_is_collection_mapped(collection)) in vgic_its_cmd_handle_invall()
1399 vcpu = kvm_get_vcpu(kvm, collection->target_addr); in vgic_its_cmd_handle_invall()
1790 * device/collection BASER are invalid in vgic_mmio_write_its_ctlr()
2222 ite->collection->collection_id; in vgic_its_save_ite()
2238 struct its_collection *collection; in vgic_its_restore_ite() local
2265 collection = find_collection(its, coll_id); in vgic_its_restore_ite()
2266 if (!collection) in vgic_its_restore_ite()
2272 ite = vgic_its_alloc_ite(dev, collection, event_id); in vgic_its_restore_ite()
2276 if (its_is_collection_mapped(collection)) in vgic_its_restore_ite()
2277 vcpu = kvm_get_vcpu(kvm, collection->target_addr); in vgic_its_restore_ite()
2555 struct its_collection *collection, in vgic_its_save_cte() argument
2561 ((u64)collection->target_addr << KVM_ITS_CTE_RDBASE_SHIFT) | in vgic_its_save_cte()
2562 collection->collection_id); in vgic_its_save_cte()
2569 * Restore a collection entry into the ITS collection table.
2575 struct its_collection *collection; in vgic_its_restore_cte() local
2595 collection = find_collection(its, coll_id); in vgic_its_restore_cte()
2596 if (collection) in vgic_its_restore_cte()
2602 ret = vgic_its_alloc_collection(its, &collection, coll_id); in vgic_its_restore_cte()
2605 collection->target_addr = target_addr; in vgic_its_restore_cte()
2610 * vgic_its_save_collection_table - Save the collection table into
2618 struct its_collection *collection; in vgic_its_save_collection_table() local
2627 list_for_each_entry(collection, &its->collection_list, coll_list) { in vgic_its_save_collection_table()
2628 ret = vgic_its_save_cte(its, collection, gpa, cte_esz); in vgic_its_save_collection_table()
2646 * vgic_its_restore_collection_table - reads the collection table