On Fri, 28 Mar 2014 17:43:07 +0000 Peter Maydell <peter.mayd...@linaro.org> wrote:
> On 28 March 2014 17:37, Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > And while we are at it, since we pass &address_space_memory to all > > occurences of virtio_*_phys() and I don't see why we would change > > that, maybe we can also move that into the helpers. Thoughts ? > > In the longer term I'm hoping that references to > &address_space_memory go away -- we should be modelling > separate address spaces per CPU and per every other > thing that can act as a DMA master (ie issue memory > transactions). I'm not sure exactly how virtio ought to > work since these accesses directly to memory are a total > hack, but probably we will end up setting the virtio > device up and handing it an AddressSpace* that it should use. > Ok, I am now convinced. Let's make struct VirtIODevice* be the first argument for all helpers and kill the AddressSpace* one. Unless you envision we could end up with different address spaces accross multiple virtio devices, I would then do as proposed above... Even if we add an AddressSpace* to devices, the API will remain the same. > thanks > -- PMM > Cheers. -- Gregory Kurz kurzg...@fr.ibm.com gk...@linux.vnet.ibm.com Software Engineer @ IBM/Meiosys http://www.ibm.com Tel +33 (0)562 165 496 "Anarchy is about taking complete responsibility for yourself." Alan Moore.