Re: [PATCH] Properly check tee_shm buffer mmap offset

2020-11-24 Thread Jens Wiklander
Hi, On Mon, Nov 23, 2020 at 8:10 AM gaoyusong wrote: > > The memmap options in tee_shm_op_mmap were not being checked for all > sets of possible crazy values. Fix this up by properly check tee_shm > buffer offsets. > > Signed-off-by: gaoyusong > --- > drivers/tee/tee_shm.c | 10 ++ > 1

Re: [PATCH v16 14/16] tee, arm64: untag user pointers in tee_shm_register

2019-06-07 Thread Jens Wiklander
;optee_shm_unregister()->check_mem_type() uses provided > user pointers for vma lookups (via __check_mem_type()), which can only by > done with untagged pointers. > > Untag user pointers in this function. > > Signed-off-by: Andrey Konovalov Acked-by: Jens Wiklander > --- >

Re: [PATCH 16/34] drivers/tee: convert put_page() to put_user_page*()

2019-08-02 Thread Jens Wiklander
, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). > > Cc: Jens Wiklander > Signed-off-by: John Hubbard > --- > drivers/tee/tee_shm.c | 10 ++ > 1 file changed, 2 insertions(+), 8 deletions(-) Acked-by: Jens Wiklan

Re: [PATCH v2 0/1] tee: Add tee_shm_register_fd

2022-08-16 Thread Jens Wiklander
Hi Olivier, On Fri, Aug 12, 2022 at 4:31 PM Olivier Masse wrote: > > Add a new ioctl called TEE_IOC_SHM_REGISTER_FD to register a > shared memory from a dmabuf file descriptor. > This new ioctl will allow the Linux Kernel to register a buffer > to be used by the Secure Data Path OPTEE OS feature.

Re: [PATCH 12/15] drm/tee_shm: Drop dma_buf_k(unmap) support

2019-11-19 Thread Jens Wiklander
On Mon, Nov 18, 2019 at 11:35:33AM +0100, Daniel Vetter wrote: > There's no in-tree users anymore. > > Signed-off-by: Daniel Vetter > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Cc: Jens Wiklander > Cc: tee-...@lists.linaro.org > -- > Ack for merging

Re: [EXT] Re: [PATCH v2 1/1] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2023-02-13 Thread Jens Wiklander
st%2Fsdp_ba > >>> sic.c%23L153&data=05%7C01%7Ccyrille.fleury%40nxp.com%7C9ff962fb58f640 > >>> 1c597808db05e2a64b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63811 > >>> 0243232457377%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l >

Re: [EXT] Re: [PATCH v2 1/1] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2023-02-13 Thread Jens Wiklander
> >> >>> Kernel version 5.11 and higher. the userland allocation could be find > >> >>> here: > >> >>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F > >> >>> git%2F&data=05%7C01%7Ccyrille.fleury%40nxp.

Re: [PATCH v3] tee: convert convert get_user_pages() --> pin_user_pages()

2020-08-26 Thread Jens Wiklander
gt; > There is some helpful background in [2]: basically, this is a small > part of fixing a long-standing disconnect between pinning pages, and > file systems' use of those pages. > > [1] Documentation/core-api/pin_user_pages.rst > > [2] "Explicit pinning of user-

Re: [PATCH v3] tee: convert convert get_user_pages() --> pin_user_pages()

2020-08-26 Thread Jens Wiklander
On Tue, Aug 25, 2020 at 10:54 AM John Hubbard wrote: > > On 8/25/20 1:32 AM, Jens Wiklander wrote: > > On Mon, Aug 24, 2020 at 02:11:25PM -0700, John Hubbard wrote: > ... > >> OK, one more try, this time actually handling the _USER_MAPPED vs. > >> _KERNEL_MAPPED p

Re: [PATCH v2] tee: convert get_user_pages() --> pin_user_pages()

2020-05-27 Thread Jens Wiklander
gt; [2] "Explicit pinning of user-space pages": > https://lwn.net/Articles/807108/ > > Cc: Jens Wiklander > Cc: Sumit Semwal > Cc: tee-...@lists.linaro.org > Cc: linux-me...@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linaro-mm-...@lists.lina

Re: [PATCH v5 7/9] dma-buf: heaps: restricted_heap: Add MediaTek restricted heap and heap_init

2024-08-22 Thread Jens Wiklander
On Wed, May 15, 2024 at 1:25 PM Yong Wu wrote: > > Add a MediaTek restricted heap which uses TEE service call to restrict > buffer. Currently this restricted heap is NULL, Prepare for the later > patch. Mainly there are two changes: > a) Add a heap_init ops since TEE probe late than restricted hea

[RFC PATCH 0/4] Linaro restricted heap

2024-08-30 Thread Jens Wiklander
uot;secure" with "restricted" where applicable Etienne Carriere (1): tee: new ioctl to a register tee_shm from a dmabuf file descriptor Jens Wiklander (2): dma-buf: heaps: restricted_heap: add no_map attribute dma-buf: heaps: add Linaro restricted dmabuf heap support Olivier

[RFC PATCH 2/4] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2024-08-30 Thread Jens Wiklander
identify tee_shm objects built from a registered dmabuf, TEE_SHM_DMA_BUF. Signed-off-by: Etienne Carriere Signed-off-by: Olivier Masse Signed-off-by: Jens Wiklander --- drivers/tee/tee_core.c | 38 ++ drivers/tee/tee_shm.c| 104 +-- include/linux

[RFC PATCH 1/4] dma-buf: heaps: restricted_heap: add no_map attribute

2024-08-30 Thread Jens Wiklander
Add a no_map attribute to struct restricted_heap_attachment and struct restricted_heap to skip the call to dma_map_sgtable() if set. This avoids trying to map a dma-buf that doens't refer to memory accessible by the kernel. Signed-off-by: Jens Wiklander --- drivers/dma-buf/

[RFC PATCH 3/4] dt-bindings: reserved-memory: add linaro, restricted-heap

2024-08-30 Thread Jens Wiklander
From: Olivier Masse DMABUF reserved memory definition for OP-TEE secure data path feature. Signed-off-by: Olivier Masse Signed-off-by: Jens Wiklander --- .../linaro,restricted-heap.yaml | 56 +++ 1 file changed, 56 insertions(+) create mode 100644

[RFC PATCH 4/4] dma-buf: heaps: add Linaro restricted dmabuf heap support

2024-08-30 Thread Jens Wiklander
with the TEE subsystem for later use via Trusted Applications in the secure world. Co-developed-by: Olivier Masse Signed-off-by: Olivier Masse Signed-off-by: Jens Wiklander --- drivers/dma-buf/heaps/Kconfig | 10 ++ drivers/dma-buf/heaps/Makefile| 1 + .../dma

Re: [RFC PATCH 3/4] dt-bindings: reserved-memory: add linaro, restricted-heap

2024-08-30 Thread Jens Wiklander
On Fri, Aug 30, 2024 at 10:20 AM Krzysztof Kozlowski wrote: > > On Fri, Aug 30, 2024 at 09:03:50AM +0200, Jens Wiklander wrote: > > From: Olivier Masse > > > > DMABUF reserved memory definition for OP-TEE secure data path feature. > > > > Signed-off-by: Ol

Re: [RFC PATCH 4/4] dma-buf: heaps: add Linaro restricted dmabuf heap support

2024-09-04 Thread Jens Wiklander
On Tue, Sep 3, 2024 at 7:50 PM T.J. Mercier wrote: > > On Fri, Aug 30, 2024 at 12:04 AM Jens Wiklander > wrote: > > > > Add a Linaro restricted heap using the linaro,restricted-heap bindings > > implemented based on the generic restricted heap. > > > > T

Re: [RFC PATCH 2/4] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2024-09-04 Thread Jens Wiklander
On Tue, Sep 3, 2024 at 7:50 PM T.J. Mercier wrote: > > On Fri, Aug 30, 2024 at 12:04 AM Jens Wiklander > wrote: > > > > From: Etienne Carriere > > > > Enable userspace to create a tee_shm object that refers to a dmabuf > > reference. > > > > U

Re: [RFC PATCH 1/4] dma-buf: heaps: restricted_heap: add no_map attribute

2024-09-04 Thread Jens Wiklander
On Fri, Aug 30, 2024 at 10:47 AM Christian König wrote: > > Am 30.08.24 um 09:03 schrieb Jens Wiklander: > > Add a no_map attribute to struct restricted_heap_attachment and struct > > restricted_heap to skip the call to dma_map_sgtable() if set. This > > avoids tryi

Re: [PATCH RFC 0/3] Implement Qualcomm TEE IPC and ioctl calls

2024-07-17 Thread Jens Wiklander
Hi, On Wed, Jul 10, 2024 at 1:17 AM Amirreza Zarrabi wrote: > > > > On 7/3/2024 9:36 PM, Dmitry Baryshkov wrote: > > On Tue, Jul 02, 2024 at 10:57:35PM GMT, Amirreza Zarrabi wrote: > >> Qualcomm TEE hosts Trusted Applications (TAs) and services that run in > >> the secure world. Access to these r

Re: [RFC PATCH 4/4] dma-buf: heaps: add Linaro restricted dmabuf heap support

2024-09-09 Thread Jens Wiklander
On Wed, Sep 4, 2024 at 11:42 PM T.J. Mercier wrote: > > On Wed, Sep 4, 2024 at 2:44 AM Jens Wiklander > wrote: > > > > On Tue, Sep 3, 2024 at 7:50 PM T.J. Mercier wrote: > > > > > > On Fri, Aug 30, 2024 at 12:04 AM Jens Wiklander > > > wrote: &g

Re: [RFC PATCH 4/4] dma-buf: heaps: add Linaro restricted dmabuf heap support

2024-09-10 Thread Jens Wiklander
On Tue, Sep 10, 2024 at 5:08 PM T.J. Mercier wrote: > > On Mon, Sep 9, 2024 at 11:06 PM Jens Wiklander > wrote: > > > > On Wed, Sep 4, 2024 at 11:42 PM T.J. Mercier wrote: > > > > > > On Wed, Sep 4, 2024 at 2:44 AM Jens Wiklander > > > wrote: &g

[RFC PATCH v2 0/2] TEE subsystem for restricted dma-buf allocations

2024-10-15 Thread Jens Wiklander
ng Wu's post [1] where much of dma-buf handling is done in the generic restricted heap * Simplifications and cleanup * New commit message for "dma-buf: heaps: add Linaro restricted dmabuf heap support" * Replaced the word "secure" with "restricted" where app

[RFC PATCH v2 1/2] tee: add restricted memory allocation

2024-10-15 Thread Jens Wiklander
Data Path or Trusted UI where certain hardware devices can access the memory. Signed-off-by: Jens Wiklander --- drivers/tee/Makefile | 1 + drivers/tee/tee_core.c | 33 +- drivers/tee/tee_private.h | 2 + drivers/tee/tee_rstmem.c | 200

[RFC PATCH v2 2/2] optee: support restricted memory allocation

2024-10-15 Thread Jens Wiklander
. Signed-off-by: Jens Wiklander --- drivers/tee/optee/core.c | 21 +++ drivers/tee/optee/optee_private.h | 6 + drivers/tee/optee/optee_smc.h | 35 drivers/tee/optee/smc_abi.c | 45 --- 4 files changed, 104

Re: [RFC PATCH v2 0/2] TEE subsystem for restricted dma-buf allocations

2024-10-18 Thread Jens Wiklander
On Thu, Oct 17, 2024 at 12:46 PM Sumit Garg wrote: > > Hi Jens, > > On Tue, 15 Oct 2024 at 15:47, Jens Wiklander > wrote: > > > > Hi, > > > > This patch set allocates the restricted DMA-bufs via the TEE subsystem. > > This a complete rewrite comp

Re: [RFC PATCH v2 2/2] optee: support restricted memory allocation

2024-10-18 Thread Jens Wiklander
Hi Sumit, On Thu, Oct 17, 2024 at 1:00 PM Sumit Garg wrote: > > Hi Jens, > > On Tue, 15 Oct 2024 at 15:47, Jens Wiklander > wrote: > > > > Add support in the OP-TEE backend driver for restricted memory > > allocation. The support is limited to only the SMC ABI

Re: [RFC PATCH 0/4] Linaro restricted heap

2024-09-25 Thread Jens Wiklander
On Mon, Sep 23, 2024 at 09:33:29AM +0300, Dmitry Baryshkov wrote: > Hi, > > On Fri, Aug 30, 2024 at 09:03:47AM GMT, Jens Wiklander wrote: > > Hi, > > > > This patch set is based on top of Yong Wu's restricted heap patch set [1]. > > It's also a contin

Re: [RFC PATCH 0/4] Linaro restricted heap

2024-09-25 Thread Jens Wiklander
Hi, On Tue, Sep 24, 2024 at 01:13:18PM -0500, Andrew Davis wrote: > On 9/23/24 1:33 AM, Dmitry Baryshkov wrote: > > Hi, > > > > On Fri, Aug 30, 2024 at 09:03:47AM GMT, Jens Wiklander wrote: > > > Hi, > > > > > > This patch set is based

Re: [Linaro-mm-sig] Re: [RFC PATCH 0/4] Linaro restricted heap

2024-09-26 Thread Jens Wiklander
> >> On Tue, Sep 24, 2024 at 01:13:18PM GMT, Andrew Davis wrote: > >> > >> On 9/23/24 1:33 AM, Dmitry Baryshkov wrote: > >> > >> Hi, > >> > >> On Fri, Aug 30, 2024 at 09:03:47AM GMT, Jens Wiklander wrote: > >> >

Re: [RFC PATCH 0/4] Linaro restricted heap

2024-09-25 Thread Jens Wiklander
On Wed, Sep 25, 2024 at 1:41 PM Dmitry Baryshkov wrote: > > On Wed, Sep 25, 2024 at 09:15:04AM GMT, Jens Wiklander wrote: > > On Mon, Sep 23, 2024 at 09:33:29AM +0300, Dmitry Baryshkov wrote: > > > Hi, > > > > > > On Fri, Aug 30, 2024 at 09:03:47A

[PATCH v3 4/4] optee: support restricted memory allocation

2024-11-28 Thread Jens Wiklander
x27;t support the requested use-case of restricted memory. Signed-off-by: Jens Wiklander --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/core.c | 1 + drivers/tee/optee/ffa_abi.c | 135 ++- drivers/tee/optee/optee_private.h | 33 ++- drivers/tee/optee/rst

[PATCH v3 0/4] TEE subsystem for restricted dma-buf allocations

2024-11-28 Thread Jens Wiklander
and cleanup * New commit message for "dma-buf: heaps: add Linaro restricted dmabuf heap support" * Replaced the word "secure" with "restricted" where applicable Jens Wiklander (4): tee: add restricted memory allocation optee: account for direction while conve

[PATCH v3 3/4] optee: sync secure world ABI headers

2024-11-28 Thread Jens Wiklander
Update the header files describing the secure world ABI, both with and without FF-A. The ABI is extended to deal with restricted memory, but as usual backward compatible. Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_ffa.h | 27 ++--- drivers/tee/optee/optee_msg.h | 65

[PATCH v3 2/4] optee: account for direction while converting parameters

2024-11-28 Thread Jens Wiklander
st be copied. Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c | 10 ++-- drivers/tee/optee/ffa_abi.c | 43 + drivers/tee/optee/optee_private.h | 42 +++-- drivers/tee/optee/rpc.c | 31 + drivers/tee/optee/smc_abi.c

[PATCH v3 1/4] tee: add restricted memory allocation

2024-11-28 Thread Jens Wiklander
Playback, Trusted UI, or Secure Video Recording where certain hardware devices can access the memory. More use-cases can be added in userspace ABI, but it's up to the backend drivers to provide the implementation. Signed-off-by: Jens Wiklander --- drivers/tee/Makefile | 1 + driver

Re: [PATCH v3 2/4] optee: account for direction while converting parameters

2024-12-03 Thread Jens Wiklander
Hi Sumit, On Tue, Dec 3, 2024 at 9:27 AM Sumit Garg wrote: > > Hi Jens, > > On Thu, 28 Nov 2024 at 20:39, Jens Wiklander > wrote: > > > > The OP-TEE backend driver has two internal function pointers to convert > > between the subsystem type struct tee

Re: [PATCH v3 2/4] optee: account for direction while converting parameters

2024-12-05 Thread Jens Wiklander
On Tue, Dec 3, 2024 at 11:35 AM Sumit Garg wrote: > > On Tue, 3 Dec 2024 at 15:58, Jens Wiklander wrote: > > > > Hi Sumit, > > > > On Tue, Dec 3, 2024 at 9:27 AM Sumit Garg wrote: > > > > > > Hi Jens, > > > > > > On Thu, 28 Nov 2

Re: [PATCH v3 4/4] optee: support restricted memory allocation

2024-12-05 Thread Jens Wiklander
Hi Sumit, On Tue, Dec 3, 2024 at 9:19 AM Sumit Garg wrote: > > Hi Jens, > > On Thu, 28 Nov 2024 at 20:39, Jens Wiklander > wrote: > > > > Add support in the OP-TEE backend driver for restricted memory > > allocation. > > > > The restricted memory

[PATCH v4 1/6] tee: add restricted memory allocation

2024-12-17 Thread Jens Wiklander
Video Playback, Trusted UI, or Secure Video Recording where certain hardware devices can access the memory. More use-cases can be added in userspace ABI, but it's up to the backend drivers to provide the implementation. Signed-off-by: Jens Wiklander --- drivers/tee/Makefile

[PATCH v4 2/6] optee: account for direction while converting parameters

2024-12-17 Thread Jens Wiklander
st be copied. This is needed in a later patch where it might get confusing when converting back in from_msg_param() callback since an allocated restricted SHM can be using the sec_world_id of the used restricted memory pool and that doesn't translate back well. Signed-off-by: Jens Wiklander --

[PATCH v4 3/6] optee: sync secure world ABI headers

2024-12-17 Thread Jens Wiklander
Update the header files describing the secure world ABI, both with and without FF-A. The ABI is extended to deal with restricted memory, but as usual backward compatible. Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_ffa.h | 27 ++--- drivers/tee/optee/optee_msg.h | 65

[PATCH v4 4/6] optee: support restricted memory allocation

2024-12-17 Thread Jens Wiklander
. Signed-off-by: Jens Wiklander --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/core.c | 1 + drivers/tee/optee/optee_private.h | 23 ++ drivers/tee/optee/rstmem.c| 76 +++ drivers/tee/optee/smc_abi.c | 69

[PATCH v4 6/6] optee: smc abi: dynamic restricted memory allocation

2024-12-17 Thread Jens Wiklander
Add support in the OP-TEE backend driver for dynamic restricted memory allocation using the SMC ABI. Signed-off-by: Jens Wiklander --- drivers/tee/optee/smc_abi.c | 74 +++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/drivers/tee/optee

[PATCH v4 5/6] optee: FF-A: dynamic restricted memory allocation

2024-12-17 Thread Jens Wiklander
icted memory. Restricted memory pools based on a static carveout or dynamic allocation can coexist for different use-cases. We use only dynamic allocation with FF-A. Signed-off-by: Jens Wiklander --- drivers/tee/optee/ffa_abi.c | 135 - drivers/tee/optee/optee_private.h

[PATCH v4 0/6] TEE subsystem for restricted dma-buf allocations

2024-12-17 Thread Jens Wiklander
neric restricted heap * Simplifications and cleanup * New commit message for "dma-buf: heaps: add Linaro restricted dmabuf heap support" * Replaced the word "secure" with "restricted" where applicable Jens Wiklander (6): tee: add restricted memory allocation optee: a

Re: [PATCH v3 1/4] tee: add restricted memory allocation

2024-12-05 Thread Jens Wiklander
Hi Sumit, On Tue, Dec 3, 2024 at 8:58 AM Sumit Garg wrote: > > Hi Jens, > > On Thu, 28 Nov 2024 at 20:39, Jens Wiklander > wrote: > > > > Add restricted memory allocation to the TEE subsystem. Restricted memory > > is not be accessible by kernel during normal

Re: [PATCH v4 1/6] tee: add restricted memory allocation

2025-01-08 Thread Jens Wiklander
On Wed, Jan 8, 2025 at 5:54 PM Simona Vetter wrote: > > On Tue, Dec 17, 2024 at 11:07:37AM +0100, Jens Wiklander wrote: > > Add restricted memory allocation to the TEE subsystem. > > > > Restricted memory refers to memory buffers behind a hardware enforced > > fir

Re: [PATCH v4 0/6] TEE subsystem for restricted dma-buf allocations

2025-02-13 Thread Jens Wiklander
Hi, On Thu, Feb 13, 2025 at 7:42 AM Sumit Garg wrote: > > Hi Boris, > > On Thu, 13 Feb 2025 at 01:26, Boris Brezillon > wrote: > > > > +Florent, who's working on protected-mode support in Panthor. > > > > Hi Jens, > > > > On T

Re: [PATCH v4 0/6] TEE subsystem for restricted dma-buf allocations

2025-03-19 Thread Jens Wiklander
Hi, On Tue, Mar 18, 2025 at 7:38 PM Nicolas Dufresne wrote: > > Le mardi 04 mars 2025 à 13:15 +0530, Sumit Garg a écrit : > > On Tue, Mar 04, 2025 at 08:17:23AM +0100, Jens Wiklander wrote: > > > Hi Daniel, > > > > > > On Fri, Feb 21, 2025 at 3:12 PM Daniel

Re: [PATCH v6 03/10] optee: account for direction while converting parameters

2025-03-25 Thread Jens Wiklander
On Tue, Mar 25, 2025 at 6:56 AM Sumit Garg wrote: > > On Thu, Mar 20, 2025 at 02:00:57PM +0100, Jens Wiklander wrote: > > Hi Sumit, > > > > On Thu, Mar 20, 2025 at 10:25 AM Sumit Garg wrote: > > > > > > Hi Jens, > > > > > > On

Re: [PATCH v6 03/10] optee: account for direction while converting parameters

2025-03-17 Thread Jens Wiklander
Hi Sumit, On Thu, Mar 13, 2025 at 11:41 AM Sumit Garg wrote: > > Hi Jens, > > On Wed, Mar 05, 2025 at 02:04:09PM +0100, Jens Wiklander wrote: > > The OP-TEE backend driver has two internal function pointers to convert > > between the subsystem type struct tee_param an

Re: [PATCH v6 03/10] optee: account for direction while converting parameters

2025-04-05 Thread Jens Wiklander
Hi Sumit, On Thu, Mar 20, 2025 at 10:25 AM Sumit Garg wrote: > > Hi Jens, > > On Mon, Mar 17, 2025 at 08:42:01AM +0100, Jens Wiklander wrote: > > Hi Sumit, > > > > On Thu, Mar 13, 2025 at 11:41 AM Sumit Garg wrote: > > > > > > Hi Jens, > >

Re: [PATCH v6 05/10] tee: implement restricted DMA-heap

2025-04-05 Thread Jens Wiklander
Hi Sumit, On Tue, Mar 25, 2025 at 7:33 AM Sumit Garg wrote: > > Hi Jens, > > On Wed, Mar 05, 2025 at 02:04:11PM +0100, Jens Wiklander wrote: > > Implement DMA heap for restricted DMA-buf allocation in the TEE > > subsystem. > > > > Restricted memory refers

Re: [PATCH v6 06/10] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-04-05 Thread Jens Wiklander
Hi Sumit, On Tue, Mar 25, 2025 at 7:50 AM Sumit Garg wrote: > > Hi Jens, > > On Wed, Mar 05, 2025 at 02:04:12PM +0100, Jens Wiklander wrote: > > From: Etienne Carriere > > > > Enable userspace to create a tee_shm object that refers to a dmabuf > > refere

Re: [PATCH v6 09/10] optee: FF-A: dynamic restricted memory allocation

2025-03-27 Thread Jens Wiklander
Hi Sumit, On Tue, Mar 25, 2025 at 8:42 AM Sumit Garg wrote: > > On Wed, Mar 05, 2025 at 02:04:15PM +0100, Jens Wiklander wrote: > > Add support in the OP-TEE backend driver dynamic restricted memory > > allocation with FF-A. > > > > The restricted memory pools for

Re: [PATCH v6 00/10] TEE subsystem for restricted dma-buf allocations

2025-03-27 Thread Jens Wiklander
Hi, On Wed, Mar 5, 2025 at 2:06 PM Jens Wiklander wrote: > > Hi, > > This patch set allocates the restricted DMA-bufs from a DMA-heap > instantiated from the TEE subsystem. > > The TEE subsystem handles the DMA-buf allocations since it is the TEE > (OP-TEE, AMD-TEE, TS-

Re: [PATCH v6 04/10] optee: sync secure world ABI headers

2025-03-27 Thread Jens Wiklander
Hi Sumit, On Tue, Mar 25, 2025 at 7:20 AM Sumit Garg wrote: > > Hi Jens, > > It has taken a bit of time for me to review this patch-set as I am > settling in my new role. > > On Wed, Mar 05, 2025 at 02:04:10PM +0100, Jens Wiklander wrote: > > Update the header files

Re: [PATCH v6 05/10] tee: implement restricted DMA-heap

2025-04-08 Thread Jens Wiklander
On Tue, Apr 8, 2025 at 11:14 AM Sumit Garg wrote: > > On Tue, Apr 01, 2025 at 10:33:04AM +0200, Jens Wiklander wrote: > > On Tue, Apr 1, 2025 at 9:58 AM Sumit Garg wrote: > > > > > > On Tue, Mar 25, 2025 at 11:55:46AM +0100, Jens Wik

Re: [PATCH v3 03/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF

2025-04-08 Thread Jens Wiklander
Hi Amirreza, On Fri, Mar 28, 2025 at 3:48 AM Amirreza Zarrabi wrote: > > For drivers that can transfer data to the TEE without using shared > memory from client, it is necessary to receive the user address > directly, bypassing any processing by the TEE subsystem. Introduce > TEE_IOCTL_PARAM_ATTR

Re: [PATCH v6 05/10] tee: implement restricted DMA-heap

2025-04-09 Thread Jens Wiklander
On Wed, Apr 9, 2025 at 2:50 PM Sumit Garg wrote: > > On Tue, Apr 08, 2025 at 03:28:45PM +0200, Jens Wiklander wrote: > > On Tue, Apr 8, 2025 at 11:14 AM Sumit Garg wrote: > > > > > > On Tue, Apr 01, 2025 at 10:33:04AM +0200, Jens Wiklander wrote: > > > >

Re: [PATCH v6 05/10] tee: implement restricted DMA-heap

2025-04-01 Thread Jens Wiklander
On Tue, Apr 1, 2025 at 9:58 AM Sumit Garg wrote: > > On Tue, Mar 25, 2025 at 11:55:46AM +0100, Jens Wiklander wrote: > > Hi Sumit, > > > > > > > > > > > > > > + > > > > +#include "tee_private.h" > > > >

Re: [PATCH v6 03/10] optee: account for direction while converting parameters

2025-04-01 Thread Jens Wiklander
On Tue, Apr 1, 2025 at 9:45 AM Sumit Garg wrote: > > On Tue, Mar 25, 2025 at 09:50:35AM +0100, Jens Wiklander wrote: > > On Tue, Mar 25, 2025 at 6:56 AM Sumit Garg wrote: > > > > > > On Thu, Mar 20, 2025 at 02:00:57PM +0100, Jens Wiklander wrote: > > > >

Re: [PATCH v6 09/10] optee: FF-A: dynamic restricted memory allocation

2025-04-01 Thread Jens Wiklander
On Tue, Apr 1, 2025 at 12:13 PM Sumit Garg wrote: > > + MM folks to seek guidance here. > > On Thu, Mar 27, 2025 at 09:07:34AM +0100, Jens Wiklander wrote: > > Hi Sumit, > > > > On Tue, Mar 25, 2025 at 8:42 AM Sumit Garg wrote: > > > > > > On Wed,

Re: [PATCH v3 03/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF

2025-04-08 Thread Jens Wiklander
Hi Amirreza, On Wed, Apr 9, 2025 at 2:28 AM Amirreza Zarrabi wrote: > > Hi jens, > > On 4/8/2025 10:19 PM, Jens Wiklander wrote: > > Hi Amirreza, > > On Fri, Mar 28, 2025 at 3:48 AM Amirreza Zarrabi > wrote: > > For drivers that can transfer data to the TEE w

Re: [PATCH v6 09/10] optee: FF-A: dynamic restricted memory allocation

2025-04-08 Thread Jens Wiklander
On Tue, Apr 8, 2025 at 11:20 AM Sumit Garg wrote: > > On Tue, Apr 01, 2025 at 02:26:59PM +0200, Jens Wiklander wrote: > > On Tue, Apr 1, 2025 at 12:13 PM Sumit Garg wrote: > > > > > > + MM folks to seek guidance here. > > > > > > On Thu, Mar 27

Re: [PATCH v3 08/11] tee: add Qualcomm TEE driver

2025-04-08 Thread Jens Wiklander
Hi Amirreza, On Fri, Mar 28, 2025 at 3:48 AM Amirreza Zarrabi wrote: > > Introduce qcomtee_object, which represents an object in both QTEE and > the kernel. QTEE clients can invoke an instance of qcomtee_object to > access QTEE services. If this invocation produces a new object in QTEE, > an inst

Re: [PATCH v3 03/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF

2025-04-09 Thread Jens Wiklander
On Wed, Apr 9, 2025 at 9:20 AM Amirreza Zarrabi wrote: > > > > On 4/9/2025 4:41 PM, Jens Wiklander wrote: > > Hi Amirreza, > > > > On Wed, Apr 9, 2025 at 2:28 AM Amirreza Zarrabi > > wrote: > >> > >> Hi jens, > >> > &g

Re: [PATCH v3 02/11] tee: add close_context to TEE driver operation

2025-04-07 Thread Jens Wiklander
Hi Amir, On Fri, Mar 28, 2025 at 3:48 AM Amirreza Zarrabi wrote: > > The tee_context can be used to manage TEE user resources, including > those allocated by the driver for the TEE on behalf of the user. > The release() callback is invoked only when all resources, such as > tee_shm, are released

Re: [PATCH v8 06/14] tee: implement protected DMA-heap

2025-05-05 Thread Jens Wiklander
Hi, On Fri, May 2, 2025 at 3:59 PM Robin Murphy wrote: > > On 02/05/2025 10:59 am, Jens Wiklander wrote: > > Implement DMA heap for protected DMA-buf allocation in the TEE > > subsystem. > > > > Restricted memory refers to memory buffers behind a hardware en

Re: [PATCH v8 10/14] dma-contiguous: export dma_contiguous_default_area

2025-05-05 Thread Jens Wiklander
Hi, On Fri, May 2, 2025 at 3:11 PM Robin Murphy wrote: > > On 02/05/2025 10:59 am, Jens Wiklander wrote: > > Export the global variable dma_contiguous_default_area so > > dev_get_cma_area() can be called a module. > > What dma_map_ops implementation is in a module? Withou

Re: [PATCH v8 09/14] cma: export cma_alloc() and cma_release()

2025-05-05 Thread Jens Wiklander
Hi, On Fri, May 2, 2025 at 5:50 PM Matthew Wilcox wrote: > > On Fri, May 02, 2025 at 11:59:23AM +0200, Jens Wiklander wrote: > > Export the two functions cma_alloc() and cma_release(). > > Why? This is clearly part of a larger series, but you've given those of > us w

Re: [PATCH v8 01/14] tee: tee_device_alloc(): copy dma_mask from parent device

2025-05-05 Thread Jens Wiklander
Hi, On Fri, May 2, 2025 at 3:36 PM Robin Murphy wrote: > > On 02/05/2025 10:59 am, Jens Wiklander wrote: > > If a parent device is supplied to tee_device_alloc(), copy the dma_mask > > field into the new device. This avoids future warnings when mapping a > > DMA-buf for t

Re: [PATCH v7 04/11] optee: sync secure world ABI headers

2025-04-28 Thread Jens Wiklander
Hi Rouven, On Fri, Apr 25, 2025 at 3:36 PM Rouven Czerwinski wrote: > > Hi, > > On Fri, 4 Apr 2025 at 16:31, Jens Wiklander wrote: > > > > Update the header files describing the secure world ABI, both with and > > without FF-A. The ABI is extended to deal with prot

[PATCH v8 11/14] tee: add tee_shm_alloc_cma_phys_mem()

2025-05-02 Thread Jens Wiklander
Add tee_shm_alloc_cma_phys_mem() to allocate a physical memory using from the default CMA pool. The memory is represented by a tee_shm object using the new flag TEE_SHM_CMA_BUF to identify it as physical memory from CMA. Signed-off-by: Jens Wiklander --- drivers/tee/tee_shm.c| 55

[PATCH v8 12/14] optee: support protected memory allocation

2025-05-02 Thread Jens Wiklander
-off-by: Jens Wiklander --- drivers/tee/optee/core.c| 1 + drivers/tee/optee/smc_abi.c | 44 +++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index c75fddc83576..c7fd8040480e 100644 --- a

[PATCH v8 13/14] optee: FF-A: dynamic protected memory allocation

2025-05-02 Thread Jens Wiklander
ected memory. Restricted memory pools based on a static carveout or dynamic allocation can coexist for different use-cases. We use only dynamic allocation with FF-A. Signed-off-by: Jens Wiklander --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/ffa_abi.c

[PATCH v8 07/14] tee: refactor params_from_user()

2025-05-02 Thread Jens Wiklander
Break out the memref handling into a separate helper function. No change in behavior. Signed-off-by: Jens Wiklander --- drivers/tee/tee_core.c | 94 -- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/drivers/tee/tee_core.c b/drivers/tee

[PATCH v8 08/14] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-05-02 Thread Jens Wiklander
identify tee_shm objects built from a registered dmabuf, TEE_SHM_DMA_BUF. Signed-off-by: Etienne Carriere Signed-off-by: Olivier Masse Signed-off-by: Jens Wiklander --- drivers/tee/tee_core.c| 63 +- drivers/tee/tee_private.h | 10 drivers/tee/tee_shm.c | 111

[PATCH v8 09/14] cma: export cma_alloc() and cma_release()

2025-05-02 Thread Jens Wiklander
Export the two functions cma_alloc() and cma_release(). Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Jens Wiklander --- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/cma.c b/mm/cma.c index 15632939f20a..c60901e73a26 100644 --- a

[PATCH v8 10/14] dma-contiguous: export dma_contiguous_default_area

2025-05-02 Thread Jens Wiklander
Export the global variable dma_contiguous_default_area so dev_get_cma_area() can be called a module. Cc: Marek Szyprowski Cc: Robin Murphy Cc: io...@lists.linux.dev Signed-off-by: Jens Wiklander --- kernel/dma/contiguous.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/dma

[PATCH v8 14/14] optee: smc abi: dynamic protected memory allocation

2025-05-02 Thread Jens Wiklander
Add support in the OP-TEE backend driver for dynamic protected memory allocation using the SMC ABI. Signed-off-by: Jens Wiklander --- drivers/tee/optee/smc_abi.c | 103 +--- 1 file changed, 85 insertions(+), 18 deletions(-) diff --git a/drivers/tee/optee

[PATCH v8 04/14] optee: sync secure world ABI headers

2025-05-02 Thread Jens Wiklander
Update the header files describing the secure world ABI, both with and without FF-A. The ABI is extended to deal with protected memory, but as usual backward compatible. Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_ffa.h | 27 +--- drivers/tee/optee/optee_msg.h | 83

[PATCH v8 03/14] optee: account for direction while converting parameters

2025-05-02 Thread Jens Wiklander
st be copied. This is needed in a later patch where it might get confusing when converting back in from_msg_param() callback since an allocated restricted SHM can be using the sec_world_id of the used restricted memory pool and that doesn't translate back well. Signed-off-by: Jens Wiklander --

[PATCH v8 05/14] dma-buf: dma-heap: export declared functions

2025-05-02 Thread Jens Wiklander
Export the dma-buf heap functions declared in . Signed-off-by: Jens Wiklander --- drivers/dma-buf/dma-heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 3cbe87d4a464..cdddf0e24dce 100644 --- a/drivers/dma-buf/dma-heap.c

[PATCH v8 06/14] tee: implement protected DMA-heap

2025-05-02 Thread Jens Wiklander
where certain hardware devices can access the memory. The DMA-heaps are enabled explicitly by the TEE backend driver. The TEE backend drivers needs to implement protected memory pool to manage the protected memory. Signed-off-by: Jens Wiklander --- drivers/tee/Makefile | 1 + drivers/tee

[PATCH v8 01/14] tee: tee_device_alloc(): copy dma_mask from parent device

2025-05-02 Thread Jens Wiklander
If a parent device is supplied to tee_device_alloc(), copy the dma_mask field into the new device. This avoids future warnings when mapping a DMA-buf for the device. Signed-off-by: Jens Wiklander Reviewed-by: Sumit Garg --- drivers/tee/tee_core.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH v8 00/14] TEE subsystem for protected dma-buf allocations

2025-05-02 Thread Jens Wiklander
FFA_LEND Changes since the V1 RFC: * Based on v6.11 * Complete rewrite, replacing the restricted heap with TEE_IOC_RSTMEM_ALLOC Changes since Olivier's post [2]: * Based on Yong Wu's post [1] where much of dma-buf handling is done in the generic restricted heap * Simplifications and clea

[PATCH v8 02/14] optee: pass parent device to tee_device_alloc()

2025-05-02 Thread Jens Wiklander
During probing of the OP-TEE driver, pass the parent device to tee_device_alloc() so the dma_mask of the new devices can be updated accordingly. Signed-off-by: Jens Wiklander Reviewed-by: Sumit Garg --- drivers/tee/optee/ffa_abi.c | 8 drivers/tee/optee/smc_abi.c | 4 ++-- 2 files

[PATCH v5 1/7] tee: add restricted memory allocation

2025-02-18 Thread Jens Wiklander
Video Playback, Trusted UI, or Secure Video Recording where certain hardware devices can access the memory. More use-cases can be added in userspace ABI, but it's up to the backend drivers to provide the implementation. Signed-off-by: Jens Wiklander --- drivers/tee/Makefile

[PATCH v5 3/7] optee: account for direction while converting parameters

2025-02-18 Thread Jens Wiklander
st be copied. This is needed in a later patch where it might get confusing when converting back in from_msg_param() callback since an allocated restricted SHM can be using the sec_world_id of the used restricted memory pool and that doesn't translate back well. Signed-off-by: Jens Wiklander --

[PATCH v5 5/7] optee: support restricted memory allocation

2025-02-18 Thread Jens Wiklander
. Signed-off-by: Jens Wiklander --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/core.c | 1 + drivers/tee/optee/optee_private.h | 23 ++ drivers/tee/optee/rstmem.c| 76 +++ drivers/tee/optee/smc_abi.c | 69

[PATCH v5 4/7] optee: sync secure world ABI headers

2025-02-18 Thread Jens Wiklander
Update the header files describing the secure world ABI, both with and without FF-A. The ABI is extended to deal with restricted memory, but as usual backward compatible. Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_ffa.h | 27 ++--- drivers/tee/optee/optee_msg.h | 65

[PATCH v5 6/7] optee: FF-A: dynamic restricted memory allocation

2025-02-18 Thread Jens Wiklander
icted memory. Restricted memory pools based on a static carveout or dynamic allocation can coexist for different use-cases. We use only dynamic allocation with FF-A. Signed-off-by: Jens Wiklander --- drivers/tee/optee/ffa_abi.c | 136 - drivers/tee/optee/optee_private.h

[PATCH v5 0/7] TEE subsystem for restricted dma-buf allocations

2025-02-18 Thread Jens Wiklander
the generic restricted heap * Simplifications and cleanup * New commit message for "dma-buf: heaps: add Linaro restricted dmabuf heap support" * Replaced the word "secure" with "restricted" where applicable Jens Wiklander (7): tee: add restricted memory allocat

[PATCH v5 7/7] optee: smc abi: dynamic restricted memory allocation

2025-02-18 Thread Jens Wiklander
Add support in the OP-TEE backend driver for dynamic restricted memory allocation using the SMC ABI. Signed-off-by: Jens Wiklander --- drivers/tee/optee/smc_abi.c | 76 +++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/drivers/tee/optee

[PATCH v5 2/7] tee: add TEE_IOC_RSTMEM_FD_INFO

2025-02-18 Thread Jens Wiklander
Add TEE_IOC_RSTMEM_FD_INFO to retrieve information about a previously allocated restricted memory dma-buf file descriptor. This is needed if the file descriptor from a restricted memory allocation has been saved due to limitations in the application. Signed-off-by: Jens Wiklander --- drivers

Re: [PATCH v4 0/6] TEE subsystem for restricted dma-buf allocations

2025-03-03 Thread Jens Wiklander
Hi Daniel, On Fri, Feb 21, 2025 at 3:12 PM Daniel Stone wrote: > > Hi Sumit, > > On Fri, 21 Feb 2025 at 11:24, Sumit Garg wrote: > > On Tue, 18 Feb 2025 at 21:52, Daniel Stone wrote: > > > dma-heaps was created to solve the problem of having too many > > > 'allocate $n bytes from $specialplace'

[PATCH v6 00/10] TEE subsystem for restricted dma-buf allocations

2025-03-05 Thread Jens Wiklander
]: * Based on Yong Wu's post [1] where much of dma-buf handling is done in the generic restricted heap * Simplifications and cleanup * New commit message for "dma-buf: heaps: add Linaro restricted dmabuf heap support" * Replaced the word "secure" with "restricte

  1   2   >