[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703123146-mutt-send-email-mst@kernel.org>
Date: Wed, 3 Jul 2024 12:32:06 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Jason Gunthorpe <jgg@...pe.ca>,
Kevin Tian <kevin.tian@...el.com>, Yi Liu <yi.l.liu@...el.com>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Kalle Valo <kvalo@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Alex Williamson <alex.williamson@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Mikko Perttunen <mperttunen@...dia.com>,
Jeff Johnson <quic_jjohnson@...cinc.com>,
ath10k@...ts.infradead.org, ath11k@...ts.infradead.org,
iommu@...ts.linux.dev, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 04/21] vhost-vdpa: Use iommu_paging_domain_alloc()
On Mon, Jun 10, 2024 at 04:55:38PM +0800, Lu Baolu wrote:
> Replace iommu_domain_alloc() with iommu_paging_domain_alloc().
>
> Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
Acked-by: Michael S. Tsirkin <mst@...hat.com>
I assume it's merged with the rest of the stuff, right?
> ---
> drivers/vhost/vdpa.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 63a53680a85c..e31ec9ebc4ce 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -1312,26 +1312,24 @@ static int vhost_vdpa_alloc_domain(struct vhost_vdpa *v)
> struct vdpa_device *vdpa = v->vdpa;
> const struct vdpa_config_ops *ops = vdpa->config;
> struct device *dma_dev = vdpa_get_dma_dev(vdpa);
> - const struct bus_type *bus;
> int ret;
>
> /* Device want to do DMA by itself */
> if (ops->set_map || ops->dma_map)
> return 0;
>
> - bus = dma_dev->bus;
> - if (!bus)
> - return -EFAULT;
> -
> if (!device_iommu_capable(dma_dev, IOMMU_CAP_CACHE_COHERENCY)) {
> dev_warn_once(&v->dev,
> "Failed to allocate domain, device is not IOMMU cache coherent capable\n");
> return -ENOTSUPP;
> }
>
> - v->domain = iommu_domain_alloc(bus);
> - if (!v->domain)
> - return -EIO;
> + v->domain = iommu_paging_domain_alloc(dma_dev);
> + if (IS_ERR(v->domain)) {
> + ret = PTR_ERR(v->domain);
> + v->domain = NULL;
> + return ret;
> + }
>
> ret = iommu_attach_device(v->domain, dma_dev);
> if (ret)
> --
> 2.34.1
Powered by blists - more mailing lists