xemu/hw/s390x
Yi Min Zhao f0a399dbae s390x/pci: fix up IOMMU size
Present code uses @size==UINT64_MAX to initialize IOMMU. It infers that it
can map any 64-bit IOVA whatsoever. But in fact, the largest DMA range for
each PCI Device on s390x is from ZPCI_SDMA_ADDR to ZPCI_EDMA_ADDR. The largest
value is returned from hardware, which is to indicate the largest range
hardware can support. But the real IOMMU size for specific PCI Device is
obtained once qemu intercepts mpcifc instruction that guest is requesting a
DMA range for that PCI Device. Therefore, before intercepting mpcifc instruction,
qemu cannot be aware of the size of IOMMU region that guest will use.

Moreover, iommu replay during device initialization for the whole region in
4k steps takes a very long time.

In conclusion, this patch intializes IOMMU region for each PCI Device when
intercept mpcifc instruction which is to register DMA range for the PCI Device.
And then, destroy IOMMU region when guest wants to deregister IOAT.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-12-01 09:57:28 +01:00
..
css.c s390x/css: sense data endianness 2015-11-11 17:21:38 +01:00
css.h s390x/css: Add a callback for when subchannel gets disabled 2015-06-30 09:34:58 +02:00
event-facility.c s390x: set missing parent for hotplug and quiesce events 2015-10-02 13:31:52 +02:00
ipl.c s390x/ipl: switch error reporting to error_setg 2015-11-11 17:21:39 +01:00
ipl.h s390x/ipl: clean up qom definitions and turn into TYPE_DEVICE 2015-11-11 17:21:39 +01:00
Makefile.objs s390x: Create QOM device for s390 storage keys 2015-09-03 12:17:54 +02:00
s390-pci-bus.c s390x/pci: fix up IOMMU size 2015-12-01 09:57:28 +01:00
s390-pci-bus.h s390x/pci: fix up IOMMU size 2015-12-01 09:57:28 +01:00
s390-pci-inst.c s390x/pci: fix up IOMMU size 2015-12-01 09:57:28 +01:00
s390-pci-inst.h s390x/kvm: Support access register mode for KVM_S390_MEM_OP ioctl 2015-04-30 13:21:42 +02:00
s390-skeys-kvm.c s390x: Create QOM device for s390 storage keys 2015-09-03 12:17:54 +02:00
s390-skeys.c s390x: Disable storage key migration on old machine type 2015-09-03 12:17:54 +02:00
s390-virtio-bus.c hw/s390x/s390-virtio-bus: Remove meaningless blank Property 2015-09-11 10:59:47 +03:00
s390-virtio-bus.h virtio: move host_features 2015-05-31 16:27:18 +02:00
s390-virtio-ccw.c s390x: switch to memory_region_allocate_system_memory 2015-11-11 17:21:39 +01:00
s390-virtio-hcall.c s390x/virtio-hcall: Specification exception for illegal subcodes 2014-02-27 09:51:25 +01:00
s390-virtio.c s390x: no deprecation warning while testing 2015-12-01 09:57:27 +01:00
s390-virtio.h s390x: machine reset function with new ipl cpu handling 2015-10-21 12:21:30 +02:00
sclp.c Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
sclpcpu.c s390/sclp: replace sclp event types with proper defines 2015-09-07 16:10:43 +02:00
sclpquiesce.c s390/sclp: replace sclp event types with proper defines 2015-09-07 16:10:43 +02:00
virtio-ccw.c virtio-ccw: enable virtio-1 2015-09-24 13:42:17 +03:00
virtio-ccw.h virtio-ccw: enable virtio-1 2015-09-24 13:42:17 +03:00