Skip to content

Commit bf4197b

Browse files
juru1234awilliam
authored andcommitted
vfio/ism: Implement vfio_pci driver for ISM devices
Add a vfio_pci variant driver for the s390-specific Internal Shared Memory (ISM) devices used for inter-VM communication. This enables the development of vfio-pci-based user space drivers for ISM devices. On s390, kernel primitives such as ioread() and iowrite() are switched over from function-handle-based PCI load/stores instructions to PCI memory-I/O (MIO) loads/stores when these are available and not explicitly disabled. Since these instructions cannot be used with ISM devices, ensure that classic function-handle-based PCI instructions are used instead. The driver is still required even when MIO instructions are disabled, as the ISM device relies on the PCI store block (PCISTB) instruction to perform write operations. Stores are not fragmented, therefore one ioctl corresponds to exactly one PCISTB instruction. User space must ensure to not write more than 4096 bytes at once to an ISM BAR which is the maximum payload of the PCISTB instruction. Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Julian Ruess <julianr@linux.ibm.com> Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Link: https://lore.kernel.org/r/20260325-vfio_pci_ism-v8-2-ddc504cde914@linux.ibm.com Signed-off-by: Alex Williamson <alex@shazbot.org>
1 parent 29afd0c commit bf4197b

5 files changed

Lines changed: 425 additions & 0 deletions

File tree

drivers/vfio/pci/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ config VFIO_PCI_DMABUF
6060

6161
source "drivers/vfio/pci/mlx5/Kconfig"
6262

63+
source "drivers/vfio/pci/ism/Kconfig"
64+
6365
source "drivers/vfio/pci/hisilicon/Kconfig"
6466

6567
source "drivers/vfio/pci/pds/Kconfig"

drivers/vfio/pci/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ obj-$(CONFIG_VFIO_PCI) += vfio-pci.o
1111

1212
obj-$(CONFIG_MLX5_VFIO_PCI) += mlx5/
1313

14+
obj-$(CONFIG_ISM_VFIO_PCI) += ism/
15+
1416
obj-$(CONFIG_HISI_ACC_VFIO_PCI) += hisilicon/
1517

1618
obj-$(CONFIG_PDS_VFIO_PCI) += pds/

drivers/vfio/pci/ism/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
config ISM_VFIO_PCI
3+
tristate "VFIO support for ISM devices"
4+
depends on S390
5+
select VFIO_PCI_CORE
6+
help
7+
This provides user space support for IBM Internal Shared Memory (ISM)
8+
Adapter devices using the VFIO framework.
9+
10+
If you don't know what to do here, say N.

drivers/vfio/pci/ism/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
obj-$(CONFIG_ISM_VFIO_PCI) += ism-vfio-pci.o
3+
ism-vfio-pci-y := main.o

0 commit comments

Comments
 (0)