On Tue, Mar 07, 2017 at 05:09:11PM +0800, Jason Wang wrote: > After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU > after caching ring translations"), IOMMU was required to be created in > advance. This is because we can only get the correct dma_as after pci > IOMMU (e.g intel_iommu) was initialized. This is suboptimal and > inconvenient for user. This patch releases this by: > > - introduce a bus_master_ready method for PCIDeviceClass and trigger > this during pci_init_bus_master > - implement virtio-pci method and 1) reset the dma_as 2) re-register > the memory listener to the new dma_as > > Cc: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: Jason Wang <jasow...@redhat.com>
Reviewed-by: Peter Xu <pet...@redhat.com>