@@ -690,7 +690,8 @@ void iommufd_access_destroy_object(struct iommufd_object *obj)
container_of(obj, struct iommufd_access, obj);
if (access->ioas) {
- iopt_remove_access(&access->ioas->iopt, access);
+ iopt_remove_access(&access->ioas->iopt, access,
+ access->iopt_access_list_id);
refcount_dec(&access->ioas->obj.users);
access->ioas = NULL;
}
@@ -776,7 +777,8 @@ void iommufd_access_detach(struct iommufd_access *access)
access->ops->unmap(access->data, 0, ULONG_MAX);
mutex_lock(&access->ioas_lock);
}
- iopt_remove_access(&cur_ioas->iopt, access);
+ iopt_remove_access(&cur_ioas->iopt, access,
+ access->iopt_access_list_id);
refcount_dec(&cur_ioas->obj.users);
out:
access->ioas_unpin = NULL;
@@ -1158,12 +1158,12 @@ int iopt_add_access(struct io_pagetable *iopt, struct iommufd_access *access)
}
void iopt_remove_access(struct io_pagetable *iopt,
- struct iommufd_access *access)
+ struct iommufd_access *access,
+ u32 iopt_access_list_id)
{
down_write(&iopt->domains_rwsem);
down_write(&iopt->iova_rwsem);
- WARN_ON(xa_erase(&iopt->access_list, access->iopt_access_list_id) !=
- access);
+ WARN_ON(xa_erase(&iopt->access_list, iopt_access_list_id) != access);
WARN_ON(iopt_calculate_iova_alignment(iopt));
up_write(&iopt->iova_rwsem);
up_write(&iopt->domains_rwsem);
@@ -323,7 +323,8 @@ struct iommufd_access {
int iopt_add_access(struct io_pagetable *iopt, struct iommufd_access *access);
void iopt_remove_access(struct io_pagetable *iopt,
- struct iommufd_access *access);
+ struct iommufd_access *access,
+ u32 iopt_access_list_id);
void iommufd_access_destroy_object(struct iommufd_object *obj);
#ifdef CONFIG_IOMMUFD_TEST