vfio/spapr: Use iommu memory region's get_attr()
commit07bc681a331311e9c51d1cd8933739a80cd57af8
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 6 Feb 2018 18:08:24 +0000 (6 11:08 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Feb 2018 18:08:24 +0000 (6 11:08 -0700)
tree48923618cdcf812a321ffd1a7ca68336415b77f3
parentf1334de60b2a43102d2d47918463e6a2cdcfcdeb
vfio/spapr: Use iommu memory region's get_attr()

In order to enable TCE operations support in KVM, we have to inform
the KVM about VFIO groups being attached to specific LIOBNs. The KVM
already knows about VFIO groups, the only bit missing is which
in-kernel TCE table (the one with user visible TCEs) should update
the attached broups. There is an KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE
attribute of the VFIO KVM device which receives a groupfd/tablefd couple.

This uses a new memory_region_iommu_get_attr() helper to get the IOMMU fd
and calls KVM to establish the link.

As get_attr() is not implemented yet, this should cause no behavioural
change.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c
hw/vfio/trace-events