VFIO fixes for v5.16-rc4

- Fix OpRegion pointer arithmetic (Zhenyu Wang)
 
  - Fix comment format triggering kernel-doc warnings (Randy Dunlap)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmGqeUobHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiG2cQALLJZh/NIChZNRjX09ba
 1bSXI85vWAIXfDwxAMkMVYZDbeyGuAL4qN/DLS/nkgJN2/H4Uh+zGVC6Z8QhCBEI
 DFHtxVVleUs5sPQgLXrZy4XRiUh5v7DceQIBN5+UNZsKq3afbQ9r7V7DkZ0WXiA1
 NSiZOn+CafhEuDChlPTvTBcg6/Cw9r83I1+Rpf+vZtSUmsbyU/MSWtWe9/EYcmCE
 u5raDptULH18zVIImvuli9+dDuOlOPkgfqZnRLXYV2imPHFf2fwuSpvDFIhCDZ/M
 fwJUWE4JHHEceN4W7PnvXdqV8Gx3rsO7LaO5HQGQ7buMNqweO1zfr5Zw89mAnOQ5
 zJr5cmdNWaRPeXsdCFyD2j7R+PAschWr3k4Gl5u5caxWJOy0bEacCeKkboojP1br
 UZjEXApmvpBPWT5oSdhOMIZYyRwDSUsvpxczux3bcjieuRyzfvJckbHUGH82sEQ8
 832lLaGUo4DgdPwfimyQCL2usaRQkqJlcUxaeTWzwu+Z90xldjh73y77j3GQpKue
 AL+2anpTBQRDWU+N8Lh1uj/Pxfw/ni8LiMepT8b7FKPHRCPRvcvSSPIm7b/wKKlF
 weggu8YASn9w6bRWVxySEFmlTNPLhVUl9fA/m4GGgvEAN2j7Po8iyB9GHgwGZM2/
 WK0zcll93lEatdTLTG/PNfkB
 =3uUP
 -----END PGP SIGNATURE-----

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

Pull VFIO fixes from Alex Williamson:

 - Fix OpRegion pointer arithmetic (Zhenyu Wang)

 - Fix comment format triggering kernel-doc warnings (Randy Dunlap)

* tag 'vfio-v5.16-rc4' of git://github.com/awilliam/linux-vfio:
  vfio/pci: Fix OpRegion read
  vfio: remove all kernel-doc notation
This commit is contained in:
Linus Torvalds 2021-12-03 12:27:08 -08:00
commit 12119cfa10
2 changed files with 17 additions and 16 deletions

View File

@ -98,7 +98,8 @@ static ssize_t vfio_pci_igd_rw(struct vfio_pci_core_device *vdev,
version = cpu_to_le16(0x0201); version = cpu_to_le16(0x0201);
if (igd_opregion_shift_copy(buf, &off, if (igd_opregion_shift_copy(buf, &off,
&version + (pos - OPREGION_VERSION), (u8 *)&version +
(pos - OPREGION_VERSION),
&pos, &remaining, bytes)) &pos, &remaining, bytes))
return -EFAULT; return -EFAULT;
} }
@ -121,7 +122,7 @@ static ssize_t vfio_pci_igd_rw(struct vfio_pci_core_device *vdev,
OPREGION_SIZE : 0); OPREGION_SIZE : 0);
if (igd_opregion_shift_copy(buf, &off, if (igd_opregion_shift_copy(buf, &off,
&rvda + (pos - OPREGION_RVDA), (u8 *)&rvda + (pos - OPREGION_RVDA),
&pos, &remaining, bytes)) &pos, &remaining, bytes))
return -EFAULT; return -EFAULT;
} }

View File

@ -232,7 +232,7 @@ static inline bool vfio_iommu_driver_allowed(struct vfio_container *container,
} }
#endif /* CONFIG_VFIO_NOIOMMU */ #endif /* CONFIG_VFIO_NOIOMMU */
/** /*
* IOMMU driver registration * IOMMU driver registration
*/ */
int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops) int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops)
@ -285,7 +285,7 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb,
unsigned long action, void *data); unsigned long action, void *data);
static void vfio_group_get(struct vfio_group *group); static void vfio_group_get(struct vfio_group *group);
/** /*
* Container objects - containers are created when /dev/vfio/vfio is * Container objects - containers are created when /dev/vfio/vfio is
* opened, but their lifecycle extends until the last user is done, so * opened, but their lifecycle extends until the last user is done, so
* it's freed via kref. Must support container/group/device being * it's freed via kref. Must support container/group/device being
@ -309,7 +309,7 @@ static void vfio_container_put(struct vfio_container *container)
kref_put(&container->kref, vfio_container_release); kref_put(&container->kref, vfio_container_release);
} }
/** /*
* Group objects - create, release, get, put, search * Group objects - create, release, get, put, search
*/ */
static struct vfio_group * static struct vfio_group *
@ -488,7 +488,7 @@ static struct vfio_group *vfio_group_get_from_dev(struct device *dev)
return group; return group;
} }
/** /*
* Device objects - create, release, get, put, search * Device objects - create, release, get, put, search
*/ */
/* Device reference always implies a group reference */ /* Device reference always implies a group reference */
@ -595,7 +595,7 @@ static int vfio_dev_viable(struct device *dev, void *data)
return ret; return ret;
} }
/** /*
* Async device support * Async device support
*/ */
static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev) static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev)
@ -689,7 +689,7 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb,
return NOTIFY_OK; return NOTIFY_OK;
} }
/** /*
* VFIO driver API * VFIO driver API
*/ */
void vfio_init_group_dev(struct vfio_device *device, struct device *dev, void vfio_init_group_dev(struct vfio_device *device, struct device *dev,
@ -831,7 +831,7 @@ int vfio_register_emulated_iommu_dev(struct vfio_device *device)
} }
EXPORT_SYMBOL_GPL(vfio_register_emulated_iommu_dev); EXPORT_SYMBOL_GPL(vfio_register_emulated_iommu_dev);
/** /*
* Get a reference to the vfio_device for a device. Even if the * Get a reference to the vfio_device for a device. Even if the
* caller thinks they own the device, they could be racing with a * caller thinks they own the device, they could be racing with a
* release call path, so we can't trust drvdata for the shortcut. * release call path, so we can't trust drvdata for the shortcut.
@ -965,7 +965,7 @@ void vfio_unregister_group_dev(struct vfio_device *device)
} }
EXPORT_SYMBOL_GPL(vfio_unregister_group_dev); EXPORT_SYMBOL_GPL(vfio_unregister_group_dev);
/** /*
* VFIO base fd, /dev/vfio/vfio * VFIO base fd, /dev/vfio/vfio
*/ */
static long vfio_ioctl_check_extension(struct vfio_container *container, static long vfio_ioctl_check_extension(struct vfio_container *container,
@ -1183,7 +1183,7 @@ static const struct file_operations vfio_fops = {
.compat_ioctl = compat_ptr_ioctl, .compat_ioctl = compat_ptr_ioctl,
}; };
/** /*
* VFIO Group fd, /dev/vfio/$GROUP * VFIO Group fd, /dev/vfio/$GROUP
*/ */
static void __vfio_group_unset_container(struct vfio_group *group) static void __vfio_group_unset_container(struct vfio_group *group)
@ -1536,7 +1536,7 @@ static const struct file_operations vfio_group_fops = {
.release = vfio_group_fops_release, .release = vfio_group_fops_release,
}; };
/** /*
* VFIO Device fd * VFIO Device fd
*/ */
static int vfio_device_fops_release(struct inode *inode, struct file *filep) static int vfio_device_fops_release(struct inode *inode, struct file *filep)
@ -1611,7 +1611,7 @@ static const struct file_operations vfio_device_fops = {
.mmap = vfio_device_fops_mmap, .mmap = vfio_device_fops_mmap,
}; };
/** /*
* External user API, exported by symbols to be linked dynamically. * External user API, exported by symbols to be linked dynamically.
* *
* The protocol includes: * The protocol includes:
@ -1659,7 +1659,7 @@ struct vfio_group *vfio_group_get_external_user(struct file *filep)
} }
EXPORT_SYMBOL_GPL(vfio_group_get_external_user); EXPORT_SYMBOL_GPL(vfio_group_get_external_user);
/** /*
* External user API, exported by symbols to be linked dynamically. * External user API, exported by symbols to be linked dynamically.
* The external user passes in a device pointer * The external user passes in a device pointer
* to verify that: * to verify that:
@ -1725,7 +1725,7 @@ long vfio_external_check_extension(struct vfio_group *group, unsigned long arg)
} }
EXPORT_SYMBOL_GPL(vfio_external_check_extension); EXPORT_SYMBOL_GPL(vfio_external_check_extension);
/** /*
* Sub-module support * Sub-module support
*/ */
/* /*
@ -2272,7 +2272,7 @@ struct iommu_domain *vfio_group_iommu_domain(struct vfio_group *group)
} }
EXPORT_SYMBOL_GPL(vfio_group_iommu_domain); EXPORT_SYMBOL_GPL(vfio_group_iommu_domain);
/** /*
* Module/class support * Module/class support
*/ */
static char *vfio_devnode(struct device *dev, umode_t *mode) static char *vfio_devnode(struct device *dev, umode_t *mode)