On Fri, Nov 06, 2015 at 01:45:29PM +0000, Peter Maydell wrote: > On 6 November 2015 at 13:34, Edgar E. Iglesias <edgar.igles...@gmail.com> > wrote: > > On Thu, Nov 05, 2015 at 06:15:46PM +0000, Peter Maydell wrote: > >> Add the address space index to CPUIOTLBEntry, and use this to pass it > >> to iotlb_to_region(), so that we use the correct AddressSpace when > >> doing IO path lookups. > > > > Hi Peter, > > > > I think this works but eventually when we add support for CPUs behind > > IOMMUs I think things will be easier if we store a pointer to the > > AS instead of an index in the IOTLB. address_space_translate_for_iotlb() > > with IOMMU support may be implemented so that it returns a different > > address space as it walks tha memory hierarchy and translate things. > > > > Do you see any issues with storing pointers to the AS instead of an > > index? > > Yeah, we can't deal with arbitrary AddressSpaces here. We need a > CPUAddressSpace, because we use the cached RCU-protected memory_dispatch > pointer. Once you know that you have to be dealing with one of the fixed > CPUAddressSpaces, then you might as well just keep the index rather than > an arbitrary pointer.
OK, I think we'll have to have another look once we do the IOMMU stuff. My view has probably been to simplistic. Best regards, Edgar