[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models

From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA
Date: Sat, 03 Sep 2011 06:46:46 +0530
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110817 Fedora/3.1.12-1.fc14 Thunderbird/3.1.12

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 
The new memory API really has nothing to do with DMA or an IOMMU.  Think about 
99.999% of the time we're writing to the one MemoryRegion that is RAM (with the 
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 
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 
devices that we emulate.  As for the devices attached to more than one bus, 
just have to wait until we actually hash out the underlying dma api.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]