Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-29 Thread Peng Fan
kernel.org; linux-ker...@vger.kernel.org; > virtualizat...@lists.linux-foundation.org; l...@kernel.org; jgr...@suse.com; > boris.ostrov...@oracle.com; Andy Duan > Subject: Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain > > On Fri, Jan 25, 2019 at 09:45:26AM +, Peng

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-28 Thread h...@infradead.org
On Fri, Jan 25, 2019 at 09:45:26AM +, Peng Fan wrote: > Just have a question, > > Since vmalloc_to_page is ok for cma area, no need to take cma and per device > cma into consideration right? The CMA area itself it a physical memory region. If it is a non-highmem region you can call virt_to

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-25 Thread Stefano Stabellini
On Fri, 25 Jan 2019, Peng Fan wrote: > > On Wed, Jan 23, 2019 at 01:04:33PM -0800, Stefano Stabellini wrote: > > > If vring_use_dma_api is actually supposed to return true when > > > dma_dev->dma_mem is set, then both Peng's patch and the patch I wrote > > > are not fixing the real issue here. > >

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-25 Thread Peng Fan
kernel.org; linux-ker...@vger.kernel.org; > virtualizat...@lists.linux-foundation.org; l...@kernel.org; jgr...@suse.com; > boris.ostrov...@oracle.com > Subject: Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain > > On Wed, Jan 23, 2019 at 01:04:33PM -0800, Stefano Stabellin

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-24 Thread Michael S. Tsirkin
inux-foundation.org; > > > l...@kernel.org; jgr...@suse.com; boris.ostrov...@oracle.com; > > > bjorn.anders...@linaro.org; jli...@xilinx.com > > > Subject: Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain > > > > > > On Wed, 23 Jan 2019, h...@infrade

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-24 Thread Stefano Stabellini
at.com; jasow...@redhat.com; > > xen-devel@lists.xenproject.org; linux-remotep...@vger.kernel.org; > > linux-ker...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > > l...@kernel.org; jgr...@suse.com; boris.ostrov...@oracle.com; > > bjorn.anders...@linaro.org; jli..

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread Peng Fan
ep...@vger.kernel.org; > linux-ker...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > l...@kernel.org; jgr...@suse.com; boris.ostrov...@oracle.com; > bjorn.anders...@linaro.org; jli...@xilinx.com > Subject: Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_d

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread Peng Fan
kernel.org; linux-ker...@vger.kernel.org; > virtualizat...@lists.linux-foundation.org; l...@kernel.org; jgr...@suse.com; > boris.ostrov...@oracle.com > Subject: Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain > > On Mon, 21 Jan 2019, Peng Fan wrote: > > on i.MX

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread Stefano Stabellini
On Wed, 23 Jan 2019, h...@infradead.org wrote: > On Wed, Jan 23, 2019 at 01:04:33PM -0800, Stefano Stabellini wrote: > > If vring_use_dma_api is actually supposed to return true when > > dma_dev->dma_mem is set, then both Peng's patch and the patch I wrote > > are not fixing the real issue here. >

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread h...@infradead.org
On Wed, Jan 23, 2019 at 01:04:33PM -0800, Stefano Stabellini wrote: > If vring_use_dma_api is actually supposed to return true when > dma_dev->dma_mem is set, then both Peng's patch and the patch I wrote > are not fixing the real issue here. > > I don't know enough about remoteproc to know where t

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread Stefano Stabellini
On Tue, 22 Jan 2019, h...@infradead.org wrote: > 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) > > >*

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-22 Thread h...@infradead.org
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

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-22 Thread Michael S. Tsirkin
On Tue, Jan 22, 2019 at 11:59:31AM -0800, Stefano Stabellini wrote: > On Mon, 21 Jan 2019, Peng Fan wrote: > > on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed > > address as the dma mem buffer which is predefined. > > > > Without this patch, the flow is: > > vring_map_one_sg -

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-22 Thread Stefano Stabellini
On Mon, 21 Jan 2019, Peng Fan wrote: > on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed > address as the dma mem buffer which is predefined. > > Without this patch, the flow is: > vring_map_one_sg -> vring_use_dma_api > -> dma_map_page > ->

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-21 Thread Michael S. Tsirkin
On Mon, Jan 21, 2019 at 12:28:30AM -0800, h...@infradead.org wrote: > On Mon, Jan 21, 2019 at 04:51:57AM +, Peng Fan wrote: > > on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed > > address as the dma mem buffer which is predefined. > > > > Without this patch, the flow is: >

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-21 Thread Peng Fan
Hi > -Original Message- > From: h...@infradead.org [mailto:h...@infradead.org] > Sent: 2019年1月21日 16:29 > To: Peng Fan > Cc: m...@redhat.com; jasow...@redhat.com; sstabell...@kernel.org; > h...@infradead.org; virtualizat...@lists.linux-foundation.org; > xen-devel@lists.xenproject.org; lin

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-21 Thread h...@infradead.org
On Mon, Jan 21, 2019 at 04:51:57AM +, Peng Fan wrote: > on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed > address as the dma mem buffer which is predefined. > > Without this patch, the flow is: > vring_map_one_sg -> vring_use_dma_api > -> dma_map_page >

[Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-20 Thread Peng Fan
on i.MX8QM, M4_1 is communicating with DomU using rpmsg with a fixed address as the dma mem buffer which is predefined. Without this patch, the flow is: vring_map_one_sg -> vring_use_dma_api -> dma_map_page -> __swiotlb_map_page