History

Merge branches 'v5.7/vfio/alex-sriov-v3' and 'v5.7/vfio/yan-dma-rw-v4' into v5.7/vfio/next

Alex Williamson committed 6 years ago

Commit 48219793 parents 723fe29 b66574a 40280cf6 files · +700 −28Browse files

Showing the changes to include/linux (1 of 6 files). Show all

Unified · Split

include/linux/vfio.h+17−0
@@ -26,6 +26,9 @@ · 25 unmodified lines
2626 * operations documented below
2727 * @mmap: Perform mmap(2) on a region of the device file descriptor
2828 * @request: Request for the bus driver to release the device
29+ * @match: Optional device name match callback (return: 0 for no-match, >0 for
30+ * match, -errno for abort (ex. match with insufficient or incorrect
31+ * additional args)
2932 */
3033 struct vfio_device_ops {
3134 char *name;
@@ -39,6 +42,7 @@ struct vfio_device_ops { · 7 unmodified lines
3942 unsigned long arg);
4043 int (*mmap)(void *device_data, struct vm_area_struct *vma);
4144 void (*request)(void *device_data, unsigned int count);
45+ int (*match)(void *device_data, char *buf);
4246 };
4347
4448 extern struct iommu_group *vfio_iommu_group_get(struct device *dev);
@@ -82,6 +86,8 @@ struct vfio_iommu_driver_ops { · 37 unmodified lines
8286 struct notifier_block *nb);
8387 int (*unregister_notifier)(void *iommu_data,
8488 struct notifier_block *nb);
89+ int (*dma_rw)(void *iommu_data, dma_addr_t user_iova,
90+ void *data, size_t count, bool write);
8591 };
8692
8793 extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops);
@@ -94,6 +100,8 @@ extern void vfio_unregister_iommu_driver( · 6 unmodified lines
94100 */
95101 extern struct vfio_group *vfio_group_get_external_user(struct file *filep);
96102 extern void vfio_group_put_external_user(struct vfio_group *group);
103+extern struct vfio_group *vfio_group_get_external_user_from_dev(struct device
104+ *dev);
97105 extern bool vfio_external_group_match_file(struct vfio_group *group,
98106 struct file *filep);
99107 extern int vfio_external_user_iommu_id(struct vfio_group *group);
@@ -107,6 +115,15 @@ extern int vfio_pin_pages(struct device *dev, unsigned long *user_pfn, · 7 unmodified lines
107115 extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,
108116 int npage);
109117
118+extern int vfio_group_pin_pages(struct vfio_group *group,
119+ unsigned long *user_iova_pfn, int npage,
120+ int prot, unsigned long *phys_pfn);
121+extern int vfio_group_unpin_pages(struct vfio_group *group,
122+ unsigned long *user_iova_pfn, int npage);
123+
124+extern int vfio_dma_rw(struct vfio_group *group, dma_addr_t user_iova,
125+ void *data, size_t len, bool write);
126+
110127 /* each type has independent events */
111128 enum vfio_notify_type {
112129 VFIO_IOMMU_NOTIFY = 0,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t