]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vfio/pci: Rename vfio_config_do_rw() to vfio_pci_config_rw_single() and export it
authorJulian Ruess <julianr@linux.ibm.com>
Wed, 25 Mar 2026 13:31:23 +0000 (14:31 +0100)
committerAlex Williamson <alex@shazbot.org>
Wed, 1 Apr 2026 21:41:02 +0000 (15:41 -0600)
A follow-up patch adds a new variant driver for s390 ISM devices. Since
this device uses a 256 TiB BAR 0 that is never mapped, the variant
driver needs its own ISM_VFIO_PCI_OFFSET_MASK. To minimally mirror the
functionality of vfio_pci_config_rw() with such a custom mask, export
vfio_config_do_rw(). To better distinguish the now exported function
from vfio_pci_config_rw(), rename it to vfio_pci_config_rw_single()
emphasizing that it does a single config space read or write.

Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Julian Ruess <julianr@linux.ibm.com>
Link: https://lore.kernel.org/r/20260325-vfio_pci_ism-v8-1-ddc504cde914@linux.ibm.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/vfio_pci_priv.h

index b4e39253f98da61a5e2b6dd0089b2f6aef4b85a0..a10ed733f0e3af89c185f8b93192ba6b004f05ed 100644 (file)
@@ -1880,8 +1880,9 @@ static size_t vfio_pci_cap_remaining_dword(struct vfio_pci_core_device *vdev,
        return i;
 }
 
-static ssize_t vfio_config_do_rw(struct vfio_pci_core_device *vdev, char __user *buf,
-                                size_t count, loff_t *ppos, bool iswrite)
+ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev,
+                                 char __user *buf, size_t count, loff_t *ppos,
+                                 bool iswrite)
 {
        struct pci_dev *pdev = vdev->pdev;
        struct perm_bits *perm;
@@ -1970,6 +1971,7 @@ static ssize_t vfio_config_do_rw(struct vfio_pci_core_device *vdev, char __user
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(vfio_pci_config_rw_single);
 
 ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
                           size_t count, loff_t *ppos, bool iswrite)
@@ -1981,7 +1983,7 @@ ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
        pos &= VFIO_PCI_OFFSET_MASK;
 
        while (count) {
-               ret = vfio_config_do_rw(vdev, buf, count, &pos, iswrite);
+               ret = vfio_pci_config_rw_single(vdev, buf, count, &pos, iswrite);
                if (ret < 0)
                        return ret;
 
index 27ac280f00b975989f6cbc02c11aaca01f9badf3..fca9d0dfac90f8eaaf2d281dd2213111c46d76a1 100644 (file)
@@ -37,6 +37,10 @@ int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,
 ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf,
                           size_t count, loff_t *ppos, bool iswrite);
 
+ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev,
+                                 char __user *buf, size_t count, loff_t *ppos,
+                                 bool iswrite);
+
 ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
                        size_t count, loff_t *ppos, bool iswrite);