Re: [PATCH] x86: enable DMA CMA with swiotlb

From: Akinobu Mita
Date: Sat Nov 23 2013 - 08:59:33 EST


2013/11/23 H. Peter Anvin <hpa@xxxxxxxxx>:
> On 11/22/2013 04:27 AM, Akinobu Mita wrote:
>>
>> I'm currently working for integrating DMA CMA with intel-iommu which
>> I can test. Regardless of which dma ops is actually used, I would
>> like to allocate large contiguous memory with dma_alloc_coherent()
>> and tell the base address to the device.
>>
>> We can use mem= or crashkernel= to reserve host memory, but it is
>> complicated and unables to work with real IOMMU.
>>
>
> If you have a real iotlb, why would you need contiguous memory?

Because allocating large memory by dma_alloc_coherent() with intel-iommu
fails. intel_alloc_coherent() allocates memory by alloc_pages() and
then maps it by __intel_map_single().

What I'm trying change wit inte-iommu is adding the same scheme done
by dma_generic_alloc_coherent(), i.e. trying to allocate memory by
dma_alloc_from_contiguous() and alloc_pages() is used as a fallback.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/