Lines Matching refs:domain

85  * This are the possible domain-types
179 IOMMU_DEV_FEAT_AUX, /* Aux-domain feature */
207 * @domain_alloc: allocate iommu domain
208 * @domain_free: free iommu domain
209 * @attach_dev: attach device to an iommu domain
210 * @detach_dev: detach device from an iommu domain
211 * @map: map a physically contiguous memory region to an iommu domain
213 * an iommu domain.
215 * an iommu domain.
216 * @unmap: unmap a physically contiguous memory region from an iommu domain
217 * @unmap_pages: unmap a number of pages of the same size from an iommu domain
218 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
226 * group and attached to the groups domain
228 * @domain_get_attr: Query domain attributes
229 * @domain_set_attr: Change domain attributes
233 * @domain_window_enable: Configure and enable a particular window for a domain
234 * @domain_window_disable: Disable a particular window for a domain
236 * @is_attach_deferred: Check if domain attach should be deferred from iommu
241 * @aux_attach/detach_dev: aux-domain specific attach/detach entries.
242 * @aux_get_pasid: get the pasid given an aux-domain
250 * @def_domain_type: device default domain type, return value:
251 * - IOMMU_DOMAIN_IDENTITY: must use an identity domain
252 * - IOMMU_DOMAIN_DMA: must use a dma domain
264 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
265 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
266 int (*map)(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
267 int (*map_pages)(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t pgsize, size_t pgcount,
269 int (*map_sg)(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg, unsigned int nents, int prot,
271 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, size_t size,
273 size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova, size_t pgsize, size_t pgcount,
275 void (*flush_iotlb_all)(struct iommu_domain *domain);
276 void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova, size_t size);
277 void (*iotlb_sync)(struct iommu_domain *domain, struct iommu_iotlb_gather *iotlb_gather);
278 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
283 int (*domain_get_attr)(struct iommu_domain *domain, enum iommu_attr attr, void *data);
284 int (*domain_set_attr)(struct iommu_domain *domain, enum iommu_attr attr, void *data);
289 void (*apply_resv_region)(struct device *dev, struct iommu_domain *domain, struct iommu_resv_region *region);
292 int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, phys_addr_t paddr, u64 size, int prot);
293 void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);
296 bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);
304 /* Aux-domain specific attach/detach entries */
305 int (*aux_attach_dev)(struct iommu_domain *domain, struct device *dev);
306 void (*aux_detach_dev)(struct iommu_domain *domain, struct device *dev);
307 int (*aux_get_pasid)(struct iommu_domain *domain, struct device *dev);
314 int (*cache_invalidate)(struct iommu_domain *domain, struct device *dev,
316 int (*sva_bind_gpasid)(struct iommu_domain *domain, struct device *dev, struct iommu_gpasid_bind_data *data);
437 extern void iommu_domain_free(struct iommu_domain *domain);
438 extern int iommu_attach_device(struct iommu_domain *domain, struct device *dev);
439 extern void iommu_detach_device(struct iommu_domain *domain, struct device *dev);
440 extern int iommu_uapi_cache_invalidate(struct iommu_domain *domain, struct device *dev, void __user *uinfo);
442 extern int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata);
443 extern int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata);
444 extern int iommu_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, ioasid_t pasid);
447 extern int iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot);
448 extern int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot);
449 extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size);
450 extern size_t iommu_unmap_fast(struct iommu_domain *domain, unsigned long iova, size_t size,
452 extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg, unsigned int nents,
454 extern size_t iommu_map_sg_atomic(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg,
456 extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
457 extern void iommu_set_fault_handler(struct iommu_domain *domain, iommu_fault_handler_t handler, void *token);
469 extern int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group);
470 extern void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group);
493 extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, void *data);
494 extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, void *data);
497 extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, phys_addr_t offset, u64 size, int prot);
498 extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr);
500 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev, unsigned long iova, int flags);
502 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
504 if (domain->ops->flush_iotlb_all) {
505 domain->ops->flush_iotlb_all(domain);
509 static inline void iommu_iotlb_sync(struct iommu_domain *domain, struct iommu_iotlb_gather *iotlb_gather)
511 if (domain->ops->iotlb_sync) {
512 domain->ops->iotlb_sync(domain, iotlb_gather);
518 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, struct iommu_iotlb_gather *gather,
530 iommu_iotlb_sync(domain, gather);
621 int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev);
622 void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev);
623 int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev);
664 static inline void iommu_domain_free(struct iommu_domain *domain)
668 static inline int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
673 static inline void iommu_detach_device(struct iommu_domain *domain, struct device *dev)
682 static inline int iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot)
687 static inline int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size,
693 static inline size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
698 static inline size_t iommu_unmap_fast(struct iommu_domain *domain, unsigned long iova, int gfp_order,
704 static inline size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg,
710 static inline size_t iommu_map_sg_atomic(struct iommu_domain *domain, unsigned long iova, struct scatterlist *sg,
716 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
720 static inline void iommu_iotlb_sync(struct iommu_domain *domain, struct iommu_iotlb_gather *iotlb_gather)
724 static inline int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, phys_addr_t paddr, u64 size,
730 static inline void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr)
734 static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova)
739 static inline void iommu_set_fault_handler(struct iommu_domain *domain, iommu_fault_handler_t handler, void *token)
769 static inline int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group)
774 static inline void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group)
856 static inline int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr attr, void *data)
861 static inline int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr attr, void *data)
888 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, struct iommu_iotlb_gather *gather,
955 static inline int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev)
960 static inline void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev)
964 static inline int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev)
983 static inline int iommu_uapi_cache_invalidate(struct iommu_domain *domain, struct device *dev,
989 static inline int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata)
994 static inline int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, void __user *udata)
999 static inline int iommu_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, ioasid_t pasid)
1019 * iommu_map_sgtable - Map the given buffer to the IOMMU domain
1020 * @domain: The IOMMU domain to perform the mapping
1026 * stored in the given sg_table object in the provided IOMMU domain.
1028 static inline size_t iommu_map_sgtable(struct iommu_domain *domain, unsigned long iova, struct sg_table *sgt, int prot)
1030 return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot);