aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/vfio.h
diff options
context:
space:
mode:
authorJike Song <jike.song@intel.com>2016-12-01 13:20:06 +0800
committerAlex Williamson <alex.williamson@redhat.com>2016-12-01 10:40:05 -0700
commitccd46dbae77dbf0d33f42e04b59536f108c395e8 (patch)
tree6857fe3d01f70509d63f656670a8f757d0b67c4e /include/linux/vfio.h
parentvfio: vfio_register_notifier: classify iommu notifier (diff)
downloadwireguard-linux-ccd46dbae77dbf0d33f42e04b59536f108c395e8.tar.xz
wireguard-linux-ccd46dbae77dbf0d33f42e04b59536f108c395e8.zip
vfio: support notifier chain in vfio_group
Beyond vfio_iommu events, users might also be interested in vfio_group events. For example, if a vfio_group is used along with Qemu/KVM, whenever kvm pointer is set to/cleared from the vfio_group, users could be notified. Currently only VFIO_GROUP_NOTIFY_SET_KVM supported. Cc: Kirti Wankhede <kwankhede@nvidia.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com> Signed-off-by: Jike Song <jike.song@intel.com> [aw: remove use of new typedef] Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/vfio.h')
-rw-r--r--include/linux/vfio.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 0e5201f207d3..edf9b2cad277 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -111,11 +111,15 @@ extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,
/* each type has independent events */
enum vfio_notify_type {
VFIO_IOMMU_NOTIFY = 0,
+ VFIO_GROUP_NOTIFY = 1,
};
/* events for VFIO_IOMMU_NOTIFY */
#define VFIO_IOMMU_NOTIFY_DMA_UNMAP BIT(0)
+/* events for VFIO_GROUP_NOTIFY */
+#define VFIO_GROUP_NOTIFY_SET_KVM BIT(0)
+
extern int vfio_register_notifier(struct device *dev,
enum vfio_notify_type type,
unsigned long *required_events,
@@ -124,6 +128,9 @@ extern int vfio_unregister_notifier(struct device *dev,
enum vfio_notify_type type,
struct notifier_block *nb);
+struct kvm;
+extern void vfio_group_set_kvm(struct vfio_group *group, struct kvm *kvm);
+
/*
* Sub-module helpers
*/