virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory
@ 2016-12-06 18:21 Wendy Liang
  2016-12-08  3:18 ` Jason Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Wendy Liang @ 2016-12-06 18:21 UTC (permalink / raw)
  To: ohad, bjorn.andersson, linux-remoteproc, mst, jasowang,
	virtualization
  Cc: Wendy Liang

RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote.
In this case, as there is no pages setup in the dma_alloc_coherent(),
we cannot get the physical address back from the virtual address, and thus,
we can set the sg_dma_addr to store the DMA address and mark it already DMA
mapped.

When virtio vring sees the sg_dma_addr is ready set, do not call dma_map_page().

The issue was once discussed here:
http://virtualization.linux-foundation.narkive.com/CfVP32Vy/rfc-0-4-rpmsg-fix-init-of-dma-able-virtqueues

Edgar E. Iglesias (1):
  rpmsg: DMA map sgs passed to virtio

Wendy Liang (1):
  virtio_ring: Do not call dma_map_page if sg is already mapped.

 drivers/rpmsg/virtio_rpmsg_bus.c | 22 +++++++++++++++++++---
 drivers/virtio/virtio_ring.c     |  6 ++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory
@ 2016-12-06 18:08 Wendy Liang
  0 siblings, 0 replies; 5+ messages in thread
From: Wendy Liang @ 2016-12-06 18:08 UTC (permalink / raw)
  To: ohad, bjorn.andersson, linux-remoteproc, mst, jasowang,
	virtualization
  Cc: Wendy Liang

RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote.
In this case, as there is no pages setup in the dma_alloc_coherent(),
we cannot get the physical address back from the virtual address, and thus,
we can set the sg_dma_addr to store the DMA address and mark it already DMA
mapped.

When virtio vring sees the sg_dma_addr is ready set, do not call dma_map_page().

The issue was once discussed here:
http://virtualization.linux-foundation.narkive.com/CfVP32Vy/rfc-0-4-rpmsg-fix-init-of-dma-able-virtqueues

Edgar E. Iglesias (1):
  rpmsg: DMA map sgs passed to virtio

Wendy Liang (1):
  virtio_ring: Do not call dma_map_page if sg is already mapped.

 drivers/rpmsg/virtio_rpmsg_bus.c | 22 +++++++++++++++++++---
 drivers/virtio/virtio_ring.c     |  6 ++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory
@ 2016-11-22  0:32 Wendy Liang
  0 siblings, 0 replies; 5+ messages in thread
From: Wendy Liang @ 2016-11-22  0:32 UTC (permalink / raw)
  To: virtualization, edgari, cyrilc; +Cc: Wendy Liang

RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote.
In this case, as there is no pages setup in the dma_alloc_coherent(),
we cannot get the physical address back from the virtual address, and thus,
we can set the sg_dma_addr to store the DMA address and mark it already DMA
mapped.

When virtio vring sees the sg_dma_addr is ready set, do not call dma_map_page().

The issue was once discussed here:
http://virtualization.linux-foundation.narkive.com/CfVP32Vy/rfc-0-4-rpmsg-fix-init-of-dma-able-virtqueues

Edgar E. Iglesias (1):
  rpmsg: DMA map sgs passed to virtio

Wendy Liang (1):
  virtio_ring: Do not call dma_map_page if sg is already mapped.

 drivers/rpmsg/virtio_rpmsg_bus.c | 22 +++++++++++++++++++---
 drivers/virtio/virtio_ring.c     |  6 ++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-08  5:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 18:21 [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory Wendy Liang
2016-12-08  3:18 ` Jason Wang
2016-12-08  5:57   ` Jiaying Liang
  -- strict thread matches above, loose matches on Subject: below --
2016-12-06 18:08 Wendy Liang
2016-11-22  0:32 Wendy Liang

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).