Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/pci: Rename vfio_config_do_rw() to vfio_pci_config_rw_single() and export it

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>

authored by

Julian Ruess and committed by
Alex Williamson
29afd0c7 555aa178

+9 -3
+5 -3
drivers/vfio/pci/vfio_pci_config.c
··· 1880 1880 return i; 1881 1881 } 1882 1882 1883 - static ssize_t vfio_config_do_rw(struct vfio_pci_core_device *vdev, char __user *buf, 1884 - size_t count, loff_t *ppos, bool iswrite) 1883 + ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev, 1884 + char __user *buf, size_t count, loff_t *ppos, 1885 + bool iswrite) 1885 1886 { 1886 1887 struct pci_dev *pdev = vdev->pdev; 1887 1888 struct perm_bits *perm; ··· 1971 1970 1972 1971 return ret; 1973 1972 } 1973 + EXPORT_SYMBOL_GPL(vfio_pci_config_rw_single); 1974 1974 1975 1975 ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf, 1976 1976 size_t count, loff_t *ppos, bool iswrite) ··· 1983 1981 pos &= VFIO_PCI_OFFSET_MASK; 1984 1982 1985 1983 while (count) { 1986 - ret = vfio_config_do_rw(vdev, buf, count, &pos, iswrite); 1984 + ret = vfio_pci_config_rw_single(vdev, buf, count, &pos, iswrite); 1987 1985 if (ret < 0) 1988 1986 return ret; 1989 1987
+4
drivers/vfio/pci/vfio_pci_priv.h
··· 37 37 ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, char __user *buf, 38 38 size_t count, loff_t *ppos, bool iswrite); 39 39 40 + ssize_t vfio_pci_config_rw_single(struct vfio_pci_core_device *vdev, 41 + char __user *buf, size_t count, loff_t *ppos, 42 + bool iswrite); 43 + 40 44 ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf, 41 45 size_t count, loff_t *ppos, bool iswrite); 42 46