All of lore.kernel.org
 help / color / mirror / Atom feed
From: "hch@infradead.org" <hch@infradead.org>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: jgross@suse.com, Peng Fan <peng.fan@nxp.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"hch@infradead.org" <hch@infradead.org>,
	luto@kernel.org,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	boris.ostrovsky@oracle.com
Subject: Re: [RFC] virtio_ring: check dma_mem for xen_domain
Date: Tue, 22 Jan 2019 23:12:32 -0800	[thread overview]
Message-ID: <20190123071232.GA20526__45451.5500737884$1548227634$gmane$org@infradead.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1901221113410.17936@sstabellini-ThinkPad-X260>

On Tue, Jan 22, 2019 at 11:59:31AM -0800, Stefano Stabellini wrote:
> >  	if (!virtio_has_iommu_quirk(vdev))
> >  		return true;
> >  
> > @@ -260,7 +262,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_domain() && !dma_dev->dma_mem)
> >  		return true;
> >  
> >  	return false;
> 
> I can see you spotted a real issue, but this is not the right fix. We
> just need something a bit more flexible than xen_domain(): there are
> many kinds of Xen domains on different architectures, we basically want
> to enable this (return true from vring_use_dma_api) only when the xen
> swiotlb is meant to be used. Does the appended patch fix the issue you
> have?

The problem generally is the other way around - if dma_dev->dma_mem
is set the device decription in the device tree explicitly requires
using this memory, so we must _always_ use the DMA API.

The problem is just that that rproc driver absuses the DMA API
in horrible ways.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-01-23  7:12 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21  4:51 [RFC] virtio_ring: check dma_mem for xen_domain Peng Fan
2019-01-21  4:51 ` Peng Fan
2019-01-21  4:51 ` Peng Fan
2019-01-21  8:28 ` hch
2019-01-21  8:28 ` hch
2019-01-21  8:28   ` hch
2019-01-22  2:32   ` Peng Fan
2019-01-22  2:32   ` Peng Fan
2019-01-22  2:32     ` Peng Fan
2019-01-22  2:36   ` Michael S. Tsirkin
2019-01-22  2:36   ` Michael S. Tsirkin
2019-01-22  2:36     ` Michael S. Tsirkin
2019-01-22  2:36   ` Michael S. Tsirkin
2019-01-21  8:28 ` hch
2019-01-22 19:59 ` Stefano Stabellini
2019-01-22 19:59 ` [Xen-devel] " Stefano Stabellini
2019-01-22 19:59   ` Stefano Stabellini
2019-01-23  2:57   ` Michael S. Tsirkin
2019-01-23  2:57   ` Michael S. Tsirkin
2019-01-23  2:57   ` [Xen-devel] " Michael S. Tsirkin
2019-01-23  2:57     ` Michael S. Tsirkin
2019-01-23  7:12   ` hch
2019-01-23  7:12     ` hch
2019-01-23 21:04     ` Stefano Stabellini
2019-01-23 21:04     ` [Xen-devel] " Stefano Stabellini
2019-01-23 21:04       ` Stefano Stabellini
2019-01-23 21:14       ` hch
2019-01-23 21:14       ` hch
2019-01-23 21:14       ` [Xen-devel] " hch
2019-01-23 21:14         ` hch
2019-01-23 23:43         ` Stefano Stabellini
2019-01-23 23:43           ` Stefano Stabellini
2019-01-24  6:47           ` Peng Fan
2019-01-24  6:47           ` [Xen-devel] " Peng Fan
2019-01-24  6:47             ` Peng Fan
2019-01-24 19:14             ` Stefano Stabellini
2019-01-24 19:14             ` [Xen-devel] " Stefano Stabellini
2019-01-24 19:14               ` Stefano Stabellini
2019-01-24 20:34               ` Michael S. Tsirkin
2019-01-24 20:34               ` Michael S. Tsirkin
2019-01-24 20:34               ` [Xen-devel] " Michael S. Tsirkin
2019-01-24 20:34                 ` Michael S. Tsirkin
2019-01-23 23:43         ` Stefano Stabellini
2019-01-25  9:45         ` [Xen-devel] " Peng Fan
2019-01-25  9:45           ` Peng Fan
2019-01-25 19:18           ` Stefano Stabellini
2019-01-25 19:18           ` [Xen-devel] " Stefano Stabellini
2019-01-25 19:18             ` Stefano Stabellini
2019-01-28  8:00           ` hch
2019-01-28  8:00           ` [Xen-devel] " hch
2019-01-28  8:00             ` hch
2019-01-29  9:26             ` Peng Fan
2019-01-29  9:26             ` [Xen-devel] " Peng Fan
2019-01-29  9:26               ` Peng Fan
2019-01-28  8:00           ` hch
2019-01-25  9:45         ` Peng Fan
2019-01-23  7:12   ` [Xen-devel] " hch
2019-01-23  7:12   ` hch [this message]
2019-01-24  6:42   ` Peng Fan
2019-01-24  6:42   ` [Xen-devel] " Peng Fan
2019-01-24  6:42     ` 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='20190123071232.GA20526__45451.5500737884$1548227634$gmane$org@infradead.org' \
    --to=hch@infradead.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mst@redhat.com \
    --cc=peng.fan@nxp.com \
    --cc=sstabellini@kernel.org \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.