diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-05-26 09:43:23 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-05-26 11:12:08 -0600 |
commit | d78c19b5cf4821d0c198f4132a085bdbf19dda4c (patch) | |
tree | 1f3416f37172b620b96121c1ca396a88602cafb7 /include/hw | |
parent | 7a057b4fb9dec2baf975d1737a7258602e793c40 (diff) |
memory: Fix IOMMU replay base address
Since a788f227 "memory: Allow replay of IOMMU mapping notifications"
when new VFIO listener is added, all existing IOMMU mappings are
replayed. However there is a problem that the base address of
an IOMMU memory region (IOMMU MR) is ignored which is not a problem
for the existing user (which is pseries) with its default 32bit DMA
window starting at 0 but it is if there is another DMA window.
This stores the IOMMU's offset_within_address_space and adjusts
the IOVA before calling vfio_dma_map/vfio_dma_unmap.
As the IOMMU notifier expects IOVA offset rather than the absolute
address, this also adjusts IOVA in sPAPR H_PUT_TCE handler before
calling notifier(s).
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/vfio/vfio-common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index a947f9ccda..0610377789 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -90,6 +90,7 @@ typedef struct VFIOContainer { typedef struct VFIOGuestIOMMU { VFIOContainer *container; MemoryRegion *iommu; + hwaddr iommu_offset; Notifier n; QLIST_ENTRY(VFIOGuestIOMMU) giommu_next; } VFIOGuestIOMMU; |