Lines Matching full:objects
5 * iommufd provides control over the IOMMU HW objects created by IOMMU kernel
6 * drivers. IOMMU HW objects revolve around IO page tables that map incoming DMA
56 rc = xa_alloc(&ictx->objects, &obj->id, XA_ZERO_ENTRY, xa_limit_31b, in _iommufd_object_alloc()
97 * destruction. Expect for special kernel-only objects there is no in-kernel way
98 * to reliably destroy a single object. Thus all APIs that are creating objects
105 XA_STATE(xas, &ictx->objects, obj->id); in iommufd_object_finalize()
108 xa_lock(&ictx->objects); in iommufd_object_finalize()
110 xa_unlock(&ictx->objects); in iommufd_object_finalize()
118 XA_STATE(xas, &ictx->objects, obj->id); in iommufd_object_abort()
121 xa_lock(&ictx->objects); in iommufd_object_abort()
123 xa_unlock(&ictx->objects); in iommufd_object_abort()
174 xa_lock(&ictx->objects); in iommufd_get_object()
175 obj = xa_load(&ictx->objects, id); in iommufd_get_object()
179 xa_unlock(&ictx->objects); in iommufd_get_object()
211 XA_STATE(xas, &ictx->objects, id); in iommufd_object_remove()
217 * of objects used by external drivers and destroyed by this function. in iommufd_object_remove()
235 xa_lock(&ictx->objects); in iommufd_object_remove()
261 xa_unlock(&ictx->objects); in iommufd_object_remove()
282 xa_unlock(&ictx->objects); in iommufd_object_remove()
314 xa_init_flags(&ictx->objects, XA_FLAGS_ALLOC1 | XA_FLAGS_ACCOUNT); in iommufd_fops_open()
333 * The objects in the xarray form a graph of "users" counts, and we have in iommufd_fops_release()
334 * to destroy them in a depth first manner. Leaf objects will reduce the in iommufd_fops_release()
335 * users count of interior objects when they are destroyed. in iommufd_fops_release()
337 * Repeatedly destroying all the "1 users" leaf objects will progress in iommufd_fops_release()
341 while (!xa_empty(&ictx->objects)) { in iommufd_fops_release()
354 xa_for_each(&ictx->objects, index, obj) { in iommufd_fops_release()
360 xa_erase(&ictx->objects, index); in iommufd_fops_release()
377 xa_destroy(&ictx->objects); in iommufd_fops_release()