Skip to contentSkip to conversation

per-device dma_map_ops for intel-iommu?

DISCUSSION Christoph Hellwig 3 participants 3 messages Apr 9, 2019 – Apr 11, 2019

lore
Share & tools
lore
#0 lore raw

Hi David and Joerg,

do you remember a good reason why intel-iommu is not using per-device dma_map_ops like the AMD iommu or the various ARM iommus?

Right now intel-iommu.c contains a half-asses reimplementation of the dma direct code for the iommu_no_mapping() case, and it would seem much nicer to just fall back to that case and not even call into intel-iommu in that case.

#1 lore raw
Quoted 9 lines · Christoph Hellwig

Hi David and Joerg,

do you remember a good reason why intel-iommu is not using per-device dma_map_ops like the AMD iommu or the various ARM iommus?

Right now intel-iommu.c contains a half-asses reimplementation of the dma direct code for the iommu_no_mapping() case, and it would seem much nicer to just fall back to that case and not even call into intel-iommu in that case.

Other than the complexities about passthrough mode and various "oh shit we forgot to actually test that iommu+gfx actually works before shipping hardware" type of quirks that bypass the IOMMU for certain devices — and retpolines, which I think you already dealt with — no, no good reason that I recall.

#2 lore raw
Quoted 11 lines · David Woodhouse
Quoted 9 lines · Christoph Hellwig

Hi David and Joerg,

do you remember a good reason why intel-iommu is not using per-device dma_map_ops like the AMD iommu or the various ARM iommus?

Right now intel-iommu.c contains a half-asses reimplementation of the dma direct code for the iommu_no_mapping() case, and it would seem much nicer to just fall back to that case and not even call into intel-iommu in that case.

Quoted 5 lines

Other than the complexities about passthrough mode and various "oh shit we forgot to actually test that iommu+gfx actually works before shipping hardware" type of quirks that bypass the IOMMU for certain devices — and retpolines, which I think you already dealt with — no, no good reason that I recall.

Same here, I looked into this in the past as well, but I can't recall any reason this was left in place.

Joerg