vmxnet3: Fix reading/writing guest memory specially when behind an IOMMU
commitc508277335e3b6b20cf18e6ea3a35c1fa835c64a
authorKarimAllah Ahmed <karahmed@amazon.de>
Mon, 20 Jun 2016 13:50:40 +0000 (20 15:50 +0200)
committerJason Wang <jasowang@redhat.com>
Tue, 28 Jun 2016 02:13:57 +0000 (28 10:13 +0800)
tree555b62aa300da283cca63fce5466a9509e4bf813
parent46fe8bef4d88e91942387ef334e7a9b3e6542314
vmxnet3: Fix reading/writing guest memory specially when behind an IOMMU

When a PCI device lives behind an IOMMU, it should use 'pci_dma_*' family of
functions when any transfer from/to guest memory is required while
'cpu_physical_memory_*' family of functions completely bypass any MMU/IOMMU in
the system.

vmxnet3 in some places was using 'cpu_physical_memory_*' family of functions
which works fine with the default QEMU setup where IOMMU is not enabled but
fails miserably when IOMMU is enabled. This commit converts all such instances
in favor of 'pci_dma_*'

Cc: Dmitry Fleytman <dmitry@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@amazon.com>
Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
Acked-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/vmware_utils.h
hw/net/vmxnet3.c