Lines Matching full:domain

70 /* Domain feature flags */
72 #define __IOMMU_DOMAIN_DMA_API (1U << 1) /* Domain for use in DMA-API
74 #define __IOMMU_DOMAIN_PT (1U << 2) /* Domain is identity mapped */
77 * This are the possible domain-types
172 IOMMU_DEV_FEAT_AUX, /* Aux-domain feature */
200 * @domain_alloc: allocate iommu domain
201 * @domain_free: free iommu domain
202 * @attach_dev: attach device to an iommu domain
203 * @detach_dev: detach device from an iommu domain
204 * @map: map a physically contiguous memory region to an iommu domain
206 * an iommu domain.
208 * an iommu domain.
209 * @unmap: unmap a physically contiguous memory region from an iommu domain
210 * @unmap_pages: unmap a number of pages of the same size from an iommu domain
211 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
219 * group and attached to the groups domain
221 * @domain_get_attr: Query domain attributes
222 * @domain_set_attr: Change domain attributes
226 * @domain_window_enable: Configure and enable a particular window for a domain
227 * @domain_window_disable: Disable a particular window for a domain
229 * @is_attach_deferred: Check if domain attach should be deferred from iommu
234 * @aux_attach/detach_dev: aux-domain specific attach/detach entries.
235 * @aux_get_pasid: get the pasid given an aux-domain
243 * @def_domain_type: device default domain type, return value:
244 * - IOMMU_DOMAIN_IDENTITY: must use an identity domain
245 * - IOMMU_DOMAIN_DMA: must use a dma domain
253 /* Domain allocation and freeing by the iommu driver */
257 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
258 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
259 int (*map)(struct iommu_domain *domain, unsigned long iova,
261 int (*map_pages)(struct iommu_domain *domain, unsigned long iova,
264 int (*map_sg)(struct iommu_domain *domain, unsigned long iova,
267 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
269 size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova,
272 void (*flush_iotlb_all)(struct iommu_domain *domain);
273 void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova,
275 void (*iotlb_sync)(struct iommu_domain *domain,
277 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
282 int (*domain_get_attr)(struct iommu_domain *domain,
284 int (*domain_set_attr)(struct iommu_domain *domain,
291 struct iommu_domain *domain,
295 int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
297 void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);
300 bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);
308 /* Aux-domain specific attach/detach entries */
309 int (*aux_attach_dev)(struct iommu_domain *domain, struct device *dev);
310 void (*aux_detach_dev)(struct iommu_domain *domain, struct device *dev);
311 int (*aux_get_pasid)(struct iommu_domain *domain, struct device *dev);
321 int (*cache_invalidate)(struct iommu_domain *domain, struct device *dev,
323 int (*sva_bind_gpasid)(struct iommu_domain *domain,
449 extern void iommu_domain_free(struct iommu_domain *domain);
450 extern int iommu_attach_device(struct iommu_domain *domain,
452 extern void iommu_detach_device(struct iommu_domain *domain,
454 extern int iommu_uapi_cache_invalidate(struct iommu_domain *domain,
458 extern int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain,
460 extern int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain,
462 extern int iommu_sva_unbind_gpasid(struct iommu_domain *domain,
466 extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
468 extern int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova,
470 extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
472 extern size_t iommu_unmap_fast(struct iommu_domain *domain,
475 extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
477 extern size_t iommu_map_sg_atomic(struct iommu_domain *domain,
480 extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
481 extern void iommu_set_fault_handler(struct iommu_domain *domain,
497 extern int iommu_attach_group(struct iommu_domain *domain,
499 extern void iommu_detach_group(struct iommu_domain *domain,
533 extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
535 extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
539 extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
542 extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr);
544 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev,
547 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain) in iommu_flush_iotlb_all() argument
549 if (domain->ops->flush_iotlb_all) in iommu_flush_iotlb_all()
550 domain->ops->flush_iotlb_all(domain); in iommu_flush_iotlb_all()
553 static inline void iommu_iotlb_sync(struct iommu_domain *domain, in iommu_iotlb_sync() argument
556 if (domain->ops->iotlb_sync) in iommu_iotlb_sync()
557 domain->ops->iotlb_sync(domain, iotlb_gather); in iommu_iotlb_sync()
562 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, in iommu_iotlb_gather_add_page() argument
576 iommu_iotlb_sync(domain, gather); in iommu_iotlb_gather_add_page()
662 int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev);
663 void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev);
664 int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev);
701 static inline void iommu_domain_free(struct iommu_domain *domain) in iommu_domain_free() argument
705 static inline int iommu_attach_device(struct iommu_domain *domain, in iommu_attach_device() argument
711 static inline void iommu_detach_device(struct iommu_domain *domain, in iommu_detach_device() argument
721 static inline int iommu_map(struct iommu_domain *domain, unsigned long iova, in iommu_map() argument
727 static inline int iommu_map_atomic(struct iommu_domain *domain, in iommu_map_atomic() argument
734 static inline size_t iommu_unmap(struct iommu_domain *domain, in iommu_unmap() argument
740 static inline size_t iommu_unmap_fast(struct iommu_domain *domain, in iommu_unmap_fast() argument
747 static inline size_t iommu_map_sg(struct iommu_domain *domain, in iommu_map_sg() argument
754 static inline size_t iommu_map_sg_atomic(struct iommu_domain *domain, in iommu_map_sg_atomic() argument
761 static inline void iommu_flush_iotlb_all(struct iommu_domain *domain) in iommu_flush_iotlb_all() argument
765 static inline void iommu_iotlb_sync(struct iommu_domain *domain, in iommu_iotlb_sync() argument
770 static inline int iommu_domain_window_enable(struct iommu_domain *domain, in iommu_domain_window_enable() argument
777 static inline void iommu_domain_window_disable(struct iommu_domain *domain, in iommu_domain_window_disable() argument
782 static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) in iommu_iova_to_phys() argument
787 static inline void iommu_set_fault_handler(struct iommu_domain *domain, in iommu_set_fault_handler() argument
821 static inline int iommu_attach_group(struct iommu_domain *domain, in iommu_attach_group() argument
827 static inline void iommu_detach_group(struct iommu_domain *domain, in iommu_detach_group() argument
922 static inline int iommu_domain_get_attr(struct iommu_domain *domain, in iommu_domain_get_attr() argument
928 static inline int iommu_domain_set_attr(struct iommu_domain *domain, in iommu_domain_set_attr() argument
958 static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain, in iommu_iotlb_gather_add_page() argument
1037 iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev) in iommu_aux_attach_device() argument
1043 iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev) in iommu_aux_detach_device() argument
1048 iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev) in iommu_aux_get_pasid() argument
1069 iommu_uapi_cache_invalidate(struct iommu_domain *domain, in iommu_uapi_cache_invalidate() argument
1076 static inline int iommu_uapi_sva_bind_gpasid(struct iommu_domain *domain, in iommu_uapi_sva_bind_gpasid() argument
1082 static inline int iommu_uapi_sva_unbind_gpasid(struct iommu_domain *domain, in iommu_uapi_sva_unbind_gpasid() argument
1088 static inline int iommu_sva_unbind_gpasid(struct iommu_domain *domain, in iommu_sva_unbind_gpasid() argument
1102 * iommu_map_sgtable - Map the given buffer to the IOMMU domain
1103 * @domain: The IOMMU domain to perform the mapping
1109 * stored in the given sg_table object in the provided IOMMU domain.
1111 static inline size_t iommu_map_sgtable(struct iommu_domain *domain, in iommu_map_sgtable() argument
1114 return iommu_map_sg(domain, iova, sgt->sgl, sgt->orig_nents, prot); in iommu_map_sgtable()