qemu/hw/virtio
Jason Wang 96a8821d21 virtio: unbreak virtio-pci with IOMMU after caching ring translations
Commit c611c76417 ("virtio: add MemoryListener to cache ring
translations") registers a memory listener to dma_as. This may not
work when IOMMU is enabled: dma_as(bus_master_as) were initialized in
pcibus_machine_done() after virtio_realize(). This will cause a
segfault. Fixing this by using pci_device_iommu_address_space()
instead to make sure address space were initialized at this time.

With this fix, IOMMU device were required to be initialized before any
virtio-pci devices.

Fixes: c611c76417 ("virtio: add MemoryListener to cache ring translations")
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-03-02 07:14:28 +02:00
..
Makefile.objs stubs: move vhost stubs to stubs/vhost.o 2017-01-16 17:52:35 +01:00
trace-events balloon: Don't balloon roms 2017-01-10 07:02:52 +02:00
vhost-backend.c vhost_net: device IOTLB support 2017-01-18 22:59:53 +02:00
vhost-stub.c stubs: move vhost stubs to stubs/vhost.o 2017-01-16 17:52:35 +01:00
vhost-user.c vhost-user: Add MTU protocol feature and op 2017-01-10 07:02:53 +02:00
vhost-vsock.c virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
vhost.c vhost: skip ROM sections 2017-02-01 03:37:18 +02:00
virtio-balloon.c balloon: Don't balloon roms 2017-01-10 07:02:52 +02:00
virtio-bus.c virtio: force VIRTIO_F_IOMMU_PLATFORM 2017-01-19 23:00:31 +02:00
virtio-crypto-pci.c virtio-crypto-pci: tag virtio-crypto device hot pluggable 2017-01-10 07:02:52 +02:00
virtio-crypto.c hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
virtio-mmio.c virtio-mmio: switch to linux headers 2017-01-18 22:59:53 +02:00
virtio-pci.c virtio: unbreak virtio-pci with IOMMU after caching ring translations 2017-03-02 07:14:28 +02:00
virtio-pci.h virtio-pci: address space translation service (ATS) support 2017-01-10 05:56:59 +02:00
virtio-rng.c virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
virtio.c virtio: add missing region cache init in virtio_load() 2017-03-02 07:14:28 +02:00