On Tue, Sep 05, 2023 at 09:38:39AM +0200, Mattias Nissler wrote: > It would be nice to use a property on the device that originates the > DMA operation to configure this. However, I don't see how to do this > in a reasonable way without bigger changes: A typical call path is > pci_dma_map -> dma_memory_map -> address_space_map. While pci_dma_map > has a PCIDevice*, address_space_map only receives the AddressSpace*. > So, we'd probably have to pass through a new QObject parameter to > address_space_map that indicates the originator and pass that through? > Or is there a better alternative to supply context information to > address_space map? Let me know if any of these approaches sound > appropriate and I'll be happy to explore them further.
Should be possible to do. The pci address space is not shared but per-device by default (even if there is no vIOMMU intervention). See do_pci_register_device(): address_space_init(&pci_dev->bus_master_as, &pci_dev->bus_master_container_region, pci_dev->name); Thanks, -- Peter Xu