qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write
Date: Thu, 11 Aug 2011 14:10:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/11/2011 09:58 AM, Stefan Hajnoczi wrote:
On Thu, Aug 04, 2011 at 07:14:43PM +0200, Paolo Bonzini wrote:
These helpers do a full transfer from an in-memory buffer to
target memory, with full support for MMIO areas.  It will be used to store
the reply of an emulated command into a QEMUSGList provided by the
adapter.

Signed-off-by: Paolo Bonzini<address@hidden>
---
  cutils.c      |    8 +++---
  dma-helpers.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  dma.h         |    5 ++++
  3 files changed, 72 insertions(+), 4 deletions(-)

I don't understand this patch.  If we have a memory buffer that needs to
be transferred to target memory, then there is no need for bounce
buffers or cpu_physical_memory_map().

Can we use cpu_physical_memory_rw() on each sglist element instead?  No
-EAGAIN necessary because the memory buffer already acts as the local
bounce buffer.

Doh, you're obviously right.  I don't know what I was thinking. :)

What do you think about passing the residual bytes for short transfers? Should I look into updating BlockDriverCompletionFunc, or is the approach of patch 2 okay? If I have an excuse to learn more about Coccinelle, that can be fun. :)

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]