pci: introduce a bus master container
commit3716d5902d743e9a395b7d82f48df4fa56ed1ad3
authorJason Wang <jasowang@redhat.com>
Mon, 13 Mar 2017 03:29:58 +0000 (13 11:29 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 15 Mar 2017 17:37:19 +0000 (15 19:37 +0200)
tree429fdbf003372857ba522d7034b0745a4d9d1e7e
parente45da653223869849877ee8f4b86f511f891d4f8
pci: introduce a bus master container

96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring
translations") tries to make IOMMU works with virtio memory region
cache, but it requires IOMMU to be created before any virtio
devices. This is sub optimal, fixing this by introduce a bus master
container to make sure address space can be initialized during device
registering, and then we can safely set alias and make
bus_master_enable_region as its subregion during bus master
initialization.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c
include/hw/pci/pci.h