summaryrefslogtreecommitdiff
path: root/include/linux/vfio_pci_core.h
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2023-05-11 18:44:33 +0300
committerAlex Williamson <alex.williamson@redhat.com>2023-05-24 00:49:03 +0300
commit63972f63a63f9c3b113cac34dc8692a7c9ae671d (patch)
treee63d14ffe3c3f8edbb015cbd7416ca3492662ae6 /include/linux/vfio_pci_core.h
parentb156e48fffa9f1caea490e4812a1451adb5c0ef4 (diff)
downloadlinux-63972f63a63f9c3b113cac34dc8692a7c9ae671d.tar.xz
vfio/pci: Remove interrupt context counter
struct vfio_pci_core_device::num_ctx counts how many interrupt contexts have been allocated. When all interrupt contexts are allocated simultaneously num_ctx provides the upper bound of all vectors that can be used as indices into the interrupt context array. With the upcoming support for dynamic MSI-X the number of interrupt contexts does not necessarily span the range of allocated interrupts. Consequently, num_ctx is no longer a trusted upper bound for valid indices. Stop using num_ctx to determine if a provided vector is valid. Use the existence of allocated interrupt. This changes behavior on the error path when user space provides an invalid vector range. Behavior changes from early exit without any modifications to possible modifications to valid vectors within the invalid range. This is acceptable considering that an invalid range is not a valid scenario, see link to discussion. The checks that ensure that user space provides a range of vectors that is valid for the device are untouched. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/lkml/20230316155646.07ae266f.alex.williamson@redhat.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/e27d350f02a65b8cbacd409b4321f5ce35b3186d.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/vfio_pci_core.h')
-rw-r--r--include/linux/vfio_pci_core.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h
index 61d7873a3973..148fd1ae6c1c 100644
--- a/include/linux/vfio_pci_core.h
+++ b/include/linux/vfio_pci_core.h
@@ -60,7 +60,6 @@ struct vfio_pci_core_device {
spinlock_t irqlock;
struct mutex igate;
struct xarray ctx;
- int num_ctx;
int irq_type;
int num_regions;
struct vfio_pci_region *region;