From: Laura Abbott <labbott@redhat.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, daniel.vetter@ffwll.ch,
robdclark@gmail.com, treding@nvidia.com, sumit.semwal@linaro.org,
tom.cooksey@arm.com, daniel.stone@collabora.com,
linux-security-module@vger.kernel.org,
xiaoquan.li@vivantecorp.com
Cc: linaro-mm-sig@lists.linaro.org, tom.gall@linaro.org
Subject: Re: [PATCH v4 0/2] RFC: Secure Memory Allocation Framework
Date: Mon, 5 Oct 2015 19:07:46 -0700 [thread overview]
Message-ID: <56132CF2.3060902@redhat.com> (raw)
In-Reply-To: <1444039898-7927-1-git-send-email-benjamin.gaignard@linaro.org>
On 10/05/2015 03:11 AM, Benjamin Gaignard wrote:
> version 4 changes:
> - rebased on kernel 4.3-rc3
> - fix missing EXPORT_SYMBOL for smaf_create_handle()
>
> version 3 changes:
> - Remove ioctl for allocator selection instead provide the name of
> the targeted allocator with allocation request.
> Selecting allocator from userland isn't the prefered way of working
> but is needed when the first user of the buffer is a software component.
> - Fix issues in case of error while creating smaf handle.
> - Fix module license.
> - Update libsmaf and tests to care of the SMAF API evolution
> https://git.linaro.org/people/benjamin.gaignard/libsmaf.git
>
> version 2 changes:
> - Add one ioctl to allow allocator selection from userspace.
> This is required for the uses case where the first user of
> the buffer is a software IP which can't perform dma_buf attachement.
> - Add name and ranking to allocator structure to be able to sort them.
> - Create a tiny library to test SMAF:
> https://git.linaro.org/people/benjamin.gaignard/libsmaf.git
> - Fix one issue when try to secure buffer without secure module registered
>
> The outcome of the previous RFC about how do secure data path was the need
> of a secure memory allocator (https://lkml.org/lkml/2015/5/5/551)
>
> SMAF goal is to provide a framework that allow allocating and securing
> memory by using dma_buf. Each platform have it own way to perform those two
> features so SMAF design allow to register helper modules to perform them.
>
> To be sure to select the best allocation method for devices SMAF implement
> deferred allocation mechanism: memory allocation is only done when the first
> device effectively required it.
> Allocator modules have to implement a match() to let SMAF know if they are
> compatibles with devices needs.
> This patch set provide an example of allocator module which use
> dma_{alloc/free/mmap}_attrs() and check if at least one device have
> coherent_dma_mask set to DMA_BIT_MASK(32) in match function.
> I have named smaf-cma.c like it is done for drm_gem_cma_helper.c even if
> a better name could be found for this file.
>
> Secure modules are responsibles of granting and revoking devices access rights
> on the memory. Secure module is also called to check if CPU map memory into
> kernel and user address spaces.
> An example of secure module implementation can be found here:
> http://git.linaro.org/people/benjamin.gaignard/optee-sdp.git
> This code isn't yet part of the patch set because it depends on generic TEE
> which is still under discussion (https://lwn.net/Articles/644646/)
>
> For allocation part of SMAF code I get inspirated by Sumit Semwal work about
> constraint aware allocator.
>
Overall I like the abstraction. Do you have a use case in mind right now for
the best allocation method? Some of the classic examples (mmu vs. no mmu)
are gradually becoming less relevant as the systems have evolved. I was
discussing constraints with Sumit w.r.t. Ion at plumbers so I'm curious about
your uses.
Thanks,
Laura
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Laura Abbott <labbott@redhat.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, daniel.vetter@ffwll.ch,
robdclark@gmail.com, treding@nvidia.com, sumit.semwal@linaro.org,
tom.cooksey@arm.com, daniel.stone@collabora.com,
linux-security-module@vger.kernel.org,
xiaoquan.li@vivantecorp.com
Cc: tom.gall@linaro.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v4 0/2] RFC: Secure Memory Allocation Framework
Date: Mon, 5 Oct 2015 19:07:46 -0700 [thread overview]
Message-ID: <56132CF2.3060902@redhat.com> (raw)
In-Reply-To: <1444039898-7927-1-git-send-email-benjamin.gaignard@linaro.org>
On 10/05/2015 03:11 AM, Benjamin Gaignard wrote:
> version 4 changes:
> - rebased on kernel 4.3-rc3
> - fix missing EXPORT_SYMBOL for smaf_create_handle()
>
> version 3 changes:
> - Remove ioctl for allocator selection instead provide the name of
> the targeted allocator with allocation request.
> Selecting allocator from userland isn't the prefered way of working
> but is needed when the first user of the buffer is a software component.
> - Fix issues in case of error while creating smaf handle.
> - Fix module license.
> - Update libsmaf and tests to care of the SMAF API evolution
> https://git.linaro.org/people/benjamin.gaignard/libsmaf.git
>
> version 2 changes:
> - Add one ioctl to allow allocator selection from userspace.
> This is required for the uses case where the first user of
> the buffer is a software IP which can't perform dma_buf attachement.
> - Add name and ranking to allocator structure to be able to sort them.
> - Create a tiny library to test SMAF:
> https://git.linaro.org/people/benjamin.gaignard/libsmaf.git
> - Fix one issue when try to secure buffer without secure module registered
>
> The outcome of the previous RFC about how do secure data path was the need
> of a secure memory allocator (https://lkml.org/lkml/2015/5/5/551)
>
> SMAF goal is to provide a framework that allow allocating and securing
> memory by using dma_buf. Each platform have it own way to perform those two
> features so SMAF design allow to register helper modules to perform them.
>
> To be sure to select the best allocation method for devices SMAF implement
> deferred allocation mechanism: memory allocation is only done when the first
> device effectively required it.
> Allocator modules have to implement a match() to let SMAF know if they are
> compatibles with devices needs.
> This patch set provide an example of allocator module which use
> dma_{alloc/free/mmap}_attrs() and check if at least one device have
> coherent_dma_mask set to DMA_BIT_MASK(32) in match function.
> I have named smaf-cma.c like it is done for drm_gem_cma_helper.c even if
> a better name could be found for this file.
>
> Secure modules are responsibles of granting and revoking devices access rights
> on the memory. Secure module is also called to check if CPU map memory into
> kernel and user address spaces.
> An example of secure module implementation can be found here:
> http://git.linaro.org/people/benjamin.gaignard/optee-sdp.git
> This code isn't yet part of the patch set because it depends on generic TEE
> which is still under discussion (https://lwn.net/Articles/644646/)
>
> For allocation part of SMAF code I get inspirated by Sumit Semwal work about
> constraint aware allocator.
>
Overall I like the abstraction. Do you have a use case in mind right now for
the best allocation method? Some of the classic examples (mmu vs. no mmu)
are gradually becoming less relevant as the systems have evolved. I was
discussing constraints with Sumit w.r.t. Ion at plumbers so I'm curious about
your uses.
Thanks,
Laura
next prev parent reply other threads:[~2015-10-06 2:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 10:11 [PATCH v4 0/2] RFC: Secure Memory Allocation Framework Benjamin Gaignard
2015-10-05 10:11 ` [PATCH v4 1/2] create SMAF module Benjamin Gaignard
2015-10-05 10:11 ` Benjamin Gaignard
2015-10-05 22:02 ` kbuild test robot
2015-10-05 22:02 ` kbuild test robot
2015-10-06 1:58 ` Laura Abbott
2015-10-06 8:56 ` Benjamin Gaignard
2015-10-06 8:56 ` Benjamin Gaignard
2015-10-05 10:11 ` [PATCH v4 2/2] SMAF: add CMA allocator Benjamin Gaignard
2015-10-05 10:11 ` Benjamin Gaignard
2015-10-05 10:50 ` kbuild test robot
2015-10-05 10:50 ` kbuild test robot
2015-10-05 10:50 ` [RFC PATCH] SMAF: smaf_cma can be static kbuild test robot
2015-10-05 10:50 ` kbuild test robot
2015-10-05 11:50 ` [PATCH v4 2/2] SMAF: add CMA allocator kbuild test robot
2015-10-05 11:50 ` kbuild test robot
2015-10-06 2:07 ` Laura Abbott [this message]
2015-10-06 2:07 ` [PATCH v4 0/2] RFC: Secure Memory Allocation Framework Laura Abbott
2015-10-06 7:03 ` Benjamin Gaignard
2015-10-06 7:03 ` Benjamin Gaignard
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=56132CF2.3060902@redhat.com \
--to=labbott@redhat.com \
--cc=benjamin.gaignard@linaro.org \
--cc=daniel.stone@collabora.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=sumit.semwal@linaro.org \
--cc=tom.cooksey@arm.com \
--cc=tom.gall@linaro.org \
--cc=treding@nvidia.com \
--cc=xiaoquan.li@vivantecorp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.