History

Merge tag 'vfio-v5.16-rc1' of git://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson: - Cleanup vfio iommu_group creation (Christoph Hellwig) - Add individual device reset for vfio/fsl-mc (Diana Craciun) - IGD OpRegion 2.0+ support (Colin Xu) - Use modern cdev lifecycle for vfio_group (Jason Gunthorpe) - Use new mdev API in vfio_ccw (Jason Gunthorpe) * tag 'vfio-v5.16-rc1' of git://github.com/awilliam/linux-vfio: (27 commits) vfio/ccw: Convert to use vfio_register_emulated_iommu_dev() vfio/ccw: Pass vfio_ccw_private not mdev_device to various functions vfio/ccw: Use functions for alloc/free of the vfio_ccw_private vfio/ccw: Remove unneeded GFP_DMA vfio: Use cdev_device_add() instead of device_create() vfio: Use a refcount_t instead of a kref in the vfio_group vfio: Don't leak a group reference if the group already exists vfio: Do not open code the group list search in vfio_create_group() vfio: Delete vfio_get/put_group from vfio_iommu_group_notifier() vfio/pci: Add OpRegion 2.0+ Extended VBT support. vfio/iommu_type1: remove IS_IOMMU_CAP_DOMAIN_IN_CONTAINER vfio/iommu_type1: remove the "external" domain vfio/iommu_type1: initialize pgsize_bitmap in ->open vfio/spapr_tce: reject mediated devices vfio: clean up the check for mediated device in vfio_iommu_type1 vfio: remove the unused mdev iommu hook vfio: move the vfio_iommu_driver_ops interface out of <linux/vfio.h> vfio: remove unused method from vfio_iommu_driver_ops vfio: simplify iommu group allocation for mediated devices vfio: remove the iommudata hack for noiommu groups ...

Linus Torvalds committed 5 years ago

Commit d4ec3d52 parents a602285 3bf131123 files · +945 −903Browse files

Showing the changes to include (3 of 23 files). Show all

Unified · Split

3 files
  1. include/linux/fsl/mc.h +14 −0
  2. include/linux/mdev.h +0 −20
  3. include/linux/vfio.h +1 −52
include/linux/fsl/mc.h+14−0
@@ -620,6 +620,20 @@ int dpcon_reset(struct fsl_mc_io *mc_io, · 619 unmodified lines
620620 u32 cmd_flags,
621621 u16 token);
622622
623+int fsl_mc_obj_open(struct fsl_mc_io *mc_io,
624+ u32 cmd_flags,
625+ int obj_id,
626+ char *obj_type,
627+ u16 *token);
628+
629+int fsl_mc_obj_close(struct fsl_mc_io *mc_io,
630+ u32 cmd_flags,
631+ u16 token);
632+
633+int fsl_mc_obj_reset(struct fsl_mc_io *mc_io,
634+ u32 cmd_flags,
635+ u16 token);
636+
623637 /**
624638 * struct dpcon_attr - Structure representing DPCON attributes
625639 * @id: DPCON object ID
include/linux/mdev.h+0−20
@@ -18,7 +18,6 @@ struct mdev_device { · 17 unmodified lines
1818 void *driver_data;
1919 struct list_head next;
2020 struct mdev_type *type;
21− struct device *iommu_device;
2221 bool active;
2322 };
2423
@@ -27,25 +26,6 @@ static inline struct mdev_device *to_mdev_device(struct device *dev) · 2 unmodified lines
2726 return container_of(dev, struct mdev_device, dev);
2827 }
2928
30−/*
31− * Called by the parent device driver to set the device which represents
32− * this mdev in iommu protection scope. By default, the iommu device is
33− * NULL, that indicates using vendor defined isolation.
34− *
35− * @dev: the mediated device that iommu will isolate.
36− * @iommu_device: a pci device which represents the iommu for @dev.
37− */
38−static inline void mdev_set_iommu_device(struct mdev_device *mdev,
39− struct device *iommu_device)
40−{
41− mdev->iommu_device = iommu_device;
42−}
43−
44−static inline struct device *mdev_get_iommu_device(struct mdev_device *mdev)
45−{
46− return mdev->iommu_device;
47−}
48−
4929 unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
5030 unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
5131 struct device *mtype_get_parent_dev(struct mdev_type *mtype);
include/linux/vfio.h+1−52
@@ -71,68 +71,17 @@ struct vfio_device_ops { · 70 unmodified lines
7171 int (*match)(struct vfio_device *vdev, char *buf);
7272 };
7373
74−extern struct iommu_group *vfio_iommu_group_get(struct device *dev);
75−extern void vfio_iommu_group_put(struct iommu_group *group, struct device *dev);
76−
7774 void vfio_init_group_dev(struct vfio_device *device, struct device *dev,
7875 const struct vfio_device_ops *ops);
7976 void vfio_uninit_group_dev(struct vfio_device *device);
8077 int vfio_register_group_dev(struct vfio_device *device);
78+int vfio_register_emulated_iommu_dev(struct vfio_device *device);
8179 void vfio_unregister_group_dev(struct vfio_device *device);
8280 extern struct vfio_device *vfio_device_get_from_dev(struct device *dev);
8381 extern void vfio_device_put(struct vfio_device *device);
8482
8583 int vfio_assign_device_set(struct vfio_device *device, void *set_id);
8684
87−/* events for the backend driver notify callback */
88−enum vfio_iommu_notify_type {
89− VFIO_IOMMU_CONTAINER_CLOSE = 0,
90−};
91−
92−/**
93− * struct vfio_iommu_driver_ops - VFIO IOMMU driver callbacks
94− */
95−struct vfio_iommu_driver_ops {
96− char *name;
97− struct module *owner;
98− void *(*open)(unsigned long arg);
99− void (*release)(void *iommu_data);
100− ssize_t (*read)(void *iommu_data, char __user *buf,
101− size_t count, loff_t *ppos);
102− ssize_t (*write)(void *iommu_data, const char __user *buf,
103− size_t count, loff_t *size);
104− long (*ioctl)(void *iommu_data, unsigned int cmd,
105− unsigned long arg);
106− int (*mmap)(void *iommu_data, struct vm_area_struct *vma);
107− int (*attach_group)(void *iommu_data,
108− struct iommu_group *group);
109− void (*detach_group)(void *iommu_data,
110− struct iommu_group *group);
111− int (*pin_pages)(void *iommu_data,
112− struct iommu_group *group,
113− unsigned long *user_pfn,
114− int npage, int prot,
115− unsigned long *phys_pfn);
116− int (*unpin_pages)(void *iommu_data,
117− unsigned long *user_pfn, int npage);
118− int (*register_notifier)(void *iommu_data,
119− unsigned long *events,
120− struct notifier_block *nb);
121− int (*unregister_notifier)(void *iommu_data,
122− struct notifier_block *nb);
123− int (*dma_rw)(void *iommu_data, dma_addr_t user_iova,
124− void *data, size_t count, bool write);
125− struct iommu_domain *(*group_iommu_domain)(void *iommu_data,
126− struct iommu_group *group);
127− void (*notify)(void *iommu_data,
128− enum vfio_iommu_notify_type event);
129−};
130−
131−extern int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops);
132−
133−extern void vfio_unregister_iommu_driver(
134− const struct vfio_iommu_driver_ops *ops);
135−
13685 /*
13786 * External user API
13887 */

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