Lines Matching full:domain
58 /* Domain feature flags */
60 #define __IOMMU_DOMAIN_DMA_API (1U << 1) /* Domain for use in DMA-API
62 #define __IOMMU_DOMAIN_PT (1U << 2) /* Domain is identity mapped */
65 * This are the possible domain-types
160 IOMMU_DEV_FEAT_AUX, /* Aux-domain feature */
188 * @domain_alloc: allocate iommu domain
189 * @domain_free: free iommu domain
190 * @attach_dev: attach device to an iommu domain
191 * @detach_dev: detach device from an iommu domain
192 * @map: map a physically contiguous memory region to an iommu domain
193 * @unmap: unmap a physically contiguous memory region from an iommu domain
194 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
202 * group and attached to the groups domain
204 * @domain_get_attr: Query domain attributes
205 * @domain_set_attr: Change domain attributes
209 * @domain_window_enable: Configure and enable a particular window for a domain
210 * @domain_window_disable: Disable a particular window for a domain
212 * @is_attach_deferred: Check if domain attach should be deferred from iommu
217 * @aux_attach/detach_dev: aux-domain specific attach/detach entries.
218 * @aux_get_pasid: get the pasid given an aux-domain
226 * @def_domain_type: device default domain type, return value:
227 * - IOMMU_DOMAIN_IDENTITY: must use an identity domain
228 * - IOMMU_DOMAIN_DMA: must use a dma domain
236 /* Domain allocation and freeing by the iommu driver */
240 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
241 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
242 int (*map)(struct iommu_domain *domain, unsigned long iova,
244 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
246 void (*flush_iotlb_all)(struct iommu_domain *domain);
247 void (*iotlb_sync_map)(struct iommu_domain *domain);
248 void (*iotlb_sync)(struct iommu_domain *domain,
250 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
255 int (*domain_get_attr)(struct iommu_domain *domain,
257 int (*domain_set_attr)(struct iommu_domain *domain,
264 struct iommu_domain *domain,
268 int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
270 void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);
273 bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);
281 /* Aux-domain specific attach/detach entries */
282 int (*aux_attach_dev)(struct iommu_domain *domain, struct device *dev);
283 void (*aux_detach_dev)(struct iommu_domain *domain, struct device *dev);
284 int (*aux_get_pasid)(struct iommu_domain *domain, struct device *dev);
294 int (*cache_invalidate)(struct iommu_domain *domain, struct device *dev,
296 int (*sva_bind_gpasid)(struct iommu_domain *domain,
422 extern void iommu_domain_free(struct iommu_domain *domain);
423 extern int iommu_attach_device(struct iommu_domain *domain,
425 extern void iommu_detach_device(struct iommu_domain *domain,
427 extern int iommu_uapi_cache_invalidate(struct iommu_domain *domain,
431 extern int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain,
433 extern int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain,
435 extern int iommu_sva_unbind_gpasid(struct iommu_domain *domain,
439 extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
441 extern int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova,
443 extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
445 extern size_t iommu_unmap_fast(struct iommu_domain *domain,
448 extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
450 extern size_t iommu_map_sg_atomic(struct iommu_domain *domain,
453 extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
454 extern void iommu_set_fault_handler(struct iommu_domain *domain,
470 extern int iommu_attach_group(struct iommu_domain *domain,
472 extern void iommu_detach_group(struct iommu_domain *domain,
506 extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
508 extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
512 extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
515 extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr);
517 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev,
520 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain) in iommu_flush_iotlb_all() argument
522 if (domain->ops->flush_iotlb_all) in iommu_flush_iotlb_all()
523 domain->ops->flush_iotlb_all(domain); in iommu_flush_iotlb_all()
526 static inline void iommu_iotlb_sync(struct iommu_domain *domain, in iommu_iotlb_sync() argument
529 if (domain->ops->iotlb_sync) in iommu_iotlb_sync()
530 domain->ops->iotlb_sync(domain, iotlb_gather); in iommu_iotlb_sync()
535 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, in iommu_iotlb_gather_add_page() argument
549 iommu_iotlb_sync(domain, gather); in iommu_iotlb_gather_add_page()
632 int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev);
633 void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev);
634 int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev);
671 static inline void iommu_domain_free(struct iommu_domain *domain) in iommu_domain_free() argument
675 static inline int iommu_attach_device(struct iommu_domain *domain, in iommu_attach_device() argument
681 static inline void iommu_detach_device(struct iommu_domain *domain, in iommu_detach_device() argument
691 static inline int iommu_map(struct iommu_domain *domain, unsigned long iova, in iommu_map() argument
697 static inline int iommu_map_atomic(struct iommu_domain *domain, in iommu_map_atomic() argument
704 static inline size_t iommu_unmap(struct iommu_domain *domain, in iommu_unmap() argument
710 static inline size_t iommu_unmap_fast(struct iommu_domain *domain, in iommu_unmap_fast() argument
717 static inline size_t iommu_map_sg(struct iommu_domain *domain, in iommu_map_sg() argument
724 static inline size_t iommu_map_sg_atomic(struct iommu_domain *domain, in iommu_map_sg_atomic() argument
731 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain) in iommu_flush_iotlb_all() argument
735 static inline void iommu_iotlb_sync(struct iommu_domain *domain, in iommu_iotlb_sync() argument
740 static inline int iommu_domain_window_enable(struct iommu_domain *domain, in iommu_domain_window_enable() argument
747 static inline void iommu_domain_window_disable(struct iommu_domain *domain, in iommu_domain_window_disable() argument
752 static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) in iommu_iova_to_phys() argument
757 static inline void iommu_set_fault_handler(struct iommu_domain *domain, in iommu_set_fault_handler() argument
791 static inline int iommu_attach_group(struct iommu_domain *domain, in iommu_attach_group() argument
797 static inline void iommu_detach_group(struct iommu_domain *domain, in iommu_detach_group() argument
892 static inline int iommu_domain_get_attr(struct iommu_domain *domain, in iommu_domain_get_attr() argument
898 static inline int iommu_domain_set_attr(struct iommu_domain *domain, in iommu_domain_set_attr() argument
928 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, in iommu_iotlb_gather_add_page() argument
1007 iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev) in iommu_aux_attach_device() argument
1013 iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev) in iommu_aux_detach_device() argument
1018 iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev) in iommu_aux_get_pasid() argument
1039 iommu_uapi_cache_invalidate(struct iommu_domain *domain, in iommu_uapi_cache_invalidate() argument
1046 static inline int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, in iommu_uapi_sva_bind_gpasid() argument
1052 static inline int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, in iommu_uapi_sva_unbind_gpasid() argument
1058 static inline int iommu_sva_unbind_gpasid(struct iommu_domain *domain, in iommu_sva_unbind_gpasid() argument
1072 * iommu_map_sgtable - Map the given buffer to the IOMMU domain
1073 * @domain: The IOMMU domain to perform the mapping
1079 * stored in the given sg_table object in the provided IOMMU domain.
1081 static inline size_t iommu_map_sgtable(struct iommu_domain *domain, in iommu_map_sgtable() argument
1084 return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot); in iommu_map_sgtable()