Re: [Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API

2012-10-15 Thread Avi Kivity
On 10/13/2012 11:13 AM, Blue Swirl wrote: >> struct PCIBus { >> BusState qbus; >> -PCIDMAContextFunc dma_context_fn; >> -void *dma_context_opaque; >> +PCIIOMMUFunc iommu_fn; >> +PCIIOMMUDestructorFunc iommu_dtor_fn; >> +void *iommu_opaque; > > Maybe the opaque could be av

Re: [Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API

2012-10-13 Thread Blue Swirl
On Thu, Oct 11, 2012 at 1:27 PM, Avi Kivity wrote: > Instead of requesting a DMAContext from the bus implementation, use a > MemoryRegion. This can be initialized using memory_region_init_iommu() > (or memory_region_init_alias() for simple, static translations). > > Add a destructor, since setups

Re: [Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API

2012-10-11 Thread Avi Kivity
On 10/11/2012 03:53 PM, Paolo Bonzini wrote: > Il 11/10/2012 15:27, Avi Kivity ha scritto: >> -static int spapr_tce_translate(DMAContext *dma, >> - dma_addr_t addr, >> - target_phys_addr_t *paddr, >> - target_

Re: [Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API

2012-10-11 Thread Paolo Bonzini
Il 11/10/2012 15:27, Avi Kivity ha scritto: > -static int spapr_tce_translate(DMAContext *dma, > - dma_addr_t addr, > - target_phys_addr_t *paddr, > - target_phys_addr_t *len, > -

[Qemu-devel] [RFC v1 4/7] pci: switch iommu to using the memory API

2012-10-11 Thread Avi Kivity
Instead of requesting a DMAContext from the bus implementation, use a MemoryRegion. This can be initialized using memory_region_init_iommu() (or memory_region_init_alias() for simple, static translations). Add a destructor, since setups that have per-device translations will need to return a diff