Lines Matching defs:hwpt_paging
22 struct iommufd_hwpt_paging *hwpt_paging =
25 if (!list_empty(&hwpt_paging->hwpt_item)) {
26 mutex_lock(&hwpt_paging->ioas->mutex);
27 list_del(&hwpt_paging->hwpt_item);
28 mutex_unlock(&hwpt_paging->ioas->mutex);
30 iopt_table_remove_domain(&hwpt_paging->ioas->iopt,
31 hwpt_paging->common.domain);
34 __iommufd_hwpt_destroy(&hwpt_paging->common);
35 refcount_dec(&hwpt_paging->ioas->obj.users);
40 struct iommufd_hwpt_paging *hwpt_paging =
44 lockdep_assert_held(&hwpt_paging->ioas->mutex);
46 if (!list_empty(&hwpt_paging->hwpt_item)) {
47 list_del_init(&hwpt_paging->hwpt_item);
48 iopt_table_remove_domain(&hwpt_paging->ioas->iopt,
49 hwpt_paging->common.domain);
72 iommufd_hwpt_paging_enforce_cc(struct iommufd_hwpt_paging *hwpt_paging)
74 struct iommu_domain *paging_domain = hwpt_paging->common.domain;
76 if (hwpt_paging->enforce_cache_coherency)
80 hwpt_paging->enforce_cache_coherency =
83 if (!hwpt_paging->enforce_cache_coherency)
118 struct iommufd_hwpt_paging *hwpt_paging;
135 hwpt_paging = __iommufd_object_alloc(
136 ictx, hwpt_paging, IOMMUFD_OBJ_HWPT_PAGING, common.obj);
137 if (IS_ERR(hwpt_paging))
138 return ERR_CAST(hwpt_paging);
139 hwpt = &hwpt_paging->common;
142 INIT_LIST_HEAD(&hwpt_paging->hwpt_item);
145 hwpt_paging->ioas = ioas;
146 hwpt_paging->nest_parent = flags & IOMMU_HWPT_ALLOC_NEST_PARENT;
183 rc = iommufd_hwpt_paging_enforce_cc(hwpt_paging);
203 list_add_tail(&hwpt_paging->hwpt_item, &ioas->hwpt_list);
204 return hwpt_paging;
365 struct iommufd_hwpt_paging *hwpt_paging;
369 hwpt_paging = iommufd_hwpt_paging_alloc(
372 if (IS_ERR(hwpt_paging)) {
373 rc = PTR_ERR(hwpt_paging);
376 hwpt = &hwpt_paging->common;
447 struct iommufd_hwpt_paging *hwpt_paging;
455 hwpt_paging = iommufd_get_hwpt_paging(ucmd, cmd->hwpt_id);
456 if (IS_ERR(hwpt_paging))
457 return PTR_ERR(hwpt_paging);
459 ioas = hwpt_paging->ioas;
462 rc = iopt_set_dirty_tracking(&ioas->iopt, hwpt_paging->common.domain,
465 iommufd_put_object(ucmd->ictx, &hwpt_paging->common.obj);
472 struct iommufd_hwpt_paging *hwpt_paging;
480 hwpt_paging = iommufd_get_hwpt_paging(ucmd, cmd->hwpt_id);
481 if (IS_ERR(hwpt_paging))
482 return PTR_ERR(hwpt_paging);
484 ioas = hwpt_paging->ioas;
486 &ioas->iopt, hwpt_paging->common.domain, cmd->flags, cmd);
488 iommufd_put_object(ucmd->ictx, &hwpt_paging->common.obj);