Skip to content

RFC powerpc/powenv/ioda: Allow huge DMA window at 4GB

Alexey Kardashevskiy kvm linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4powerpc/powernv/ioda: Rework for huge DMA window at 4GBarch/powerpc/platforms/powernv/pci-ioda.c+20 -180 replies
2/4powerpc/powernv/ioda: Allow smaller TCE table levelsarch/powerpc/platforms/powernv/pci-ioda-tce.c+2 -20 replies
3/4powerpc/powernv/phb4: Add 4GB IOMMU bypass modearch/powerpc/include/asm/iommu.h arch/powerpc/include/asm/opal-api.h arch/powerpc/include/asm/opal.h +3 more+175 -330 replies
4/4vfio/spapr_tce: Advertise and allow a huge DMA windows at 4GBdrivers/vfio/vfio_iommu_spapr_tce.c include/uapi/linux/vfio.h+10 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH kernel RFC 0/4] powerpc/powenv/ioda: Allow huge DMA window at 4GB

Here is an attempt to support bigger DMA space for devices supporting DMA masks less than 59 bits (GPUs come into mind first). POWER9 PHBs have an option to map 2 windows at 0 and select a windows based on DMA address being below or above 4GB.

This adds the "iommu=iommu_bypass" kernel parameter and supports VFIO+pseries machine - current this requires telling upstream+unmodified QEMU about this via
-global spapr-pci-host-bridge.dma64_win_addr=0x100000000 or per-phb property. 4/4 advertises the new option but there is no automation around it in QEMU (should it be?).

For now it is either 1<<59 or 4GB mode; dynamic switching is not supported (could be via sysfs).

This is based on sha1
a6ed68d6468b Linus Torvalds "Merge tag 'drm-next-2019-11-27' of git://anongit.freedesktop.org/drm/drm".

Please comment. Thanks.

Alexey Kardashevskiy (4):
powerpc/powernv/ioda: Rework for huge DMA window at 4GB powerpc/powernv/ioda: Allow smaller TCE table levels powerpc/powernv/phb4: Add 4GB IOMMU bypass mode vfio/spapr_tce: Advertise and allow a huge DMA windows at 4GB

 arch/powerpc/include/asm/iommu.h              |   1 +
 arch/powerpc/include/asm/opal-api.h           |  11 +-
 arch/powerpc/include/asm/opal.h               |   2 +
 arch/powerpc/platforms/powernv/pci.h          |   1 +
 include/uapi/linux/vfio.h                     |   2 +
 arch/powerpc/platforms/powernv/opal-call.c    |   2 +
 arch/powerpc/platforms/powernv/pci-ioda-tce.c |   4 +-
 arch/powerpc/platforms/powernv/pci-ioda.c     | 219 ++++++++++++++----
 drivers/vfio/vfio_iommu_spapr_tce.c           |  10 +-
 9 files changed, 202 insertions(+), 50 deletions(-)
Signature · 1 line
2.17.1