[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 04/20] Memory: modify parameter in IOMMUNotifier
From: |
Liu, Yi L |
Subject: |
[Qemu-devel] [RFC PATCH 04/20] Memory: modify parameter in IOMMUNotifier func |
Date: |
Wed, 26 Apr 2017 18:06:34 +0800 |
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 <address@hidden>
---
hw/vfio/common.c | 3 ++-
hw/virtio/vhost.c | 3 ++-
include/exec/memory.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 6b33b9f..14473f1 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -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;
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index ccf8b2e..fd20fd0 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -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,
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 267f399..1faca3b 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -81,7 +81,7 @@ typedef enum {
struct IOMMUNotifier;
typedef void (*IOMMUNotify)(struct IOMMUNotifier *notifier,
- IOMMUTLBEntry *data);
+ void *data);
struct IOMMUNotifier {
IOMMUNotify notify;
--
1.9.1
- [Qemu-devel] [RFC PATCH 00/20] Qemu: Extend intel_iommu emulator to support Shared Virtual Memory, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 01/20] intel_iommu: add "ecs" option, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 02/20] intel_iommu: exposed extended-context mode to guest, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 03/20] intel_iommu: add "svm" option, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 04/20] Memory: modify parameter in IOMMUNotifier func,
Liu, Yi L <=
- [Qemu-devel] [RFC PATCH 05/20] VFIO: add new IOCTL for svm bind tasks, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 06/20] VFIO: add new notifier for binding PASID table, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 07/20] VFIO: check notifier flag in region_del(), Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 08/20] Memory: add notifier flag check in memory_replay(), Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 09/20] Memory: introduce iommu_ops->record_device, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 10/20] VFIO: notify vIOMMU emulator when device is assigned, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 11/20] intel_iommu: provide iommu_ops->record_device, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 12/20] Memory: Add func to fire pasidt_bind notifier, Liu, Yi L, 2017/04/26