Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1472203

[PATCH v2 1/2] vfio: report group noiommu status

From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/2] vfio: report group noiommu status
Date 2016-08-30 04:30 +0200
Message-ID <sbGYh-7dn-5@gated-at.bofh.it> (permalink)
References <sbGYh-7dn-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When using vfio, callers might want to know whether device is added
to a regular group or an non-iommu group.

Report this status from vfio_is_noiommu_group_dev.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/linux/vfio.h |  2 ++
 drivers/vfio/vfio.c  | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 0ecae0b..584757b 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -51,6 +51,8 @@ extern int vfio_add_group_dev(struct device *dev,
 			      const struct vfio_device_ops *ops,
 			      void *device_data);
 
+extern bool vfio_is_noiommu_group_dev(struct device *dev);
+
 extern void *vfio_del_group_dev(struct device *dev);
 extern struct vfio_device *vfio_device_get_from_dev(struct device *dev);
 extern void vfio_device_put(struct vfio_device *device);
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index d1d70e0..22f279f 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -872,6 +872,18 @@ static bool vfio_dev_present(struct vfio_group *group, struct device *dev)
 }
 
 /*
+ * Is device part of a noiommu group?
+ * Note: must call vfio_add_group_dev first.
+ */
+bool vfio_is_noiommu_group_dev(struct device *dev)
+{
+	struct vfio_device *device = dev_get_drvdata(dev);
+	struct vfio_group *group = device->group;
+
+	return group->noiommu;
+}
+
+/*
  * Decrement the device reference count and wait for the device to be
  * removed.  Open file descriptors for the device... */
 void *vfio_del_group_dev(struct device *dev)
-- 
MST

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] vfio: blacklist legacy virtio devices "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 04:30 +0200
  [PATCH v2 2/2] vfio: add virtio pci quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 04:30 +0200
    Re: [PATCH v2 2/2] vfio: add virtio pci quirk Alex Williamson <alex.williamson@redhat.com> - 2016-08-30 05:30 +0200
      Re: [PATCH v2 2/2] vfio: add virtio pci quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 05:50 +0200
      Re: [PATCH v2 2/2] vfio: add virtio pci quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 06:00 +0200
      Re: [PATCH v2 2/2] vfio: add virtio pci quirk Alex Williamson <alex.williamson@redhat.com> - 2016-08-30 06:00 +0200
        Re: [PATCH v2 2/2] vfio: add virtio pci quirk Alex Williamson <alex.williamson@redhat.com> - 2016-08-30 07:00 +0200
          Re: [PATCH v2 2/2] vfio: add virtio pci quirk "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 07:30 +0200
            Re: [PATCH v2 2/2] vfio: add virtio pci quirk Alex Williamson <alex.williamson@redhat.com> - 2016-08-30 14:50 +0200
  [PATCH v2 1/2] vfio: report group noiommu status "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 04:30 +0200
  Re: [Qemu-devel] [PATCH v2 0/2] vfio: blacklist legacy virtio devices Jason Wang <jasowang@redhat.com> - 2016-08-30 05:20 +0200
    Re: [Qemu-devel] [PATCH v2 0/2] vfio: blacklist legacy virtio devices "Michael S. Tsirkin" <mst@redhat.com> - 2016-08-30 06:00 +0200

csiph-web