Displaying 2 results from an estimated 2 matches for "vhost_iotlb_add_range_ctx".
2023 Jan 24
0
[RFC PATCH 02/19] drivers/vhost: Convert to use vm_account
...80,6 +780,10 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
> u32 asid = iotlb_to_asid(iotlb);
> int r = 0;
>
> + if (!vdpa->use_va)
> + if (vm_account_pinned(&dev->vm_account, PFN_DOWN(size)))
> + return -ENOMEM;
> +
> r = vhost_iotlb_add_range_ctx(iotlb, iova, iova + size - 1,
> pa, perm, opaque);
> if (r)
I suspect some error handling will have to be reworked then, no?
> --
> git-series 0.9.1
2023 Feb 16
0
[PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI
...n *region;
> + int ret = 0;
> + bool with_sw_msi = false;
> + bool with_hw_msi = false;
> +
> + INIT_LIST_HEAD(&dev_resv_regions);
> + iommu_get_resv_regions(dma_dev, &dev_resv_regions);
> +
> + list_for_each_entry(region, &dev_resv_regions, list) {
> + ret = vhost_iotlb_add_range_ctx(resv_iotlb, region->start,
> + region->start + region->length - 1,
> + 0, 0, NULL);
> + if (ret) {
> + vhost_iotlb_reset(resv_iotlb);
> + break;
> + }
> +
> + if (region->type == IOMMU_RESV_MSI)
> + with_hw_msi = true;
> +
> + if (region-...