return ret;
}
+static int iommu_flush_device(struct device *dev)
+{
+ struct amd_iommu *iommu;
+ u16 devid;
+
+ devid = get_device_id(dev);
+ iommu = amd_iommu_rlookup_table[devid];
+
+ return iommu_queue_inv_dev_entry(iommu, devid);
+}
+
static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
u16 domid, int pde, int s)
{
domain->dev_cnt += 1;
/* Flush the DTE entry */
- iommu_queue_inv_dev_entry(iommu, devid);
+ iommu_flush_device(dev);
}
static void do_detach(struct device *dev)
clear_dte_entry(devid);
/* Flush the DTE entry */
- iommu_queue_inv_dev_entry(iommu, devid);
+ iommu_flush_device(dev);
}
/*
goto out;
}
- iommu_queue_inv_dev_entry(iommu, devid);
+ iommu_flush_device(dev);
iommu_completion_wait(iommu);
out:
if (!iommu)
return;
- iommu_queue_inv_dev_entry(iommu, devid);
+ iommu_flush_device(dev);
iommu_completion_wait(iommu);
}