Skip to content

vfio/type1: Fix vfio-pci pass-through of ISM devices

Niklas Schnelle kvm linux-s390 lkml 3 versions – Applied

Status from this message: Applied to vfio for-linus branch for v6.2. Thanks,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 3 repliesApplied
  2. v21 patch 5 repliesSuperseded
  3. v11 patch 4 repliesSuperseded

Changes in v3 from the cover letter

- Don't require region->start to be aligned but instead just that we can fit an aligned allocation (Alex)
- Use Fixes tag for the introduction of reserved regions as that came after the fine grained super pages test (Alex)

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/1vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()drivers/vfio/vfio_iommu_type1.c+20 -113 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchJason GunthorpeMatthew Rosato
1/1R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/1] vfio/type1: Fix vfio-pci pass-through of ISM devices

Hi Alex,

This is v2 of my attempt of fixing an issue we have on s390 with vfio-pci pass-through of the s390 specific virtual PCI device called ISM and used for cross LPAR communication. As the patch tries to explain the fact that vfio_test_domain_fgsp() uses an IOMMU mapping at IOVA 0 irrespective of any reserved regions causes the ISM device to go into an error state and thus becomes unusable for a KVM guest breaking pass-through. I tried to improve the background and explanation compared to v1 hope its more clear now.

As for testing, I tested this based on current master on both on s390 where it skips the reserved 0x0-0x100000000 range and on an AMD Ryzen 3990X where it continues to do the test on DMA address 0 and sets domain->fgsp to true.

Thanks,
Niklas Schnelle

Changes since v2:
- Don't require region->start to be aligned but instead just that we can fit an aligned allocation (Alex)
- Use Fixes tag for the introduction of reserved regions as that came after the fine grained super pages test (Alex)

Changes since v1:
- Reworded commit message to hopefully explain things a bit better and highlight that usually just mapping but not issuing DMAs for IOVAs in a resverved region is harmless but still breaks things with ISM devices.
- Added a check for PAGE_SIZE * 2 alignment (Jason)

Niklas Schnelle (1):
vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()

 drivers/vfio/vfio_iommu_type1.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)
Signature · 1 line
2.34.1