iommu: Add flags parameter to .trigger_fault
IOMMU drivers might want more control over the types of faults being triggered with iommu_trigger_fault. Add a flags parameter that can be used to provide more control over the types of faults that can be triggered. Change-Id: I2f21b383437430e957ab52070d3575e8cb3dee90 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
ddb8d2ab7c
commit
7f72f4984b
4 changed files with 10 additions and 7 deletions
|
@ -1203,7 +1203,8 @@ static irqreturn_t arm_smmu_global_fault(int irq, void *dev)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void arm_smmu_trigger_fault(struct iommu_domain *domain)
|
static void arm_smmu_trigger_fault(struct iommu_domain *domain,
|
||||||
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
struct arm_smmu_domain *smmu_domain = domain->priv;
|
struct arm_smmu_domain *smmu_domain = domain->priv;
|
||||||
struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
|
struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
|
||||||
|
|
|
@ -95,7 +95,7 @@ static ssize_t iommu_debug_attachment_trigger_fault_write(
|
||||||
{
|
{
|
||||||
struct iommu_debug_attachment *attach = file->private_data;
|
struct iommu_debug_attachment *attach = file->private_data;
|
||||||
|
|
||||||
iommu_trigger_fault(attach->domain);
|
iommu_trigger_fault(attach->domain, 0);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -896,10 +896,10 @@ EXPORT_SYMBOL_GPL(iommu_set_fault_handler);
|
||||||
* This function should only be used for debugging purposes, for obvious
|
* This function should only be used for debugging purposes, for obvious
|
||||||
* reasons.
|
* reasons.
|
||||||
*/
|
*/
|
||||||
void iommu_trigger_fault(struct iommu_domain *domain)
|
void iommu_trigger_fault(struct iommu_domain *domain, unsigned long flags)
|
||||||
{
|
{
|
||||||
if (domain->ops->trigger_fault)
|
if (domain->ops->trigger_fault)
|
||||||
domain->ops->trigger_fault(domain);
|
domain->ops->trigger_fault(domain, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
|
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
|
||||||
|
|
|
@ -158,7 +158,7 @@ struct iommu_ops {
|
||||||
u32 (*domain_get_windows)(struct iommu_domain *domain);
|
u32 (*domain_get_windows)(struct iommu_domain *domain);
|
||||||
int (*dma_supported)(struct iommu_domain *domain, struct device *dev,
|
int (*dma_supported)(struct iommu_domain *domain, struct device *dev,
|
||||||
u64 mask);
|
u64 mask);
|
||||||
void (*trigger_fault)(struct iommu_domain *domain);
|
void (*trigger_fault)(struct iommu_domain *domain, unsigned long flags);
|
||||||
|
|
||||||
unsigned long pgsize_bitmap;
|
unsigned long pgsize_bitmap;
|
||||||
};
|
};
|
||||||
|
@ -194,7 +194,8 @@ extern phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
|
||||||
dma_addr_t iova);
|
dma_addr_t iova);
|
||||||
extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
iommu_fault_handler_t handler, void *token);
|
iommu_fault_handler_t handler, void *token);
|
||||||
extern void iommu_trigger_fault(struct iommu_domain *domain);
|
extern void iommu_trigger_fault(struct iommu_domain *domain,
|
||||||
|
unsigned long flags);
|
||||||
|
|
||||||
extern int iommu_attach_group(struct iommu_domain *domain,
|
extern int iommu_attach_group(struct iommu_domain *domain,
|
||||||
struct iommu_group *group);
|
struct iommu_group *group);
|
||||||
|
@ -384,7 +385,8 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void iommu_trigger_fault(struct iommu_domain *domain)
|
static inline void iommu_trigger_fault(struct iommu_domain *domain,
|
||||||
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue