[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624050355-mutt-send-email-mst@kernel.org>
Date: Wed, 24 Jun 2020 05:06:48 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Peng Fan <peng.fan@....com>
Cc: sstabellini@...nel.org, boris.ostrovsky@...cle.com,
jgross@...e.com, konrad.wilk@...cle.com, jasowang@...hat.com,
x86@...nel.org, xen-devel@...ts.xenproject.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
iommu@...ts.linux-foundation.org,
virtualization@...ts.linux-foundation.org, linux-imx@....com
Subject: Re: [PATCH] xen: introduce xen_vring_use_dma
On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote:
> Export xen_swiotlb for all platforms using xen swiotlb
>
> Use xen_swiotlb to determine when vring should use dma APIs to map the
> ring: when xen_swiotlb is enabled the dma API is required. When it is
> disabled, it is not required.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
Isn't there some way to use VIRTIO_F_IOMMU_PLATFORM for this?
Xen was there first, but everyone else is using that now.
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index a2de775801af..768afd79f67a 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -252,7 +252,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev)
> * the DMA API if we're a Xen guest, which at least allows
> * all of the sensible Xen configurations to work correctly.
> */
> - if (xen_domain())
> + if (xen_vring_use_dma())
> return true;
>
> return false;
The comment above this should probably be fixed.
--
MST
Powered by blists - more mailing lists