Re: [Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-21 Thread Paolo Bonzini
On 21/12/2016 17:19, Fam Zheng wrote: > It's clever! It'd be a bit more complicated than that, though. Things like > queues etc in block/nvme.c have to be preserved, and if we already ensure > that, > ram blocks can be preserved similarly, but indeed bounce buffers can be > handled > that way.

Re: [Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-21 Thread Fam Zheng
On Wed, 12/21 16:46, Paolo Bonzini wrote: > > > On 20/12/2016 17:31, Fam Zheng wrote: > > +hbitmap_iter_init(, s->free_chunks, 1); > > +if (contiguous) { > > +while (true) { > > +bool satisfy = true; > > +next = hbitmap_iter_next(); > > +if

[Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-20 Thread Fam Zheng
This is a simple helper library to be used by VFIO device drivers in QEMU, makeing it very easy to interface with /dev/vfio and do DMA mappings. Especially, once initialized, this module proactively maps all guest ram regions to IO address space (in the host IOMMU context) so that in further I/O