Skip to content

RFC arm64: IOMMU-backed DMA mapping

Marek Szyprowski linux-arm-kernel linux-iommu 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 of 5 patches 0 repliesNew

1 of 5 patches is in this archive. The cover letter announces 5.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
4/5arm64: add IOMMU dma_ops+0 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/5] arm64: IOMMU-backed DMA mapping

Hello,

Quoted 8 lines · Robin Murphy

Hi all,

Whilst it's a long way off perfect, this has reached the point of being functional and stable enough to be useful, so here it is. The core consists of the meat of the arch/arm implementation modified to remove the assumption of PAGE_SIZE pages and ported over to the Intel IOVA allocator instead of the bitmap-based one. For that, this series depends on my "Genericise the IOVA allocator" series posted earlier[1].

I've tested your patches on Exynos 5433 based system and I have a few comments. To get them working I had to do some fixes. Most of them are already reported in this thread, the remaining I will send in a few minutes.

Do you plan to send an updated patchset?

Quoted 11 lines

There are plenty of obvious things still to do, including:

* Domain and group handling is all wrong, but that's a bigger problem. For the moment it does more or less the same thing as the arch/arm code, which at least works for the one-IOMMU-per-device situation.
* IOMMU domains and IOVA domains probably want to be better integrated with devices and each other, rather than having a proliferation of arch-specific structs.
* The temporary map_sg implementation - I have a 'proper' iommu_map_sg based one in progress, but since the simple one works it's not been as high a priority.

Well, for ARM arch this was the main feature of IOMMU and DMA-mapping integration. It is heavily used by some multimedia devices and dma-buf realted stuff to get a scattered buffer mapped into contiguous IO address space.

Quoted 2 lines

* Port arch/arm over to it. I'd guess it might be preferable to merge this through arm64 first, though, rather than overcomplicate matters.

I think that the code in arch/arm is already quite well tested and can be almost directly reused for common dma-mapping helpers.

Quoted 7 lines

* There may well be scope for streamlining and tidying up the copied parts - In general I've simply avoided touching anything I don't fully understand.
* In the same vein, I'm sure lots of it is fairly ARM-specific, so will need longer-term work to become truly generic.

[1]:http://thread.gmane.org/gmane.linux.kernel.iommu/8208

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland