Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-25 Thread Paolo Bonzini
On 25/05/2016 11:13, Mark Cave-Ayland wrote: > Great - as long as you're aware of this I'll wait for the next version > of the patchset to come out, and then at least I can re-run the macio > installation test to ensure that there are no further corruption issues > with unaligned DMA accesses.

Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-25 Thread Mark Cave-Ayland
On 25/05/16 09:45, Paolo Bonzini wrote: > On 25/05/2016 00:59, Mark Cave-Ayland wrote: >> I eventually traced the corruption down to this section of code in >> dma_blk_cb() which was incorrectly truncating the unaligned iovecs: >> >> if (dbs->iov.size & ~BDRV_SECTOR_MASK) { >>

Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-25 Thread Paolo Bonzini
On 25/05/2016 00:59, Mark Cave-Ayland wrote: > I eventually traced the corruption down to this section of code in > dma_blk_cb() which was incorrectly truncating the unaligned iovecs: > > if (dbs->iov.size & ~BDRV_SECTOR_MASK) { > qemu_iovec_discard_back(>iov, dbs->iov.size & >

Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-24 Thread Mark Cave-Ayland
On 23/05/16 20:36, Mark Cave-Ayland wrote: > On 23/05/16 13:54, Paolo Bonzini wrote: > >> scsi-block uses the block layer for reads and writes in order to avoid >> allocating bounce buffers as big as the transferred data. We know how >> to split a large transfer to multiple reads and writes,

Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-23 Thread Mark Cave-Ayland
On 23/05/16 13:54, Paolo Bonzini wrote: > scsi-block uses the block layer for reads and writes in order to avoid > allocating bounce buffers as big as the transferred data. We know how > to split a large transfer to multiple reads and writes, and thus we can > use scsi-disk.c's existing code to

[Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-23 Thread Paolo Bonzini
scsi-block uses the block layer for reads and writes in order to avoid allocating bounce buffers as big as the transferred data. We know how to split a large transfer to multiple reads and writes, and thus we can use scsi-disk.c's existing code to do I/O in multiple chunks (for non-s/g SCSI