Skip to content

Commit 6c8017c

Browse files
rchatreawilliam
authored andcommitted
vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X
Dynamic MSI-X is supported. Clear VFIO_IRQ_INFO_NORESIZE to provide guidance to user space. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/fd1ef2bf6ae972da8e2805bc95d5155af5a8fb0a.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent e416343 commit 6c8017c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/vfio/pci/vfio_pci_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ static int vfio_pci_ioctl_get_irq_info(struct vfio_pci_core_device *vdev,
11141114
if (info.index == VFIO_PCI_INTX_IRQ_INDEX)
11151115
info.flags |=
11161116
(VFIO_IRQ_INFO_MASKABLE | VFIO_IRQ_INFO_AUTOMASKED);
1117-
else
1117+
else if (info.index != VFIO_PCI_MSIX_IRQ_INDEX || !vdev->has_dyn_msix)
11181118
info.flags |= VFIO_IRQ_INFO_NORESIZE;
11191119

11201120
return copy_to_user(arg, &info, minsz) ? -EFAULT : 0;

include/uapi/linux/vfio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ struct vfio_region_info_cap_nvlink2_lnkspd {
511511
* then add and unmask vectors, it's up to userspace to make the decision
512512
* whether to allocate the maximum supported number of vectors or tear
513513
* down setup and incrementally increase the vectors as each is enabled.
514+
* Absence of the NORESIZE flag indicates that vectors can be enabled
515+
* and disabled dynamically without impacting other vectors within the
516+
* index.
514517
*/
515518
struct vfio_irq_info {
516519
__u32 argsz;

0 commit comments

Comments
 (0)