On 09/01/2011 09:25 PM, Anthony Liguori wrote:
> I think this is the wrong approach given the introduction of the memory API.
> 
> I think we should have a generic memory access function that takes a 
> MemoryRegion as it's first argument.
> 
> The PCI bus should then expose one memory region for each device (that's how 
> it can figure out where the access is coming from).

A MemoryRegion is the wrong abstraction for the device's view back into system 
memory.
The new memory API really has nothing to do with DMA or an IOMMU.  Think about 
it:
99.999% of the time we're writing to the one MemoryRegion that is RAM (with the 
other
remaining fraction being pci-pci dma tricks), except in a non-contiguous manner.
Obviously we need something else to represent the non-contiguous-ness.

I suppose you could abuse Avi's AddressSpace, with hundreds of MemoryRegion 
aliases,
but that would be a horrible interface to actually use in this situation.

I think David's patch is fine, as far as it goes for the majority of the 
PCI-only 
devices that we emulate.  As for the devices attached to more than one bus, 
they'll
just have to wait until we actually hash out the underlying dma api.


r~

Reply via email to