Thread (44 messages) 44 messages, 9 authors, 2010-07-22

[RFC 1/3 v3] mm: iommu: An API to unify IOMMU, CPU and device memory management

From: fujita.tomonori@lab.ntt.co.jp (FUJITA Tomonori)
Date: 2010-07-13 06:04:23
Also in: linux-arch, linux-arm-msm, linux-mm, linux-omap, lkml

On Mon, 12 Jul 2010 22:57:06 -0700
Zach Pfeffer [off-list ref] wrote:
FUJITA Tomonori wrote:
quoted
On Thu, 08 Jul 2010 16:59:52 -0700
Zach Pfeffer [off-list ref] wrote:
quoted
The problem I'm trying to solve boils down to this: map a set of
contiguous physical buffers to an aligned IOMMU address. I need to
allocate the set of physical buffers in a particular way: use 1 MB
contiguous physical memory, then 64 KB, then 4 KB, etc. and I need to
align the IOMMU address in a particular way.
Sounds like the DMA API already supports what you want.

You can set segment_boundary_mask in struct device_dma_parameters if
you want to align the IOMMU address. See IOMMU implementations that
support dma_get_seg_boundary() properly.
That function takes the wrong argument in a VCM world:

unsigned long dma_get_seg_boundary(struct device *dev);

The boundary should be an attribute of the device side mapping,
independent of the device. This would allow better code reuse.
You mean that you want to specify this alignment attribute every time
you create an IOMMU mapping? Then you can set segment_boundary_mask
every time you create an IOMMU mapping. It's odd but it should work.

Another possible solution is extending struct dma_attrs. We could add
the alignment attribute to it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help