On 26 October 2012 14:09, Paolo Bonzini <pbonz...@redhat.com> wrote: > As soon as Avi's iommu patches go in, in fact, dma->as will just be as. > Even if as == NULL were to be outlawed and you'd be forced to write > get_address_space_memory(), taking the pain to create dummy DMAContexts > now is just not worth it.
Personally I think it's better not to permit NULL DMAContexts or AddressSpaces here, because they're kind of a hack (in the same way that the "system address space" is kind of a hack). In real hardware you probably aren't really doing dma to that address space but to some more local bus. dma_context_memory/address_space_memory are nice and easy to search for, whereas NULL isn't. [And in general I think NULL is too easy to use; if you have to go looking for the system dma context you've been prompted to think about whether that's the right one...] -- PMM