Re: [PATCH v12 3/9] tee: implement protected DMA-heap

2025-10-02 Thread Jens Wiklander
Hi, On Thu, Oct 2, 2025 at 9:54 AM Maxime Ripard wrote: > > On Thu, Sep 11, 2025 at 03:49:44PM +0200, Jens Wiklander wrote: > > +static const char *heap_id_2_name(enum tee_dma_heap_id id) > > +{ > > + switch (id) { > > + case TEE_DMA_HEAP_SECURE_VIDEO_

Re: [PATCH v12 2/9] dma-buf: dma-heap: export declared functions

2025-10-02 Thread Jens Wiklander
Hi, On Thu, Oct 2, 2025 at 9:47 AM Maxime Ripard wrote: > > Hi, > > On Thu, Sep 11, 2025 at 03:49:43PM +0200, Jens Wiklander wrote: > > Export the dma-buf heap functions to allow them to be used by the OP-TEE > > driver. The OP-TEE driver wants to register and manage

Re: [PATCH v12 0/9] TEE subsystem for protected dma-buf allocations

2025-09-20 Thread Jens Wiklander
Hi, On Thu, Sep 11, 2025 at 3:50 PM Jens Wiklander wrote: > > Hi, > > This patch set allocates the protected 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-

[PATCH v12 1/9] optee: sync secure world ABI headers

2025-09-20 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. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_ffa.h | 27 --- drivers/tee/optee

[PATCH v12 7/9] optee: support protected memory allocation

2025-09-18 Thread Jens Wiklander
. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/optee/Kconfig | 5 +++ drivers/tee/optee/core.c | 7 drivers/tee/optee/optee_private.h | 2 + drivers/tee/optee/smc_abi.c | 69 ++- 4 files changed, 81 insertions(+), 2

Re: [PATCH v12 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE)

2025-09-15 Thread Jens Wiklander
Hi, On Mon, Sep 15, 2025 at 4:05 PM Bjorn Andersson wrote: > > On Fri, Sep 12, 2025 at 10:21:55AM +0200, Jens Wiklander wrote: > > Hi, > > > > On Fri, Sep 12, 2025 at 6:07 AM Amirreza Zarrabi > > wrote: > > > > > > This patch series introduces a

[PATCH v12 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-09-14 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 Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/tee_core.c| 62 +++- drivers/tee/tee_private.h | 8

[PATCH v12 6/9] tee: add tee_shm_alloc_dma_mem()

2025-09-14 Thread Jens Wiklander
Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to identify it as DMA memory. The allocated memory will later be lent to the TEE to be used as protected memory. Reviewed-by: Sumit Garg Signed-off-by: Jens

[PATCH v12 9/9] optee: smc abi: dynamic protected memory allocation

2025-09-13 Thread Jens Wiklander
Add support in the OP-TEE backend driver for dynamic protected memory allocation using the SMC ABI. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/optee/smc_abi.c | 78 +++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a

[PATCH v12 3/9] tee: implement protected DMA-heap

2025-09-12 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. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/Kconfig

Re: [PATCH v12 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE)

2025-09-12 Thread Jens Wiklander
Hi, On Fri, Sep 12, 2025 at 6:07 AM Amirreza Zarrabi wrote: > > This patch series introduces a Trusted Execution Environment (TEE) > driver for Qualcomm TEE (QTEE). QTEE enables Trusted Applications (TAs) > and services to run securely. It uses an object-based interface, where > each service is a

[PATCH v12 8/9] optee: FF-A: dynamic protected memory allocation

2025-09-11 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. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/ffa_

[PATCH v12 4/9] tee: refactor params_from_user()

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

[PATCH v12 2/9] dma-buf: dma-heap: export declared functions

2025-09-11 Thread Jens Wiklander
Export the dma-buf heap functions to allow them to be used by the OP-TEE driver. The OP-TEE driver wants to register and manage specific secure DMA heaps with it. Reviewed-by: Sumit Garg Reviewed-by: T.J. Mercier Acked-by: Sumit Semwal Signed-off-by: Jens Wiklander --- drivers/dma-buf/dma

[PATCH v12 0/9] TEE subsystem for protected dma-buf allocations

2025-09-11 Thread Jens Wiklander
memory with a u32 field with unique id for each use case * Added dynamic allocation of restricted memory pools * Added OP-TEE ABI both with and without FF-A for dynamic restricted memory * Added support for FF-A with FFA_LEND Changes since the V1 RFC: * Based on v6.11 * Complete rewrite, replacing the

Re: [PATCH v11 2/9] dma-buf: dma-heap: export declared functions

2025-09-11 Thread Jens Wiklander
Hi, On Thu, Sep 11, 2025 at 10:00 AM Sumit Semwal wrote: > > Hi Jens, > > On Thu, 11 Sept 2025 at 13:20, Jens Wiklander > wrote: > > > > Hi Sumit, > > > > On Thu, Sep 11, 2025 at 9:15 AM Sumit Semwal > > wrote: > > > > > > Hel

Re: [PATCH v11 05/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF

2025-09-11 Thread Jens Wiklander
Hi Amir, On Thu, Sep 11, 2025 at 5:41 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_TYP

Re: [PATCH v11 2/9] dma-buf: dma-heap: export declared functions

2025-09-11 Thread Jens Wiklander
Hi Sumit, On Thu, Sep 11, 2025 at 9:15 AM Sumit Semwal wrote: > > Hello Jens, > > On Fri, 15 Aug 2025 at 05:00, T.J. Mercier wrote: > > > > On Wed, Aug 13, 2025 at 11:13 PM Sumit Garg wrote: > > > > > > On Wed, Aug 13, 2025 at 08:02:51AM +0200, Jens W

Re: [PATCH v7 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE)

2025-09-08 Thread Jens Wiklander
On Tue, Sep 9, 2025 at 6:34 AM Sumit Garg wrote: > > On Tue, Aug 12, 2025 at 05:35:29PM -0700, Amirreza Zarrabi wrote: > > This patch series introduces a Trusted Execution Environment (TEE) > > driver for Qualcomm TEE (QTEE). QTEE enables Trusted Applications (TAs) > > and services to run securely

Re: [PATCH v11 0/9] TEE subsystem for protected dma-buf allocations

2025-08-31 Thread Jens Wiklander
Hi, On Wed, Aug 13, 2025 at 8:03 AM Jens Wiklander wrote: > > Hi, > > This patch set allocates the protected 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 v7 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE)

2025-08-13 Thread Jens Wiklander
Hi Amir, On Wed, Aug 13, 2025 at 2:37 AM Amirreza Zarrabi wrote: > > This patch series introduces a Trusted Execution Environment (TEE) > driver for Qualcomm TEE (QTEE). QTEE enables Trusted Applications (TAs) > and services to run securely. It uses an object-based interface, where > each service

[PATCH v11 8/9] optee: FF-A: dynamic protected memory allocation

2025-08-12 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 Reviewed-by: Sumit Garg --- drivers/tee/optee/Makefile| 1 + drivers/tee/optee/ffa_

[PATCH v11 3/9] tee: implement protected DMA-heap

2025-08-12 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 Reviewed-by: Sumit Garg --- drivers/tee/Kconfig

[PATCH v11 9/9] optee: smc abi: dynamic protected memory allocation

2025-08-12 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 Reviewed-by: Sumit Garg --- drivers/tee/optee/smc_abi.c | 78 +++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a

[PATCH v11 6/9] tee: add tee_shm_alloc_dma_mem()

2025-08-12 Thread Jens Wiklander
Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to identify it as DMA memory. The allocated memory will later be lent to the TEE to be used as protected memory. Signed-off-by: Jens Wiklander --- drivers/tee

[PATCH v11 7/9] optee: support protected memory allocation

2025-08-12 Thread Jens Wiklander
-off-by: Jens Wiklander Reviewed-by: Sumit Garg --- drivers/tee/optee/Kconfig | 5 +++ drivers/tee/optee/core.c | 7 drivers/tee/optee/optee_private.h | 2 + drivers/tee/optee/smc_abi.c | 69 ++- 4 files changed, 81 insertions(+), 2

[PATCH v11 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-08-12 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 | 8 + drivers/tee/tee_shm.c

[PATCH v11 4/9] tee: refactor params_from_user()

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

[PATCH v11 0/9] TEE subsystem for protected dma-buf allocations

2025-08-12 Thread Jens Wiklander
D memory with a u32 field with unique id for each use case * Added dynamic allocation of restricted memory pools * Added OP-TEE ABI both with and without FF-A for dynamic restricted memory * Added support for FF-A with FFA_LEND Changes since the V1 RFC: * Based on v6.11 * Complete rewrite, replacing th

[PATCH v11 2/9] dma-buf: dma-heap: export declared functions

2025-08-12 Thread Jens Wiklander
Export the dma-buf heap functions to allow them to be used by the OP-TEE driver. The OP-TEE driver wants to register and manage specific secure DMA heaps with it. Signed-off-by: Jens Wiklander Reviewed-by: Sumit Garg --- drivers/dma-buf/dma-heap.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v11 1/9] optee: sync secure world ABI headers

2025-08-12 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 Reviewed-by: Sumit Garg --- drivers/tee/optee/optee_ffa.h | 27 --- drivers/tee/optee

Re: [PATCH v10 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-07-03 Thread Jens Wiklander
On Thu, Jul 3, 2025 at 9:22 AM Sumit Garg wrote: > > On Wed, Jun 18, 2025 at 08:47:51AM +0200, Jens Wiklander wrote: > > On Tue, Jun 17, 2025 at 12:48 PM Sumit Garg wrote: > > > > > > On Tue, Jun 10, 2025 at 03:13:49PM +0200, Jens Wiklander wrote:

Re: [PATCH v10 6/9] tee: add tee_shm_alloc_dma_mem()

2025-07-03 Thread Jens Wiklander
On Thu, Jul 3, 2025 at 8:28 AM Sumit Garg wrote: > > On Wed, Jun 18, 2025 at 09:03:00AM +0200, Jens Wiklander wrote: > > On Tue, Jun 17, 2025 at 1:32 PM Sumit Garg wrote: > > > > > > On Tue, Jun 10, 2025 at 03:13:50PM +0200, Jens Wiklander wrote: > > > &g

Re: [PATCH v10 7/9] optee: support protected memory allocation

2025-06-24 Thread Jens Wiklander
Hi Amir, On Tue, Jun 24, 2025 at 8:54 AM Amirreza Zarrabi wrote: > > Hi Jens, > > On 6/10/2025 11:13 PM, Jens Wiklander wrote: > > Add support in the OP-TEE backend driver for protected memory > > allocation. The support is limited to only the SMC ABI and for secure >

Re: [PATCH v10 6/9] tee: add tee_shm_alloc_dma_mem()

2025-06-18 Thread Jens Wiklander
On Tue, Jun 17, 2025 at 1:32 PM Sumit Garg wrote: > > On Tue, Jun 10, 2025 at 03:13:50PM +0200, Jens Wiklander wrote: > > Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is > > represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to > > identi

Re: [PATCH v10 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-06-17 Thread Jens Wiklander
On Tue, Jun 17, 2025 at 12:48 PM Sumit Garg wrote: > > On Tue, Jun 10, 2025 at 03:13:49PM +0200, Jens Wiklander wrote: > > From: Etienne Carriere > > > > Add a userspace API to create a tee_shm object that refers to a dmabuf > > reference. > > > > User

[PATCH v10 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-06-10 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 | 106

[PATCH v10 7/9] optee: support protected memory allocation

2025-06-10 Thread Jens Wiklander
-off-by: Jens Wiklander --- drivers/tee/optee/Kconfig | 5 +++ drivers/tee/optee/core.c | 10 + drivers/tee/optee/optee_private.h | 2 + drivers/tee/optee/smc_abi.c | 70 ++- 4 files changed, 85 insertions(+), 2 deletions(-) diff --git a

[PATCH v10 4/9] tee: refactor params_from_user()

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

[PATCH v10 8/9] optee: FF-A: dynamic protected memory allocation

2025-06-10 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 v10 1/9] optee: sync secure world ABI headers

2025-06-10 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 Reviewed-by: Sumit Garg --- drivers/tee/optee/optee_ffa.h | 27 --- drivers/tee/optee

[PATCH v10 9/9] optee: smc abi: dynamic protected memory allocation

2025-06-10 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 | 78 +++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/drivers/tee/optee

[PATCH v10 6/9] tee: add tee_shm_alloc_dma_mem()

2025-06-10 Thread Jens Wiklander
Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to identify it as DMA memory. The allocated memory will later be lent to the TEE to be used as protected memory. Signed-off-by: Jens Wiklander --- drivers/tee

[PATCH v10 2/9] dma-buf: dma-heap: export declared functions

2025-06-10 Thread Jens Wiklander
Export the dma-buf heap functions to allow them to be used by the OP-TEE driver. The OP-TEE driver wants to register and manage specific secure DMA heaps with it. Signed-off-by: Jens Wiklander --- drivers/dma-buf/dma-heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf

[PATCH v10 0/9] TEE subsystem for protected dma-buf allocations

2025-06-10 Thread Jens Wiklander
END 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 cleanup

[PATCH v10 3/9] tee: implement protected DMA-heap

2025-06-10 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/Kconfig | 5 + drivers/tee

Re: [PATCH v9 3/9] tee: implement protected DMA-heap

2025-06-02 Thread Jens Wiklander
Hi Amir, On Fri, May 30, 2025 at 4:13 AM Amirreza Zarrabi wrote: > > Hi Jens, > > On 5/21/2025 1:16 AM, Jens Wiklander wrote: > > Implement DMA heap for protected DMA-buf allocation in the TEE > > subsystem. > > > > Restricted memory refers to memor

Re: [PATCH v9 9/9] optee: smc abi: dynamic protected memory allocation

2025-05-27 Thread Jens Wiklander
On Mon, May 26, 2025 at 10:13 AM Sumit Garg wrote: > > On Tue, May 20, 2025 at 05:16:52PM +0200, Jens Wiklander wrote: > > Add support in the OP-TEE backend driver for dynamic protected memory > > allocation using the SMC ABI. > > > > Signed-off-by: Jens Wiklander

Re: [PATCH v9 8/9] optee: FF-A: dynamic protected memory allocation

2025-05-27 Thread Jens Wiklander
On Mon, May 26, 2025 at 10:09 AM Sumit Garg wrote: > > On Tue, May 20, 2025 at 05:16:51PM +0200, Jens Wiklander wrote: > > Add support in the OP-TEE backend driver dynamic protected memory > > allocation with FF-A. > > > > The protected memory pools for dynamica

Re: [PATCH v9 7/9] optee: support protected memory allocation

2025-05-27 Thread Jens Wiklander
On Mon, May 26, 2025 at 9:33 AM Sumit Garg wrote: > > On Tue, May 20, 2025 at 05:16:50PM +0200, Jens Wiklander wrote: > > Add support in the OP-TEE backend driver for protected memory > > allocation. The support is limited to only the SMC ABI and for secure > > video bu

Re: [PATCH v9 6/9] tee: add tee_shm_alloc_dma_mem()

2025-05-27 Thread Jens Wiklander
On Mon, May 26, 2025 at 11:33 AM Sumit Garg wrote: > > On Mon, May 26, 2025 at 11:21:47AM +0200, Jens Wiklander wrote: > > On Mon, May 26, 2025 at 9:22 AM Sumit Garg wrote: > > > > > > On Tue, May 20, 2025 at 05:16:49PM +0200, Jens Wiklander wrote: > > > &g

Re: [PATCH v9 6/9] tee: add tee_shm_alloc_dma_mem()

2025-05-26 Thread Jens Wiklander
On Mon, May 26, 2025 at 9:22 AM Sumit Garg wrote: > > On Tue, May 20, 2025 at 05:16:49PM +0200, Jens Wiklander wrote: > > Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is > > represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to > > identi

Re: [PATCH v9 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-05-26 Thread Jens Wiklander
On Fri, May 23, 2025 at 3:31 PM Sumit Garg wrote: > > On Tue, May 20, 2025 at 05:16:48PM +0200, Jens Wiklander wrote: > > From: Etienne Carriere > > > > Add a userspace API to create a tee_shm object that refers to a dmabuf > > reference. > > > > Userspa

Re: [PATCH v9 3/9] tee: implement protected DMA-heap

2025-05-26 Thread Jens Wiklander
On Fri, May 23, 2025 at 3:03 PM Sumit Garg wrote: > > + Robin > > Jens, > > I suppose you missed to add Robin who has earlier reviewed this patch. Yes, you're right, sorry. Thanks for catching this. > > On Tue, May 20, 2025 at 05:16:46PM +0200, Jens Wiklander wrot

Re: [PATCH v9 2/9] dma-buf: dma-heap: export declared functions

2025-05-22 Thread Jens Wiklander
On Thu, May 22, 2025 at 1:52 PM Christian König wrote: > > On 5/22/25 08:56, Jens Wiklander wrote: > > On Wed, May 21, 2025 at 9:13 AM Christian König > > wrote: > >> > >> On 5/20/25 17:16, Jens Wiklander wrote: > >>> Export the dma-buf heap fun

Re: [PATCH v9 2/9] dma-buf: dma-heap: export declared functions

2025-05-21 Thread Jens Wiklander
On Wed, May 21, 2025 at 9:13 AM Christian König wrote: > > On 5/20/25 17:16, Jens Wiklander wrote: > > Export the dma-buf heap functions declared in . > > That is what this patch does and that should be obvious by looking at it. You > need to explain why you do this. >

[PATCH v9 4/9] tee: refactor params_from_user()

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

[PATCH v9 5/9] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-05-20 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 v9 9/9] optee: smc abi: dynamic protected memory allocation

2025-05-20 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 | 102 ++-- 1 file changed, 85 insertions(+), 17 deletions(-) diff --git a/drivers/tee/optee

[PATCH v9 8/9] optee: FF-A: dynamic protected memory allocation

2025-05-20 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 v9 7/9] optee: support protected memory allocation

2025-05-20 Thread Jens Wiklander
-off-by: Jens Wiklander --- drivers/tee/optee/core.c | 10 +++ drivers/tee/optee/optee_private.h | 2 ++ drivers/tee/optee/smc_abi.c | 45 +-- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee

[PATCH v9 6/9] tee: add tee_shm_alloc_dma_mem()

2025-05-20 Thread Jens Wiklander
Add tee_shm_alloc_dma_mem() to allocate DMA memory. The memory is represented by a tee_shm object using the new flag TEE_SHM_DMA_MEM to identify it as DMA memory. The allocated memory will later be lent to the TEE to be used as protected memory. Signed-off-by: Jens Wiklander --- drivers/tee

[PATCH v9 3/9] tee: implement protected DMA-heap

2025-05-20 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 v9 1/9] optee: sync secure world ABI headers

2025-05-20 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 | 84

[PATCH v9 2/9] dma-buf: dma-heap: export declared functions

2025-05-20 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 v9 0/9] TEE subsystem for protected dma-buf allocations

2025-05-20 Thread Jens Wiklander
ded OP-TEE ABI both with and without FF-A for dynamic restricted memory * Added support for FF-A with 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 pos

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

2025-05-07 Thread Jens Wiklander
Hi, On Fri, May 2, 2025 at 5:11 PM Robin Murphy wrote: > > On 02/05/2025 10:59 am, Jens Wiklander wrote: > > 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

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

2025-05-07 Thread Jens Wiklander
Hi Sumit, On Wed, May 7, 2025 at 2:42 PM Sumit Garg wrote: > > Hi Jens, > > On Fri, May 02, 2025 at 11:59:17AM +0200, 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 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 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 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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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

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 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 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 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 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-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 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 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 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 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 06/10] tee: new ioctl to a register tee_shm from a dmabuf file descriptor

2025-04-04 Thread Jens Wiklander
On Tue, Apr 1, 2025 at 10:46 AM Sumit Garg wrote: > > On Tue, Mar 25, 2025 at 12:17:20PM +0100, Jens Wiklander wrote: > > Hi Sumit, > > > > On Tue, Mar 25, 2025 at 7:50 AM Sumit Garg wrote: > > > > > > Hi Jens, > > > > > > On

  1   2   >