}
EXPORT_SYMBOL_GPL(iommu_set_fault_handler);
+/**
+ * iommu_trigger_fault() - trigger an IOMMU fault
+ * @domain: iommu domain
+ *
+ * Triggers a fault on the device to which this domain is attached.
+ *
+ * This function should only be used for debugging purposes, for obvious
+ * reasons.
+ */
+void iommu_trigger_fault(struct iommu_domain *domain)
+{
+ if (domain->ops->trigger_fault)
+ domain->ops->trigger_fault(domain);
+}
+
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
{
struct iommu_domain *domain;
* @domain_get_attr: Query domain attributes
* @domain_set_attr: Change domain attributes
* @pgsize_bitmap: bitmap of supported page sizes
+ * @trigger_fault: trigger a fault on the device attached to an iommu domain
*/
struct iommu_ops {
bool (*capable)(enum iommu_cap);
u32 (*domain_get_windows)(struct iommu_domain *domain);
int (*dma_supported)(struct iommu_domain *domain, struct device *dev,
u64 mask);
+ void (*trigger_fault)(struct iommu_domain *domain);
unsigned long pgsize_bitmap;
};
dma_addr_t iova);
extern void iommu_set_fault_handler(struct iommu_domain *domain,
iommu_fault_handler_t handler, void *token);
+extern void iommu_trigger_fault(struct iommu_domain *domain);
extern int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group);
{
}
+static inline void iommu_trigger_fault(struct iommu_domain *domain)
+{
+}
+
static inline int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group)
{