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
26 * operations documented below26 * operations documented below
27 * @mmap: Perform mmap(2) on a region of the device file descriptor27 * @mmap: Perform mmap(2) on a region of the device file descriptor
28 * @request: Request for the bus driver to release the device28 * @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)
29 */32 */
30struct vfio_device_ops {33struct vfio_device_ops {
31 char *name;34 char *name;
@@ -39,6 +42,7 @@ struct vfio_device_ops { · 7 unmodified lines
39 unsigned long arg);42 unsigned long arg);
40 int (*mmap)(void *device_data, struct vm_area_struct *vma);43 int (*mmap)(void *device_data, struct vm_area_struct *vma);
41 void (*request)(void *device_data, unsigned int count);44 void (*request)(void *device_data, unsigned int count);
45 int (*match)(void *device_data, char *buf);
42};46};
43 47
44extern struct iommu_group *vfio_iommu_group_get(struct device *dev);48extern struct iommu_group *vfio_iommu_group_get(struct device *dev);
@@ -82,6 +86,8 @@ struct vfio_iommu_driver_ops { · 37 unmodified lines
82 struct notifier_block *nb);86 struct notifier_block *nb);
83 int (*unregister_notifier)(void *iommu_data,87 int (*unregister_notifier)(void *iommu_data,
84 struct notifier_block *nb);88 struct notifier_block *nb);
89 int (*dma_rw)(void *iommu_data, dma_addr_t user_iova,
90 void *data, size_t count, bool write);
85};91};
86 92
87extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops);93extern 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
94 */100 */
95extern struct vfio_group *vfio_group_get_external_user(struct file *filep);101extern struct vfio_group *vfio_group_get_external_user(struct file *filep);
96extern void vfio_group_put_external_user(struct vfio_group *group);102extern void vfio_group_put_external_user(struct vfio_group *group);
103extern struct vfio_group *vfio_group_get_external_user_from_dev(struct device
104 *dev);
97extern bool vfio_external_group_match_file(struct vfio_group *group,105extern bool vfio_external_group_match_file(struct vfio_group *group,
98 struct file *filep);106 struct file *filep);
99extern int vfio_external_user_iommu_id(struct vfio_group *group);107extern 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
107extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,115extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,
108 int npage);116 int npage);
109 117
118extern int vfio_group_pin_pages(struct vfio_group *group,
119 unsigned long *user_iova_pfn, int npage,
120 int prot, unsigned long *phys_pfn);
121extern int vfio_group_unpin_pages(struct vfio_group *group,
122 unsigned long *user_iova_pfn, int npage);
123
124extern int vfio_dma_rw(struct vfio_group *group, dma_addr_t user_iova,
125 void *data, size_t len, bool write);
126
110/* each type has independent events */127/* each type has independent events */
111enum vfio_notify_type {128enum vfio_notify_type {
112 VFIO_IOMMU_NOTIFY = 0,129 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