vfio/pci: rename and export range_intersect_range
authorAnkit Agrawal <ankita@nvidia.com>
Tue, 20 Feb 2024 11:50:54 +0000 (17:20 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 22 Feb 2024 19:20:20 +0000 (12:20 -0700)
commit30e920e1debb437e5aea7a4ccdab61634354297a
tree96a84573b787371659fbb4edcc53c2a1147b2854
parent4de676d494cd8fb2b4c65e58c19ebbdb36673957
vfio/pci: rename and export range_intersect_range

range_intersect_range determines an overlap between two ranges. If an
overlap, the helper function returns the overlapping offset and size.

The VFIO PCI variant driver emulates the PCI config space BAR offset
registers. These offset may be accessed for read/write with a variety
of lengths including sub-word sizes from sub-word offsets. The driver
makes use of this helper function to read/write the targeted part of
the emulated register.

Make this a vfio_pci_core function, rename and export as GPL. Also
update references in virtio driver.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Link: https://lore.kernel.org/r/20240220115055.23546-3-ankita@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/virtio/main.c
include/linux/vfio_pci_core.h