linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: sstabellini@kernel.org, boris.ostrovsky@oracle.com,
	jgross@suse.com, konrad.wilk@oracle.com, jasowang@redhat.com,
	x86@kernel.org, xen-devel@lists.xenproject.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	virtualization@lists.linux-foundation.org, linux-imx@nxp.com
Subject: Re: [PATCH] xen: introduce xen_vring_use_dma
Date: Wed, 24 Jun 2020 05:06:48 -0400	[thread overview]
Message-ID: <20200624050355-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200624091732.23944-1-peng.fan@nxp.com>

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@nxp.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


  reply	other threads:[~2020-06-24  9:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  9:17 [PATCH] xen: introduce xen_vring_use_dma Peng Fan
2020-06-24  9:06 ` Michael S. Tsirkin [this message]
2020-06-24 17:59   ` Stefano Stabellini
2020-06-24 20:47     ` Michael S. Tsirkin
2020-06-24 21:53       ` Stefano Stabellini
2020-06-24 22:16         ` Michael S. Tsirkin
2020-06-25 17:31           ` Stefano Stabellini
2020-06-26 15:32             ` Michael S. Tsirkin
2020-06-29  3:05               ` Peng Fan
2020-06-29  6:21                 ` Michael S. Tsirkin
2020-06-29  6:25                   ` Peng Fan
2020-06-29  6:33                     ` Michael S. Tsirkin
2020-06-29  6:35                       ` Peng Fan
2020-06-29 23:49                 ` Stefano Stabellini
2020-06-30  1:40                   ` Peng Fan
2020-06-29 23:46               ` Stefano Stabellini
2020-07-01 13:34                 ` Christoph Hellwig
2020-07-01 17:34                   ` Stefano Stabellini
2020-07-01 20:47                     ` Michael S. Tsirkin
2020-07-01 21:23                     ` Michael S. Tsirkin
2020-07-10 17:23                       ` Stefano Stabellini
2020-07-11 18:44                         ` Michael S. Tsirkin
2020-07-15 17:06                           ` Stefano Stabellini
2020-07-13  1:53                         ` Peng Fan
2020-06-29  3:00             ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200624050355-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jasowang@redhat.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=sstabellini@kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).