Lines Matching full:container

2  * iommufd container backend
33 const VFIOIOMMUFDContainer *container = in iommufd_cdev_map() local
36 return iommufd_backend_map_dma(container->be, in iommufd_cdev_map()
37 container->ioas_id, in iommufd_cdev_map()
45 const VFIOIOMMUFDContainer *container = in iommufd_cdev_unmap() local
49 return iommufd_backend_unmap_dma(container->be, in iommufd_cdev_unmap()
50 container->ioas_id, iova, size); in iommufd_cdev_unmap()
122 const VFIOIOMMUFDContainer *container = in iommufd_set_dirty_page_tracking() local
126 QLIST_FOREACH(hwpt, &container->hwpt_list, next) { in iommufd_set_dirty_page_tracking()
131 if (!iommufd_backend_set_dirty_tracking(container->be, in iommufd_set_dirty_page_tracking()
140 QLIST_FOREACH(hwpt, &container->hwpt_list, next) { in iommufd_set_dirty_page_tracking()
144 iommufd_backend_set_dirty_tracking(container->be, in iommufd_set_dirty_page_tracking()
154 VFIOIOMMUFDContainer *container = container_of(bcontainer, in iommufd_query_dirty_bitmap() local
160 QLIST_FOREACH(hwpt, &container->hwpt_list, next) { in iommufd_query_dirty_bitmap()
165 if (!iommufd_backend_get_dirty_bitmap(container->be, hwpt->hwpt_id, in iommufd_query_dirty_bitmap()
279 VFIOIOMMUFDContainer *container, in iommufd_cdev_autodomains_get() argument
290 QLIST_FOREACH(hwpt, &container->hwpt_list, next) { in iommufd_cdev_autodomains_get()
326 container->ioas_id, flags, in iommufd_cdev_autodomains_get()
339 iommufd_backend_free_id(container->be, hwpt->hwpt_id); in iommufd_cdev_autodomains_get()
347 QLIST_INSERT_HEAD(&container->hwpt_list, hwpt, next); in iommufd_cdev_autodomains_get()
348 container->bcontainer.dirty_pages_supported |= in iommufd_cdev_autodomains_get()
350 if (container->bcontainer.dirty_pages_supported && in iommufd_cdev_autodomains_get()
359 VFIOIOMMUFDContainer *container) in iommufd_cdev_autodomains_put() argument
368 iommufd_backend_free_id(container->be, hwpt->hwpt_id); in iommufd_cdev_autodomains_put()
374 VFIOIOMMUFDContainer *container, in iommufd_cdev_attach_container() argument
379 return iommufd_cdev_autodomains_get(vbasedev, container, errp); in iommufd_cdev_attach_container()
382 return !iommufd_cdev_attach_ioas_hwpt(vbasedev, container->ioas_id, errp); in iommufd_cdev_attach_container()
386 VFIOIOMMUFDContainer *container) in iommufd_cdev_detach_container() argument
395 iommufd_cdev_autodomains_put(vbasedev, container); in iommufd_cdev_detach_container()
400 static void iommufd_cdev_container_destroy(VFIOIOMMUFDContainer *container) in iommufd_cdev_container_destroy() argument
402 VFIOContainerBase *bcontainer = &container->bcontainer; in iommufd_cdev_container_destroy()
408 iommufd_backend_free_id(container->be, container->ioas_id); in iommufd_cdev_container_destroy()
409 object_unref(container); in iommufd_cdev_container_destroy()
420 static bool iommufd_cdev_get_info_iova_range(VFIOIOMMUFDContainer *container, in iommufd_cdev_get_info_iova_range() argument
423 VFIOContainerBase *bcontainer = &container->bcontainer; in iommufd_cdev_get_info_iova_range()
426 int sz, fd = container->be->fd; in iommufd_cdev_get_info_iova_range()
466 VFIOIOMMUFDContainer *container; in iommufd_cdev_attach() local
502 /* try to attach to an existing container in this space */ in iommufd_cdev_attach()
504 container = container_of(bcontainer, VFIOIOMMUFDContainer, bcontainer); in iommufd_cdev_attach()
506 vbasedev->iommufd != container->be) { in iommufd_cdev_attach()
509 if (!iommufd_cdev_attach_container(vbasedev, container, &err)) { in iommufd_cdev_attach()
526 /* Need to allocate a new dedicated container */ in iommufd_cdev_attach()
533 container = VFIO_IOMMU_IOMMUFD(object_new(TYPE_VFIO_IOMMU_IOMMUFD)); in iommufd_cdev_attach()
534 container->be = vbasedev->iommufd; in iommufd_cdev_attach()
535 container->ioas_id = ioas_id; in iommufd_cdev_attach()
536 QLIST_INIT(&container->hwpt_list); in iommufd_cdev_attach()
538 bcontainer = &container->bcontainer; in iommufd_cdev_attach()
541 if (!iommufd_cdev_attach_container(vbasedev, container, errp)) { in iommufd_cdev_attach()
550 if (!iommufd_cdev_get_info_iova_range(container, ioas_id, &err)) { in iommufd_cdev_attach()
604 iommufd_cdev_detach_container(vbasedev, container); in iommufd_cdev_attach()
606 iommufd_cdev_container_destroy(container); in iommufd_cdev_attach()
619 VFIOIOMMUFDContainer *container = container_of(bcontainer, in iommufd_cdev_detach() local
631 iommufd_cdev_detach_container(vbasedev, container); in iommufd_cdev_detach()
632 iommufd_cdev_container_destroy(container); in iommufd_cdev_detach()