1. 05 Apr, 2016 1 commit
  2. 07 Jan, 2016 1 commit
    • Robin Murphy's avatar
      iommu/dma: Use correct offset in map_sg · 164afb1d
      Robin Murphy authored
      
      
      When mapping a non-page-aligned scatterlist entry, we copy the original
      offset to the output DMA address before aligning it to hand off to
      iommu_map_sg(), then later adding the IOVA page address portion to get
      the final mapped address. However, when the IOVA page size is smaller
      than the CPU page size, it is the offset within the IOVA page we want,
      not that within the CPU page, which can easily be larger than an IOVA
      page and thus result in an incorrect final address.
      
      Fix the bug by taking only the IOVA-aligned part of the offset as the
      basis of the DMA address, not the whole thing.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      164afb1d
  3. 28 Dec, 2015 2 commits
  4. 15 Oct, 2015 1 commit
    • Robin Murphy's avatar
      iommu: Implement common IOMMU ops for DMA mapping · 0db2e5d1
      Robin Murphy authored
      
      
      Taking inspiration from the existing arch/arm code, break out some
      generic functions to interface the DMA-API to the IOMMU-API. This will
      do the bulk of the heavy lifting for IOMMU-backed dma-mapping.
      
      Since associating an IOVA allocator with an IOMMU domain is a fairly
      common need, rather than introduce yet another private structure just to
      do this for ourselves, extend the top-level struct iommu_domain with the
      notion. A simple opaque cookie allows reuse by other IOMMU API users
      with their various different incompatible allocator types.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      0db2e5d1