@@ -332,10 +332,11 @@ static bool vfio_get_vaddr(IOMMUTLBEntry *iotlb, void **vaddr,
return true;
}
-static void vfio_iommu_map_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb)
+static void vfio_iommu_map_notify(IOMMUNotifier *n, void *data)
{
VFIOGuestIOMMU *giommu = container_of(n, VFIOGuestIOMMU, n);
VFIOContainer *container = giommu->container;
+ IOMMUTLBEntry *iotlb = (IOMMUTLBEntry *)data;
hwaddr iova = iotlb->iova + giommu->iommu_offset;
bool read_only;
void *vaddr;
@@ -1161,9 +1161,10 @@ static void vhost_virtqueue_cleanup(struct vhost_virtqueue *vq)
event_notifier_cleanup(&vq->masked_notifier);
}
-static void vhost_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb)
+static void vhost_iommu_unmap_notify(IOMMUNotifier *n, void *data)
{
struct vhost_dev *hdev = container_of(n, struct vhost_dev, n);
+ IOMMUTLBEntry *iotlb = (IOMMUTLBEntry *)data;
if (hdev->vhost_ops->vhost_invalidate_device_iotlb(hdev,
iotlb->iova,
@@ -81,7 +81,7 @@ typedef enum {
struct IOMMUNotifier;
typedef void (*IOMMUNotify)(struct IOMMUNotifier *notifier,
- IOMMUTLBEntry *data);
+ void *data);
struct IOMMUNotifier {
IOMMUNotify notify;
This patch modifies parameter of IOMMUNotifier, use "void *data" instead of "IOMMUTLBEntry*". This is to extend it to support notifiers other than MAP/UNMAP. Signed-off-by: Liu, Yi L <yi.l.liu@linux.intel.com> --- hw/vfio/common.c | 3 ++- hw/virtio/vhost.c | 3 ++- include/exec/memory.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)