@@ -58,6 +58,7 @@ struct viommu_dev {
struct list_head endpoints;
struct workqueue_struct *pri_wq;
struct viommu_dev_pri_work *pri_work;
+ struct iopf_queue *iopf_pri;
/* Device configuration */
struct iommu_domain_geometry geometry;
@@ -581,6 +582,15 @@ static int viommu_add_pstf(struct viommu_endpoint *vdev, void *pstf, size_t len)
return 0;
}
+static int viommu_init_queues(struct viommu_dev *viommu)
+{
+ viommu->iopf_pri = iopf_queue_alloc(dev_name(viommu->dev));
+ if (!viommu->iopf_pri)
+ return -ENOMEM;
+
+ return 0;
+}
+
static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev)
{
int ret;
@@ -670,6 +680,15 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev)
list_add(&ep->list, &viommu->endpoints);
+ ret = viommu_init_queues(viommu);
+ if (ret)
+ goto out_free_eps;
+
+ kfree(probe);
+ return 0;
+
+out_free_eps:
+ kfree(ep);
out_free:
kfree(probe);
return ret;
Add a io page fault queue to the driver so that it can be used to redirect faults to the handler. Signed-off-by: Vivek Gautam <vivek.gautam@arm.com> --- drivers/iommu/virtio-iommu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)