[Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-03-21 Thread David Gibson
Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qemu 1.0, I made a star

Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-03-09 Thread Paolo Bonzini
Il 09/03/2012 12:19, David Gibson ha scritto: >> > >> > This is opposite to the convention of dma_buf_read/dma_buf_write, which >> > is from the point of view of the device. > Uh, these are from the point of view of the device - the device writes > to memory == transfer from device. Right, dma_bu

Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-03-09 Thread David Gibson
On Fri, Mar 09, 2012 at 11:06:41AM +0100, Paolo Bonzini wrote: > Il 09/03/2012 06:01, David Gibson ha scritto: > > +static inline int dma_memory_read(DMAContext *dma, dma_addr_t addr, > > + void *buf, dma_addr_t len) > > +{ > > +return dma_memory_rw(dma, addr, b

Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-03-09 Thread Paolo Bonzini
Il 09/03/2012 06:01, David Gibson ha scritto: > +static inline int dma_memory_read(DMAContext *dma, dma_addr_t addr, > + void *buf, dma_addr_t len) > +{ > +return dma_memory_rw(dma, addr, buf, len, DMA_DIRECTION_TO_DEVICE); > +} > + > +static inline int dma_memo

[Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-03-08 Thread David Gibson
Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qemu 1.0, I made a star

[Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions

2012-02-29 Thread David Gibson
Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qemu 1.0, I made a star