Skip to content

Enable QEMU NVMe userspace driver on s390x

Farhan Ali qemu-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 4 repliesIn review
  2. v53 patches 14 repliesSuperseded
  3. v43 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches14 repliesSuperseded
v23 patches11 repliesSuperseded
v12 patches4 repliesSuperseded

Changes in v6 from the cover letter

- Address Thomas's comments/nits (patch 1 and patch 2).

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3util: Add functions for s390x mmio read/writeinclude/qemu/s390x_pci_mmio.h util/meson.build util/s390x_pci_mmio.c+172 -01 reply
2/3include: Add a header to define host PCI MMIO functionsinclude/qemu/host-pci-mmio.h+136 -03 replies
3/3block/nvme: Use host PCI MMIO APIblock/nvme.c+23 -180 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchStefan HajnocziPhilippe Mathieu-DaudéThomas HuthNiklas Schnelle
1/3R-b A-b R-b
2/3R-b R-b
3/3R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/3] Enable QEMU NVMe userspace driver on s390x

Hi,

Recently on s390x we have enabled mmap support for vfio-pci devices [1]. This allows us to take advantage and use userspace drivers on s390x. However, on s390x we have special instructions for MMIO access. Starting with z15 (and newer platforms) we have new PCI Memory I/O (MIO) instructions which operate on virtually mapped PCI memory spaces, and can be used from userspace. On older platforms we would fallback to using existing system calls for MMIO access.

This patch series introduces support the PCI MIO instructions, and enables s390x support for the userspace NVMe driver on s390x. I would appreciate any review/feedback on the patches.

Thanks
Farhan

[1] https://lore.kernel.org/linux-s390/[email protected]/

ChangeLog
---------
v5 series https://lore.kernel.org/qemu-devel/[email protected]/
v5 -> v6
- Address Thomas's comments/nits (patch 1 and patch 2).

v4 series https://lore.kernel.org/qemu-devel/[email protected]/
v4 -> v5
- Fixup typo in PCI MMIO API (patch 2).

v3 series https://lore.kernel.org/qemu-devel/[email protected]/
v3 -> v4
- Use generic ld/st functions for non s390x PCI access suggested by Alex (patch 2).
- Removed R-b for patch 2 as the host PCI MMIO access API changed for non-s390x. Would appreciate review on this again.

v2 series https://mail.gnu.org/archive/html/qemu-devel/2025-03/msg06847.html
v2 -> v3
- Update the PCI MMIO APIs to reflect that its PCI MMIO access on host
as suggested by Stefan(patch 2)
- Move s390x ifdef check to s390x_pci_mmio.h as suggested by Philippe (patch 1)
- Add R-bs for the respective patches.

v1 series https://mail.gnu.org/archive/html/qemu-devel/2025-03/msg06596.html
v1 -> v2
- Add 8 and 16 bit reads/writes for completeness (patch 1)
- Introduce new QEMU PCI MMIO read/write API as suggested by Stefan (patch 2)
- Update NVMe userspace driver to use QEMU PCI MMIO functions (patch 3)

Farhan Ali (3):
util: Add functions for s390x mmio read/write
include: Add a header to define host PCI MMIO functions block/nvme: Use host PCI MMIO API

 block/nvme.c                  |  41 +++++-----
 include/qemu/host-pci-mmio.h  | 136 +++++++++++++++++++++++++++++++
 include/qemu/s390x_pci_mmio.h |  24 ++++++
 util/meson.build              |   2 +
 util/s390x_pci_mmio.c         | 146 ++++++++++++++++++++++++++++++++++
 5 files changed, 331 insertions(+), 18 deletions(-)
 create mode 100644 include/qemu/host-pci-mmio.h
 create mode 100644 include/qemu/s390x_pci_mmio.h
 create mode 100644 util/s390x_pci_mmio.c
Signature · 1 line
2.43.0