Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-26 Thread Kevin Wolf
Am 25.02.2016 um 11:10 hat Alex Pyrgiotis geschrieben: > > I think the first step is understanding what to do about the weird "& > > ~BDRV_SECTOR_MASK" case, then. > > We can discuss about this case in the "dma-helpers: Do not truncate > small qiovs" thread. I'm all for the removal of this check,

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Paolo Bonzini
On 25/02/2016 12:19, Alex Pyrgiotis wrote: >> The patch could first introduce address_space_map_direct that never uses >> the bounce buffer. dma-helpers.c can call address_space_map_direct and, >> if it fails, proceed to allocate (and fill if writing to the device) a >> bounce buffer. > > You m

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Alex Pyrgiotis
Hi Paolo, On 02/25/2016 12:22 PM, Paolo Bonzini wrote: > > > On 25/02/2016 11:10, Alex Pyrgiotis wrote: >> 8<... snip ...>8 >> >> Sure, you're right, there's no sensible way to break an ioctl() >> operation in many. However, I'd argue that we shouldn't need to, as it >> would be much better if t

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Paolo Bonzini
On 25/02/2016 11:10, Alex Pyrgiotis wrote: > All normal regions in a QEMUSGList point to an address range in the > guest's RAM. The MMIO regions of QEMU's virtual devices, however, do not > correspond to such an address range, so QEMU must create a bounce buffer > to represent them. This bounce b

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-25 Thread Alex Pyrgiotis
Hi Paolo, Thanks a lot for your clarifications. See my comments inline: (tl;dr: I suggest we reconsider Fam Zheng's attempt to remove the global bounce buffer, which would make dma-helpers simpler and unblock this patch) On 02/22/2016 12:43 PM, Paolo Bonzini wrote: > > > On 19/02/2016 12:50, A

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-22 Thread Paolo Bonzini
On 19/02/2016 12:50, Alex Pyrgiotis wrote: > QEMU/Hardware space: > 5. The SCSI controller code will create a QEMUSGList that points to >the memory regions of the SCSI request. This QEMUSGList will also >include the MMIO regions. > 6. The QEMU device implementation, e.g. scsi-block, choos

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-19 Thread Alex Pyrgiotis
Hi Paolo, Sorry for the late reply and thanks for the review. See my comments inline: On 02/11/2016 01:17 PM, Paolo Bonzini wrote: > > > On 16/12/2015 17:55, Alex Pyrgiotis wrote: >> +/* >> + * Create a QEMUIOVector from a scatter-gather list. >> + * >> + * This function does not copy the data

Re: [Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2016-02-11 Thread Paolo Bonzini
On 16/12/2015 17:55, Alex Pyrgiotis wrote: > +/* > + * Create a QEMUIOVector from a scatter-gather list. > + * > + * This function does not copy the data of the scatter-gather list. Instead, > it > + * uses the dma_memory_map() function to map physical memory regions of the > + * virtual device

[Qemu-devel] [PATCH 1/9] dma-helpers: Expose the sg mapping logic

2015-12-16 Thread Alex Pyrgiotis
The mapping of scatter-gather lists from physical addresses (as perceived by the guest kernel) to the virtual address space of the QEMU process is a vital step for a DMA operation. This step is currently implemented, amongst other things, in dma_blk_cb(), making it impossible to be used by anyone e