linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Inki Dae <daeinki@gmail.com>
To: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: "inki.dae@samsung.com" <inki.dae@samsung.com>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [Linaro-mm-sig] [RFC 0/2] DMA-mapping & IOMMU - physically contiguous allocations
Date: Wed, 17 Oct 2012 07:54:17 +0900	[thread overview]
Message-ID: <A52B7C89-16F2-44A0-A9FF-2EB599F4F074@gmail.com> (raw)
In-Reply-To: <20121016.171338.1300372057637804407.hdoyu@nvidia.com>

Hi Hiroshi,



2012. 10. 16. 오후 11:13 Hiroshi Doyu <hdoyu@nvidia.com> 작성:

> Hi Inki,
> 
> Inki Dae <inki.dae@samsung.com> wrote @ Tue, 16 Oct 2012 12:12:49 +0200:
> 
>> Hi Hiroshi,
>> 
>> 2012/10/16 Hiroshi Doyu <hdoyu@nvidia.com>:
>>> Hi Inki/Marek,
>>> 
>>> On Tue, 16 Oct 2012 02:50:16 +0200
>>> Inki Dae <inki.dae@samsung.com> wrote:
>>> 
>>>> 2012/10/15 Marek Szyprowski <m.szyprowski@samsung.com>:
>>>>> Hello,
>>>>> 
>>>>> Some devices, which have IOMMU, for some use cases might require to
>>>>> allocate a buffers for DMA which is contiguous in physical memory. Such
>>>>> use cases appears for example in DRM subsystem when one wants to improve
>>>>> performance or use secure buffer protection.
>>>>> 
>>>>> I would like to ask if adding a new attribute, as proposed in this RFC
>>>>> is a good idea? I feel that it might be an attribute just for a single
>>>>> driver, but I would like to know your opinion. Should we look for other
>>>>> solution?
>>>>> 
>>>> 
>>>> In addition, currently we have worked dma-mapping-based iommu support
>>>> for exynos drm driver with this patch set so this patch set has been
>>>> tested with iommu enabled exynos drm driver and worked fine. actually,
>>>> this feature is needed for secure mode such as TrustZone. in case of
>>>> Exynos SoC, memory region for secure mode should be physically
>>>> contiguous and also maybe OMAP but now dma-mapping framework doesn't
>>>> guarantee physically continuous memory allocation so this patch set
>>>> would make it possible.
>>> 
>>> Agree that the contigous memory allocation is necessary for us too.
>>> 
>>> In addition to those contiguous/discontiguous page allocation, is
>>> there any way to _import_ anonymous pages allocated by a process to be
>>> used in dma-mapping API later?
>>> 
>>> I'm considering the following scenario, an user process allocates a
>>> buffer by malloc() in advance, and then it asks some driver to convert
>>> that buffer into IOMMU'able/DMA'able ones later. In this case, pages
>>> are discouguous and even they may not be yet allocated at
>>> malloc()/mmap().
>>> 
>> 
>> I'm not sure I understand what you mean but we had already tried this
>> way and for this, you can refer to below link,
>>               http://www.mail-archive.com/dri-devel@lists.freedesktop.org/msg22555.html
> 
> The above patch doesn't seem to have so much platform/SoC specific
> code but rather it could common over other SoC as well. Is there any
> plan to make it more generic, which can be used by other DRM drivers?
> 

Right, the above patch has no any platform/SoC specific code but doesn't use dma-mapping API . Anyway we should refrain from using such thing because gem object could still be used and shared with other processes even if user process freed user region allocated by malloc()

And our new patch in progress would resolve this issue and this way is similar to drm-based via driver of mainline kernel. And this patch isn't considered for common use and is specific to platform/SoC so much. The pages backed can be used only by 2d gpu's dma.

Thanks,
Inki Dae

> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-10-16 22:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 14:03 Marek Szyprowski
2012-10-15 14:03 ` [RFC 1/2] common: DMA-mapping: add DMA_ATTR_FORCE_CONTIGUOUS attribute Marek Szyprowski
2012-10-15 14:03 ` [RFC 2/2] ARM: dma-mapping: add support for " Marek Szyprowski
2012-10-16  0:50 ` [RFC 0/2] DMA-mapping & IOMMU - physically contiguous allocations Inki Dae
2012-10-16  6:04   ` [Linaro-mm-sig] " Hiroshi Doyu
2012-10-16  8:59     ` Russell King - ARM Linux
2012-10-16 10:04       ` Catalin Marinas
2012-10-16 10:27       ` Hiroshi Doyu
2012-10-16 10:37         ` Russell King - ARM Linux
2012-10-16 10:12     ` Inki Dae
2012-10-16 10:31       ` Russell King - ARM Linux
2012-10-16 11:11         ` Inki Dae
2012-10-16 14:13       ` Hiroshi Doyu
2012-10-16 22:54         ` Inki Dae [this message]
2012-10-16  9:30 ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A52B7C89-16F2-44A0-A9FF-2EB599F4F074@gmail.com \
    --to=daeinki@gmail.com \
    --cc=arnd@arndb.de \
    --cc=hdoyu@nvidia.com \
    --cc=inki.dae@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox