Skip to content

s390x/pci: relax I/O address translation requirement

Matthew Rosato qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 2 repliesIn review
  2. v42 patches 4 repliesSuperseded
  3. v32 patches 7 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches7 repliesSuperseded
v12 patches14 repliesSuperseded

Changes in v5 from the cover letter

- Add some review/test tags (had to drop some due to code changes)
- Dynamically allocate iommu->dm_mr, remove direct_map bool

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2s390x/pci: add support for guests that request direct mappinghw/s390x/s390-pci-bus.c hw/s390x/s390-pci-inst.c hw/s390x/s390-pci-vfio.c +2 more+75 -81 reply
2/2s390x/pci: indicate QEMU supports relaxed translation for passthroughhw/s390x/s390-pci-vfio.c include/hw/s390x/s390-pci-clp.h+5 -10 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNiklas SchnelleDavid HildenbrandThomas Huth
SeriesA-b
1/2R-b
2/2T-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 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/2] s390x/pci: relax I/O address translation requirement

This series introduces the concept of the relaxed translation requirement for s390x guests in order to allow bypass of the guest IOMMU for more efficient PCI passthrough.

With this series, QEMU can indicate to the guest that an IOMMU is not strictly required for a zPCI device. This would subsequently allow a guest linux to use iommu.passthrough=1 and bypass their guest IOMMU for PCI devices.

When this occurs, QEMU will note the behavior via an intercepted MPCIFC instruction and will fill the host iommu with mappings of the entire guest address space in response.

The kernel series [1] that adds the relevant behavior needed to exploit this new feature from within a s390x linux guest is available in linux-next via iommu-next.

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

Changes for v5:
- Add some review/test tags (had to drop some due to code changes)
- Dynamically allocate iommu->dm_mr, remove direct_map bool

Changes for v4:
- use get_system_memory() instead of ms->ram
- rename rtr_allowed to rtr_avail
- turn off rtr_avail for emulated devices so MPCFIC fence properly rejects an attempt at direct mapping (we only advertise via CLP for passthrough devices)
- turn off rtr_avail for passthrough ISM devices
- various minor changes

Changes for v3:
- use s390_get_memory_limit
- advertise full aperture for relaxed-translation-capable devices

Changes for v2:
- Add relax-translation property, fence for older machines
- Add a new MPCIFC failure case when direct-mapping requested but the relax-translation property is set to off.
- For direct mapping, use a memory alias to handle the SMDA offset and then just let vfio handle the pinning of memory.

Matthew Rosato (2):
s390x/pci: add support for guests that request direct mapping s390x/pci: indicate QEMU supports relaxed translation for passthrough

 hw/s390x/s390-pci-bus.c         | 39 +++++++++++++++++++++++++++++++--
 hw/s390x/s390-pci-inst.c        | 13 +++++++++--
 hw/s390x/s390-pci-vfio.c        | 28 ++++++++++++++++++-----
 hw/s390x/s390-virtio-ccw.c      |  5 +++++
 include/hw/s390x/s390-pci-bus.h |  3 +++
 include/hw/s390x/s390-pci-clp.h |  1 +
 6 files changed, 80 insertions(+), 9 deletions(-)
Signature · 1 line
2.48.1