RFC KVM PCIe/MSI passthrough on ARM/ARM64: re-design with transparent MSI mapping
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest11 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | iommu: Add iommu_domain_msi_geometry and DOMAIN_ATTR_MSI_GEOMETRYdrivers/ include/ | +18 | 0 replies | |
| 2/11 | iommu: Introduce IOMMU_CAP_TRANSLATE_MSI capabilityinclude/ | +1 | 0 replies | |
| 3/11 | iommu: Introduce IOMMU_DOMAIN_MIXEDinclude/ | +9 | 0 replies | |
| 4/11 | iommu/dma: Allow MSI-only cookiesdrivers/ include/ | +52 | 0 replies | |
| 5/11 | iommu/dma: iommu_dma_(un)map_mixeddrivers/ include/ | +66 | 5 replies | |
| 6/11 | iommu/arm-smmu: Allow IOMMU_DOMAIN_MIXED domain allocationdrivers/ drivers/ | +4 | 0 replies | |
| 7/11 | iommu: Use IOMMU_DOMAIN_MIXED typed domain when IOMMU translates MSIdrivers/ | +4 | 0 replies | |
| 8/11 | vfio/type1: Sets the IOVA window in case MSI IOVA need to be allocateddrivers/ | +6 | 0 replies | |
| 9/11 | vfio/type1: Reserve IOVAs for IOMMU_DOMAIN_MIXED domainsdrivers/ | +35 | 0 replies | |
| 10/11 | iommu/arm-smmu: Do not advertise IOMMU_CAP_INTR_REMAPdrivers/ drivers/ | +4 | 0 replies | |
| 11/11 | iommu/arm-smmu: Advertise IOMMU_CAP_TRANSLATE_MSIdrivers/ drivers/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 00/11] KVM PCIe/MSI passthrough on ARM/ARM64: re-design with transparent MSI mapping
Following Robin's series [1] addressing MSI IOMMU mapping for devices attached to a DMA ops domain, my previous 3 part series (v12) lost most of its consistency. msi-iommu API role now is handled at dma-iommu level while MSI doorbell registration API only is used for security assessment. Also MSI layer part is not needed anymore since mapping directly is done in the compose callback.
Here I propose an alternative approach, based on [1]. This approach was discussed at the KVM forum with Christoffer Dall and Marc Zyngier, and was suggested by Christoffer. The idea is we could let the iommu layer transparently allocate MSI frame IOVAs in the holes left between UNMANAGED iova slots, set by the iommu-api user.
This series introduces a new IOMMU domain type that allows mixing of unmanaged and managed IOVA slots. We define an IOVA domain whose aperture covers the GPA address range. Each time the IOMMU-API user maps iova/pa, we reserve the IOVA range to prevent the iova allocator from using it for MSI mapping.
This simplifies the user part which does not need anymore to provide an IOVA aperture anymore.
The current series does not address the interrupt safety assessment, which may be considered as a separate issue. Currently the assignemnt is considered as unsafe, on ARM (even with a GICv3 ITS).
Please let me know what is your feeling wrt this alternative approach.
dependency:
[1] [PATCH v7 00/22] Generic DT bindings for PCI IOMMUs and ARM SMMU
http://www.spinics.net/lists/arm-kernel/msg531110.html
Best Regards
Eric
Testing:
- functional on ARM64 AMD Overdrive HW (single GICv2m frame). Lack of contexts prevents me from testing multiple assignment.
Git: complete series available at
https://github.com/eauger/linux/tree/generic-v7-pcie-passthru-redesign-rfc
previous: https://github.com/eauger/linux/tree/v4.7-rc7-passthrough-v12
the above branch includes a temporary patch to work around a ThunderX pci bus reset crash (which I think unrelated to this series):
"vfio: pci: HACK! workaround thunderx pci_try_reset_bus crash" Do not take this one for other platforms.
Eric Auger (10):
iommu: Add iommu_domain_msi_geometry and DOMAIN_ATTR_MSI_GEOMETRY
iommu: Introduce IOMMU_CAP_TRANSLATE_MSI capability
iommu: Introduce IOMMU_DOMAIN_MIXED
iommu/dma: iommu_dma_(un)map_mixed
iommu/arm-smmu: Allow IOMMU_DOMAIN_MIXED domain allocation
iommu: Use IOMMU_DOMAIN_MIXED typed domain when IOMMU translates MSI vfio/type1: Sets the IOVA window in case MSI IOVA need to be allocated vfio/type1: Reserve IOVAs for IOMMU_DOMAIN_MIXED domains iommu/arm-smmu: Do not advertise IOMMU_CAP_INTR_REMAP iommu/arm-smmu: Advertise IOMMU_CAP_TRANSLATE_MSI
Robin Murphy (1):
iommu/dma: Allow MSI-only cookies
drivers/iommu/arm-smmu-v3.c | 8 +++- drivers/iommu/arm-smmu.c | 8 +++- drivers/iommu/dma-iommu.c | 91 +++++++++++++++++++++++++++++++++++++++++ drivers/iommu/iommu.c | 10 ++++- drivers/vfio/vfio_iommu_type1.c | 48 ++++++++++++++++++---- include/linux/dma-iommu.h | 27 ++++++++++++ include/linux/iommu.h | 23 +++++++++++ 7 files changed, 203 insertions(+), 12 deletions(-)
Signature · 1 line
1.9.1