Loading drivers/iommu/iommu.c +15 −3 Original line number Diff line number Diff line Loading @@ -817,6 +817,15 @@ bool iommu_present(struct bus_type *bus) } EXPORT_SYMBOL_GPL(iommu_present); bool iommu_capable(struct bus_type *bus, enum iommu_cap cap) { if (!bus->iommu_ops || !bus->iommu_ops->capable) return false; return bus->iommu_ops->capable(cap); } EXPORT_SYMBOL_GPL(iommu_capable); /** * iommu_set_fault_handler() - set a fault handler for an iommu domain * @domain: iommu domain Loading Loading @@ -950,10 +959,13 @@ EXPORT_SYMBOL_GPL(iommu_iova_to_phys); int iommu_domain_has_cap(struct iommu_domain *domain, enum iommu_cap cap) { if (unlikely(domain->ops->domain_has_cap == NULL)) return 0; if (domain->ops->domain_has_cap != NULL) return domain->ops->domain_has_cap(domain, cap); if (domain->ops->capable != NULL) return domain->ops->capable(cap); return 0; } EXPORT_SYMBOL_GPL(iommu_domain_has_cap); Loading include/linux/iommu.h +7 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ enum iommu_attr { * @pgsize_bitmap: bitmap of supported page sizes */ struct iommu_ops { bool (*capable)(enum iommu_cap); int (*domain_init)(struct iommu_domain *domain); void (*domain_destroy)(struct iommu_domain *domain); int (*attach_dev)(struct iommu_domain *domain, struct device *dev); Loading Loading @@ -145,6 +146,7 @@ struct iommu_ops { extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); extern bool iommu_present(struct bus_type *bus); extern bool iommu_capable(struct bus_type *bus, enum iommu_cap cap); extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); extern struct iommu_group *iommu_group_get_by_id(int id); extern void iommu_domain_free(struct iommu_domain *domain); Loading Loading @@ -253,6 +255,11 @@ static inline bool iommu_present(struct bus_type *bus) return false; } static inline bool iommu_capable(struct bus_type *bus, enum iommu_cap cap) { return false; } static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) { return NULL; Loading Loading
drivers/iommu/iommu.c +15 −3 Original line number Diff line number Diff line Loading @@ -817,6 +817,15 @@ bool iommu_present(struct bus_type *bus) } EXPORT_SYMBOL_GPL(iommu_present); bool iommu_capable(struct bus_type *bus, enum iommu_cap cap) { if (!bus->iommu_ops || !bus->iommu_ops->capable) return false; return bus->iommu_ops->capable(cap); } EXPORT_SYMBOL_GPL(iommu_capable); /** * iommu_set_fault_handler() - set a fault handler for an iommu domain * @domain: iommu domain Loading Loading @@ -950,10 +959,13 @@ EXPORT_SYMBOL_GPL(iommu_iova_to_phys); int iommu_domain_has_cap(struct iommu_domain *domain, enum iommu_cap cap) { if (unlikely(domain->ops->domain_has_cap == NULL)) return 0; if (domain->ops->domain_has_cap != NULL) return domain->ops->domain_has_cap(domain, cap); if (domain->ops->capable != NULL) return domain->ops->capable(cap); return 0; } EXPORT_SYMBOL_GPL(iommu_domain_has_cap); Loading
include/linux/iommu.h +7 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ enum iommu_attr { * @pgsize_bitmap: bitmap of supported page sizes */ struct iommu_ops { bool (*capable)(enum iommu_cap); int (*domain_init)(struct iommu_domain *domain); void (*domain_destroy)(struct iommu_domain *domain); int (*attach_dev)(struct iommu_domain *domain, struct device *dev); Loading Loading @@ -145,6 +146,7 @@ struct iommu_ops { extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); extern bool iommu_present(struct bus_type *bus); extern bool iommu_capable(struct bus_type *bus, enum iommu_cap cap); extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); extern struct iommu_group *iommu_group_get_by_id(int id); extern void iommu_domain_free(struct iommu_domain *domain); Loading Loading @@ -253,6 +255,11 @@ static inline bool iommu_present(struct bus_type *bus) return false; } static inline bool iommu_capable(struct bus_type *bus, enum iommu_cap cap) { return false; } static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) { return NULL; Loading