Re: [PATCH v11 3/4] tee: add OP-TEE driver

2016-09-07 Thread Jens Wiklander
Hi Zengtao, On Wed, Sep 07, 2016 at 03:49:38PM +0800, Zeng Tao wrote: > Hi all: > > I have gone through the patch, and i find one limit for RPC call from > TEE to REE. In this patch, RPC commands are fixed and it supports a > limited set of commands. If you want to add your own RPC command then

Re: [PATCH v11 2/4] tee: generic TEE subsystem

2016-08-31 Thread Jens Wiklander
On Tue, Aug 30, 2016 at 02:29:45PM -0500, Andrew F. Davis wrote: > On 08/22/2016 08:00 AM, Jens Wiklander wrote: > > +/* > > + * Unprivileged devices in the in the lower half range and privileged > > ^^ in the in the > [s

Re: [PATCH v11 3/4] tee: add OP-TEE driver

2016-08-31 Thread Jens Wiklander
On Tue, Aug 30, 2016 at 03:23:24PM -0500, Andrew F. Davis wrote: > On 08/22/2016 08:00 AM, Jens Wiklander wrote: > > + /* > > +* We add ourselves to the queue, but we don't wait. This > > +* guarentees that we don't lose a completion if secure world >

Re: [PATCH v11 3/4] tee: add OP-TEE driver

2016-09-01 Thread Jens Wiklander
On Wed, Aug 31, 2016 at 11:40:20AM -0500, Andrew F. Davis wrote: > On 08/31/2016 08:50 AM, Jens Wiklander wrote: > > On Tue, Aug 30, 2016 at 03:23:24PM -0500, Andrew F. Davis wrote: > >> On 08/22/2016 08:00 AM, Jens Wiklander wrote: > >>&g

Re: [PATCH v11 3/4] tee: add OP-TEE driver

2016-09-02 Thread Jens Wiklander
On Thu, Sep 01, 2016 at 01:06:04PM -0500, Andrew F. Davis wrote: > On 09/01/2016 04:22 AM, Jens Wiklander wrote: > > On Wed, Aug 31, 2016 at 11:40:20AM -0500, Andrew F. Davis wrote: > >> On 08/31/2016 08:50 AM, Jens Wiklander wrote: > >>> On Tue, Aug 30, 2016 at 03:

[GIT PULL] tee subsystem for v4.20

2018-08-24 Thread Jens Wiklander
s property into account Jens Wiklander (1): tee: add kernel internal client interface drivers/tee/optee/core.c | 2 +- drivers/tee/tee_core.c | 113 --- include/linux/tee_drv.h | 73 ++ 3 files changed, 180 insertions(+), 8 deletions(-)

Re: [RESEND PATCH] tee: add kernel internal client interface

2018-07-13 Thread Jens Wiklander
[+Sumit] On Mon, Jul 09, 2018 at 08:15:49AM +0200, Jens Wiklander wrote: > Adds a kernel internal TEE client interface to be used by other drivers. > > Signed-off-by: Jens Wiklander > --- > drivers/tee/tee_core.c | 113 +--- > include/lin

[PATCH] tee: optee: fix uninitialized symbol 'parg'

2017-05-15 Thread Jens Wiklander
Fixes the static checker warning in optee_release(). error: uninitialized symbol 'parg'. Reported-by: Dan Carpenter Signed-off-by: Jens Wiklander --- drivers/tee/optee/core.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/tee/optee/core.c b/d

[GIT PULL] tee dynamic shm fixes for v4.16

2018-01-11 Thread Jens Wiklander
tee: shm: Potential NULL dereference calling tee_shm_register() Jens Wiklander (2): tee: add start argument to shm_register callback tee: optee: check type of registered shared memory drivers/tee/optee/call.c | 50 +++ drivers/te

Re: [PATCH] tee: shm: Potential NULL dereference calling tee_shm_register()

2018-01-09 Thread Jens Wiklander
On Sat, Jan 6, 2018 at 10:22 AM, Dan Carpenter wrote: > get_user_pages_fast() can return zero in certain error paths. We should > handle that or else it means we accidentally return ERR_PTR(0) which is > NULL instead of an error pointer. The callers are not expecting that > and will crash with a

[GIT PULL] tee driver misc for v4.17

2018-03-06 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull these tee driver changes. This fixes a a problem with determining the max device id value for the privileged device. This is only a problem if there's more than 16 tee devices registered. There's also added support to report OP-TEE revision information. The

Re: [PATCH v2] tee: optee: log message if dynamic shm is enabled

2018-11-20 Thread Jens Wiklander
Hi Victor, On Tue, Sep 11, 2018 at 06:09:02PM +0900, Victor Chong wrote: > When dynamic shared memory support is enabled in the OP-TEE Trusted > OS, it doesn't mean that the driver supports it, which can confuse > users during debugging. Log a message when dynamic shared memory is > enabled in the

[GIT PULL] tee driver for v4.18

2018-07-02 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull these small tee driver enhancements. There's a new config option for the OP-TEE driver, OPTEE_SHM_NUM_PRIV_PAGES. Also the OP-TEE driver reads current time with ktime_get_real_ts64() from now on. Thanks, Jens The following changes since commit 29dcea88779c8

Re: [GIT PULL] tee driver for v4.18

2018-07-02 Thread Jens Wiklander
On Mon, Jul 2, 2018 at 7:18 PM, Olof Johansson wrote: > Hi Jens, > > > On Mon, Jul 2, 2018 at 5:10 AM, Jens Wiklander > wrote: >> Hello arm-soc maintainers, >> >> Please pull these small tee driver enhancements. There's a new config >> option for the O

[RESEND PATCH] tee: add kernel internal client interface

2018-07-08 Thread Jens Wiklander
Adds a kernel internal TEE client interface to be used by other drivers. Signed-off-by: Jens Wiklander --- drivers/tee/tee_core.c | 113 +--- include/linux/tee_drv.h | 73 ++ 2 files changed, 179 insertions(+), 7 deletions(-) diff

Re: [PATCH] tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig

2018-06-20 Thread Jens Wiklander
On Fri, Jun 08, 2018 at 12:38:13PM +0530, Sahil Malhotra wrote: > This change adds KCONFIG option to set number of pages out of > whole shared memory to be used for OP-TEE driver private data > structures. > > Signed-off-by: Sahil Malhotra > --- > drivers/tee/optee/Kconfig | 8 > driver

[GIT PULL] tee driver fix for v4.21

2018-12-12 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this tee driver fix for a possible double list_del() in the OP-TEE driver while uninitializing. Thanks, Jens The following changes since commit 40e020c129cfc991e8ab4736d2665351ffd1468d: Linux 4.20-rc6 (2018-12-09 15:31:00 -0800) are available in the Git

[GIT PULL] tee subsys for v4.21

2018-12-12 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this small OP-TEE driver enhancement. A friendly log message is added to inform that dynamic shared memory is used when initiazing the OP-TEE driver. Thanks, Jens The following changes since commit 40e020c129cfc991e8ab4736d2665351ffd1468d: Linux 4.20-rc6

Re: [GIT PULL] tee driver fix for v4.21

2018-12-12 Thread Jens Wiklander
On Wed, Dec 12, 2018 at 11:16 PM Olof Johansson wrote: > > On Wed, Dec 12, 2018 at 01:28:00PM +0100, Jens Wiklander wrote: > > Hello arm-soc maintainers, > > > > Please pull this tee driver fix for a possible double list_del() in the > > OP-TEE driver while

Re: [GIT PULL] tee subsys for v4.21

2018-12-12 Thread Jens Wiklander
Hi Olof, On Wed, Dec 12, 2018 at 11:16 PM Olof Johansson wrote: > > On Wed, Dec 12, 2018 at 01:31:21PM +0100, Jens Wiklander wrote: > > Hello arm-soc maintainers, > > > > Please pull this small OP-TEE driver enhancement. A friendly log message > > is added to inform

Re: [RFC PATCH 1/2] optee: model OP-TEE as a platform device/driver

2019-01-02 Thread Jens Wiklander
Hi Ard and Arnd, On Thu, Dec 27, 2018 at 8:01 PM Ard Biesheuvel wrote: > > To simplify adding ACPI support to the OP-TEE driver, model it as > a platform driver. This will permit us to use the generic device > property layer for parsing additional properties, regardless of > whether DT or ACPI is

[RFC PATCH 0/2] generic TEE subsystem

2015-04-17 Thread Jens Wiklander
anea , Emmanuel MICHEL , Jean-michel DELORME , and Joakim Bech . Our main concern has been to agree on something that is generic enough to support many different TEEs while still keeping the interface together. Regards, Jens Jens Wiklander (2): tee: generic TEE subsystem tee: add OP-TEE driver

[RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-17 Thread Jens Wiklander
g others Jean-michel DELORME and Emmanuel MICHEL * "Generic TrustZone Driver" by Javier González Signed-off-by: Jens Wiklander --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/Kconfig | 2 + drivers/Makefile |

[RFC PATCH 2/2] tee: add OP-TEE driver

2015-04-17 Thread Jens Wiklander
Adds mostly stubbed OP-TEE driver which also can be compiled as a loadable module. Signed-off-by: Jens Wiklander --- drivers/tee/Kconfig| 10 +++ drivers/tee/Makefile | 1 + drivers/tee/optee/Kconfig | 7 ++ drivers/tee/optee/Makefile | 2 + drivers/tee/optee/core.c

[RFC PATCH V2 0/2] generic TEE subsystem

2015-04-29 Thread Jens Wiklander
space exposed structures to only have types with __ prefix * Dropped THIS_MODULE from tee_fops * Reworked how the driver is registered and ref counted: - moved from using an embedded struct miscdevice to an embedded struct device. - uses an struct rw_semaphore as synchronization for d

[RFC PATCH V2 1/2] tee: generic TEE subsystem

2015-04-29 Thread Jens Wiklander
g others Jean-michel DELORME and Emmanuel MICHEL * "Generic TrustZone Driver" by Javier González Signed-off-by: Jens Wiklander --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/Kconfig | 2 + drivers/Makefile |

[RFC PATCH V2 2/2] tee: add OP-TEE driver

2015-04-29 Thread Jens Wiklander
using SMCs * Accepts requests on privileged and unprivileged device * Uses OPTEE message protocol version 2 Signed-off-by: Jens Wiklander --- drivers/tee/Kconfig | 10 + drivers/tee/Makefile | 1 + drivers/tee/optee/Kconfig | 19 ++ drivers/tee/optee/Mak

Re: [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-19 Thread Jens Wiklander
Hi Arnd, On Fri, Apr 17, 2015 at 10:07:02PM +0200, Arnd Bergmann wrote: > On Friday 17 April 2015 09:50:56 Jens Wiklander wrote: > > Documentation/ioctl/ioctl-number.txt | 1 + > > drivers/Kconfig | 2 + > > drivers/Makefile |

Re: [RFC PATCH 2/2] tee: add OP-TEE driver

2015-04-19 Thread Jens Wiklander
On Sat, Apr 18, 2015 at 10:57:47AM +0200, Greg Kroah-Hartman wrote: > On Fri, Apr 17, 2015 at 09:50:57AM +0200, Jens Wiklander wrote: > > Adds mostly stubbed OP-TEE driver which also can be compiled as a > > loadable module. > > Please provide a "real" driver, so

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jens Wiklander
On Sat, Apr 18, 2015 at 11:29:23AM -0600, Jason Gunthorpe wrote: > On Sat, Apr 18, 2015 at 10:01:47AM +0100, Russell King - ARM Linux wrote: > > On Fri, Apr 17, 2015 at 10:30:54AM -0600, Jason Gunthorpe wrote: > > > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Je

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jens Wiklander
On Mon, Apr 20, 2015 at 11:55:15AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 03:02:03PM +0200, Jens Wiklander wrote: > > > It appeared to me this driver was copying TPM's old architecture, > > > which is very much known to be broken. > > > >

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-21 Thread Jens Wiklander
On Mon, Apr 20, 2015 at 12:20:52PM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 08:20:44AM +0200, Jens Wiklander wrote: > > > I'm not sure I understand what you mean. This function is a building > > block for the TEE driver to supply whatever interface is needed

Re: [PATCH V3 2/2] tee: add OP-TEE driver

2015-06-18 Thread Jens Wiklander
On Fri, Jun 05, 2015 at 11:48:14AM +0100, Mark Rutland wrote: [...] > > The OP-TEE message protocol is primarily for the OP-TEE driver. Other > > TEE drivers plugging into this framwork may use this protocol too, but I > > guess that most will use their own message protocol. > > > > Provided that

[PATCH] dma-buf: simplified calling conventions for dma_buf_fd()

2018-05-22 Thread Jens Wiklander
: Jens Wiklander --- I received this patch as a response to what has become bb765d1c331f ("tee: shm: fix use-after-free via temporarily dropped reference") drivers/dma-buf/dma-buf.c | 16 + drivers/gpu/drm/drm_prime.c | 15 +++- drivers/gp

Re: [PATCH 05/12] tee: optee: add missing of_node_put after of_device_is_available

2019-02-28 Thread Jens Wiklander
Hi Julia, On Sat, Feb 23, 2019 at 2:58 PM Julia Lawall wrote: > > Add an of_node_put when a tested device node is not available. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > identifier f; > local idexpression e; > expression x; > @@ > >

[GIT PULL] tee subsys fixes for v5.0

2019-02-28 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this last minute fix for the OP-TEE driver. Thanks, Jens The following changes since commit 49a57857aeea06ca831043acbb0fa5e0f50602fd: Linux 5.0-rc3 (2019-01-21 13:14:44 +1300) are available in the Git repository at: https://git.linaro.org/people/jens

[GIT PULL] tee subsys for v5.1

2019-02-28 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull these small TEE subsystem updates. The license for two .h files in OP-TEE driver is clarified with a dual license. The kernel space tee client interface is complemented with cancellation support. I've based this pull request on the last pull request I did (n

[GIT PULL] tee subsys for v5.2

2019-04-17 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this OP-TEE driver patch. It allows the OP-TEE driver to work without a static carved out shared memory area. Thanks, Jens The following changes since commit 1c163f4c7b3f621efff9b28a47abb36f7378d783: Linux 5.0 (2019-03-03 15:21:29 -0800) are available i

Re: [PATCH] tee: optee: add invoke_fn tracepoints

2021-02-23 Thread Jens Wiklander
Hi Jisheng, On Wed, Feb 10, 2021 at 7:44 AM Jisheng Zhang wrote: > > Add tracepoints to retrieve information about the invoke_fn. This would > help to measure how many invoke_fn are triggered and how long it takes > to complete one invoke_fn call. > > Signed-off-by: Jisheng Zhang > --- > > Since

Re: [PATCH 1/2] optee: fix tee out of memory failure seen during kexec reboot

2021-02-23 Thread Jens Wiklander
On Mon, Feb 22, 2021 at 06:15:08PM +0530, Allen Pais wrote: > > > On Wed, 17 Feb 2021 14:57:12 +0530, Allen Pais wrote: > > > - /* > > > - * Ask OP-TEE to free all cached shared memory objects to decrease > > > - * reference counters and also avoid wild pointers in secure world > > > - * into t

Re: [PATCH] tee: optee: add invoke_fn tracepoints

2021-02-23 Thread Jens Wiklander
On Tue, Feb 23, 2021 at 06:40:26PM +0800, Jisheng Zhang wrote: > On Tue, 23 Feb 2021 08:59:22 +0100 Jens Wiklander wrote: > > > > > > Hi Jisheng, > > Hi Jens, > > > > > On Wed, Feb 10, 2021 at 7:44 AM Jisheng Zhang > > wrote: > > >

Re: [PATCH] tee: optee: add invoke_fn tracepoints

2021-02-24 Thread Jens Wiklander
On Tue, Feb 23, 2021 at 09:19:36AM -0500, Steven Rostedt wrote: > On Tue, 23 Feb 2021 14:11:24 +0100 > Jens Wiklander wrote: > > > I used the -strict option. > > > > ./scripts/checkpatch.pl -strict > > 0001-tee-optee-add-invoke_fn-tracepoints.patch > >

Re: [PATCH 1/2] optee: fix tee out of memory failure seen during kexec reboot

2021-02-24 Thread Jens Wiklander
On Tue, Feb 23, 2021 at 09:56:13PM +0530, Allen Pais wrote: > > > > > > > - /* > > > > > - * Ask OP-TEE to free all cached shared memory objects to > > > > > decrease > > > > > - * reference counters and also avoid wild pointers in secure > > > > > world > > > > > - * into th

Re: [PATCH] tee: optee: remove need_resched() before cond_resched()

2021-02-02 Thread Jens Wiklander
On Fri, Jan 29, 2021 at 02:29:33PM +0100, Jens Wiklander wrote: > Hi Rouven and Sumit, > > On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE > wrote: > > > > Hi Rouven and Sumit, > > > > On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander > >

Re: [PATCH] tee: fix some comment typos in header files

2021-02-03 Thread Jens Wiklander
On Sun, Sep 20, 2020 at 3:58 AM Elvira Khabirova wrote: > > struct tee_param: revc -> recv. > TEE_IOC_SUPPL_SEND: typo introduced by copy-pasting, replace invalid > description with description from the according argument struct. > > Signed-off-by: Elvira Khabirova > --- > include/linux/tee_drv.

[GIT PULL] TEE housekeeping for v5.12

2021-02-03 Thread Jens Wiklander
Bjorn Helgaas (1): tee: optee: fix 'physical' typos Elvira Khabirova (1): tee: fix some comment typos in header files Jens Wiklander (1): optee: sync OP-TEE headers Tian Tao (1): drivers: optee: use flexible-array member instead of zero-length array drivers

[GIT PULL] OP-TEE fix for v5.12

2021-02-03 Thread Jens Wiklander
:11:11 +0100) Remove unnecessary need_resched() before cond_resched() Jens Wiklander (1): tee: optee: remove need_resched() before cond_resched() Rouven

Re: [PATCH] optee: sync OP-TEE headers

2021-02-02 Thread Jens Wiklander
On Tue, Feb 2, 2021 at 5:47 AM Sumit Garg wrote: > > On Fri, 29 Jan 2021 at 19:13, Jens Wiklander via OP-TEE > wrote: > > > > Pulls in updates in the internal headers from OP-TEE OS [1]. A few > > defines has been shortened, hence the changes in rpc.c. Defines no

Re: [PATCHv7] drivers: optee: allow op-tee to access devices on the i2c bus

2020-08-12 Thread Jens Wiklander
On Tue, Aug 11, 2020 at 07:55:31PM +0200, Jorge Ramirez-Ortiz wrote: > Some secure elements like NXP's SE050 sit on I2C buses. For OP-TEE to > control this type of cryptographic devices it needs coordinated access > to the bus, so collisions and RUNTIME_PM dont get in the way. > > This trampoline

Re: [PATCHv6] drivers: optee: allow op-tee to access devices on the i2c bus

2020-08-05 Thread Jens Wiklander
On Wed, Aug 05, 2020 at 03:35:01PM +0200, Jorge Ramirez-Ortiz, Foundries wrote: > On 22/07/20, Jorge Ramirez-Ortiz wrote: > > Some secure elements like NXP's SE050 sit on I2C buses. For OP-TEE to > > control this type of cryptographic devices it needs coordinated access > > to the bus, so collision

Re: [PATCH] tee: optee: add invoke_fn tracepoints

2021-03-25 Thread Jens Wiklander
On Thu, Mar 25, 2021 at 3:50 AM Jisheng Zhang wrote: > > On Wed, 24 Mar 2021 10:53:13 -0400 > Steven Rostedt wrote: > > > > > > On Wed, 24 Mar 2021 07:48:53 -0700 > > Guenter Roeck wrote: > > > > > On Wed, Mar 24, 2021 at 07:34:07AM -0700, Guenter Roeck wrote: > > > > On Wed, Feb 10, 2021 at 02:

[PATCH 0/6] Add FF-A support in OP-TEE driver

2021-03-25 Thread Jens Wiklander
alized. Thanks, Jens [1] https://developer.arm.com/documentation/den0077/latest [2] https://lore.kernel.org/linux-arm-kernel/20210212154614.38604-1-sudeep.ho...@arm.com/ [3] git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.11/ffa Jens Wiklander (6): tee: add sec_world_id

[PATCH 2/6] optee: simplify optee_release()

2021-03-25 Thread Jens Wiklander
Simplifies optee_release() with a new helper function, optee_close_session_helper() which has been factored out from optee_close_session(). A separate optee_release_supp() is added for the supplicant device. Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c | 31

[PATCH 3/6] optee: sync optee_msg.h and optee_rpc_cmd.h

2021-03-25 Thread Jens Wiklander
y are forwarded as opaque requests to tee-supplicant. Signed-off-by: Jens Wiklander --- drivers/tee/optee/optee_msg.h | 143 + drivers/tee/optee/optee_rpc_cmd.h | 333 ++ drivers/tee/optee/rpc.c | 32 +-- 3 files changed, 360 insertions(+), 148 dele

[PATCH 5/6] optee: add a FF-A memory pool

2021-03-25 Thread Jens Wiklander
Adds a memory pool to be used when the driver uses FF-A [1] as transport layer. [1] https://developer.arm.com/documentation/den0077/latest Signed-off-by: Jens Wiklander --- drivers/tee/optee/shm_pool.c | 65 +--- drivers/tee/optee/shm_pool.h | 1 + 2 files

[PATCH 1/6] tee: add sec_world_id to struct tee_shm

2021-03-25 Thread Jens Wiklander
Adds sec_world_id to struct tee_shm which describes a shared memory object. sec_world_id can be used by a driver to store an id assigned by secure world. Signed-off-by: Jens Wiklander --- include/linux/tee_drv.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include

[PATCH 4/6] optee: refactor driver with internal callbacks

2021-03-25 Thread Jens Wiklander
makes room for using other primitives to communicate with OP-TEE in secure world while being able to reuse as much as possible from the present driver. Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c | 78 --- drivers/tee/optee/core.c | 158

[PATCH 6/6] optee: add FF-A support

2021-03-25 Thread Jens Wiklander
include the information needed. The FF-A part of this driver is enabled if CONFIG_ARM_FFA_TRANSPORT is enabled. [1] https://developer.arm.com/documentation/den0077/latest Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c | 222 +- drivers/tee/optee/core.c | 485

Re: [PATCH v2 1/2] optee: fix tee out of memory failure seen during kexec reboot

2021-03-19 Thread Jens Wiklander
On Tue, Mar 16, 2021 at 2:21 PM Allen Pais wrote: > > > > >> > >> [0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed > >> [0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22 > >> > >> tee_shm_release() is not invoked on dma shm buffer. > >> > >> Implement .shutdown() m

[GIT PULL] OP-TEE memref size check for v5.13

2021-03-30 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this small patch for the OP-TEE driver to remove the invalid size check of outgoing memref parameters. This code path is only activated for a certain configuration of OP-TEE in secure world (CFG_CORE_DYN_SHM=n) so this problem isn't always visible. Thanks, J

Re: Build breakage in next-20210330 due to optee_trace.h

2021-03-30 Thread Jens Wiklander
Hi Pratyush, On Wed, Mar 31, 2021 at 4:03 AM Pratyush Yadav wrote: > > Hi, > > I recently rebased a dev branch on top of next-20210330 (4143e05b7b17) > and I notice a build error from the optee driver: > > In file included from drivers/tee/optee/call.c:18: > In file included from drivers/tee/

[GIT PULL] OP-TEE tracepoints fix for v5.13

2021-03-30 Thread Jens Wiklander
Hello arm-soc maintainers, The previous pull request for OP-TEE tracepoints introduced a build error when building whithout O=..., apparently many regression builds uses that option. Please pull this small fix for the build error. Thanks, Jens The following changes since commit 0101947dbcc3204f

Re: [PATCH] tee: optee: fix build error caused by recent optee tracepoints feature

2021-03-30 Thread Jens Wiklander
On Thu, Mar 25, 2021 at 12:06:01PM +0800, Jisheng Zhang wrote: > If build kernel without "O=dir", below error will be seen: > > In file included from drivers/tee/optee/optee_trace.h:67, > from drivers/tee/optee/call.c:18: > ./include/trace/define_trace.h:95:42: fatal error: ./opte

Re: [PATCH v2] tee: amdtee: unload TA only when its refcount becomes 0

2021-04-14 Thread Jens Wiklander
Hi Jiro, On Mon, Apr 12, 2021 at 12:20 PM Rijo Thomas wrote: > > > > On 12/04/21 1:06 pm, Jens Wiklander wrote: > > On Mon, Apr 5, 2021 at 11:43 AM Rijo Thomas > > wrote: > >> > >> Same Trusted Application (TA) can be loaded in multiple TEE context

Re: [PATCH] tee: optee: fix build error caused by recent optee tracepoints feature

2021-04-06 Thread Jens Wiklander
Hi Heiko, [+Arnd] On Tue, Apr 6, 2021 at 12:38 PM Heiko Thiery wrote: > > Hi Jens, > > Am Di., 30. März 2021 um 10:26 Uhr schrieb Jens Wiklander > : > > > > On Thu, Mar 25, 2021 at 12:06:01PM +0800, Jisheng Zhang wrote: > > > If build kernel witho

Re: [PATCH 1/1] tee: optee: do not check memref size on return from Secure World

2021-04-01 Thread Jens Wiklander
k in optee_from_msg_param() is incorrect and > > needs to be removed. This fixes a number of failed test cases in the > > GlobalPlatform TEE Initial Configuratiom Test Suite v2_0_0_0-2017_06_09 > > when OP-TEE is compiled without dynamic shared memory support > > (CFG

Re: [GIT PULL] OP-TEE tracepoints fix for v5.13

2021-04-01 Thread Jens Wiklander
On Thu, Apr 1, 2021 at 12:23 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > On Tue, 30 Mar 2021 10:22:08 +0200, Jens Wiklander wrote: > > The previous pull request for OP-TEE tracepoints introduced a build > > error when building whithout O=..., apparently many re

Re: [PATCH v1 1/1] tee: optee: Provide special parameter field for UUID values

2021-04-19 Thread Jens Wiklander
Hi Andy, On Thu, Apr 15, 2021 at 4:58 PM Andy Shevchenko wrote: > > Dereferencing something to uuid_t value is not good idea strictly speaking. > Provide a special parameter field for UUID values and drop ugly casting. > > Signed-off-by: Andy Shevchenko > --- > drivers/tee/optee/call.c | 2

Re: [PATCH v1 1/1] tee: optee: Provide special parameter field for UUID values

2021-04-19 Thread Jens Wiklander
On Mon, Apr 19, 2021 at 2:01 PM Andy Shevchenko wrote: > > On Mon, Apr 19, 2021 at 01:35:51PM +0200, Jens Wiklander wrote: > > On Thu, Apr 15, 2021 at 4:58 PM Andy Shevchenko > > wrote: > > Thanks for review, my answer below. > > > >

Re: [PATCH v1 1/1] tee: optee: Provide special parameter field for UUID values

2021-04-19 Thread Jens Wiklander
On Mon, Apr 19, 2021 at 3:40 PM Andy Shevchenko wrote: > > On Mon, Apr 19, 2021 at 4:30 PM Jens Wiklander > wrote: > > On Mon, Apr 19, 2021 at 2:01 PM Andy Shevchenko > > wrote: > > > > > > On Mon, Apr 19, 2021 at 01:35:51PM +0200, Jens Wiklander wrote:

[PATCH] optee: use export_uuid() to copy client UUID

2021-04-20 Thread Jens Wiklander
order to avoid casting. Fixes: c5b4312bea5d ("tee: optee: Add support for session login client UUID generation") Suggested-by: Andy Shevchenko Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c | 6 -- drivers/tee/optee/optee_msg.h | 6 -- 2 files changed, 8 insert

Re: [PATCH] dt-bindings: arm: firmware: Convert linaro,optee-tz to json schema

2021-04-20 Thread Jens Wiklander
b5ac8b2c > --- /dev/null > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > @@ -0,0 +1,62 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/arm/firmware/linaro,optee-tz.yaml# > +$

Re: [PATCH] optee: enable apci support

2021-03-17 Thread Jens Wiklander
On Fri, Mar 12, 2021 at 04:36:53PM +0800, Ran Wang wrote: > This patch add ACPI support for optee driver. > > Signed-off-by: Ran Wang > --- > drivers/tee/optee/core.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c > index

Re: [PATCH v2] tee: amdtee: unload TA only when its refcount becomes 0

2021-04-12 Thread Jens Wiklander
On Mon, Apr 5, 2021 at 11:43 AM Rijo Thomas wrote: > > Same Trusted Application (TA) can be loaded in multiple TEE contexts. > > If it is a single instance TA, the TA should not get unloaded from AMD > Secure Processor, while it is still in use in another TEE context. > > Therefore reference count

Re: [PATCH] Properly check tee_shm buffer mmap offset

2020-11-23 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] optee: add writeback to valid memory type

2020-11-25 Thread Jens Wiklander
On Fri, Nov 13, 2020 at 4:06 PM Rui Miguel Silva wrote: > > Only in smp systems the cache policy is setup as write alloc, in > single cpu systems the cache policy is set as writeback and it is > normal memory, so, it should pass the is_normal_memory check in the > share memory registration. > > Ad

[GIT PULL] OP-TEE driver for v5.11

2020-11-25 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this small patch which allows the OP-TEE driver to work with ARMv7 based single CPU systems. Thanks, Jens The following changes since commit 3cea11cd5e3b00d91caf0b4730194039b45c5891: Linux 5.10-rc2 (2020-11-01 14:43:51 -0800) are available in the Git re

Re: [PATCH] optee: extend normal memory check to also write-through

2020-12-02 Thread Jens Wiklander
Hi Andrey, On Wed, Dec 2, 2020 at 8:11 AM Andrey Zhizhikin wrote: > > ARMv7 Architecture Reference Manual [1] section A3.5.5 details Normal > memory type, together with cacheability attributes that could be applied > to memory regions defined as "Normal memory". > > Section B2.1.2 of the Architec

Re: [PATCH] optee: extend normal memory check to also write-through

2020-12-02 Thread Jens Wiklander
On Wed, Dec 2, 2020 at 10:41 AM ZHIZHIKIN Andrey wrote: > > Hello Jens, > > > -Original Message- > > From: Jens Wiklander > > Sent: Wednesday, December 2, 2020 9:07 AM > > To: ZHIZHIKIN Andrey > > Cc: op-...@lists.trustedfirmware.org; Linux Kernel

Re: [PATCH v2 1/2] optee: fix tee out of memory failure seen during kexec reboot

2021-03-01 Thread Jens Wiklander
On Thu, Feb 25, 2021 at 10:06 AM Allen Pais wrote: > > From: Allen Pais > > The following out of memory errors are seen on kexec reboot > from the optee core. > > [0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed > [0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22

Re: [PATCH] tee: amdtee: unload TA only when its refcount becomes 0

2021-03-15 Thread Jens Wiklander
On Sun, Mar 07, 2021 at 12:05:01PM +0530, Rijo Thomas wrote: > Same Trusted Application (TA) can be loaded in multiple TEE contexts. > > If it is a single instance TA, the TA should not get unloaded from AMD > Secure Processor, while it is still in use in another TEE context. > > Therefore refere

[GIT PULL] OP-TEE tracepoints for v5.13

2021-03-15 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this patch adding tracepoints around calls to OP-TEE in secure world. Thanks, Jens The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15: Linux 5.12-rc2 (2021-03-05 17:33:41 -0800) are available in the Git repository at: git://g

Re: [PATCH v2] tee: optee: replace might_sleep with cond_resched

2021-01-21 Thread Jens Wiklander
On Tue, Jan 5, 2021 at 11:29 AM Rouven Czerwinski wrote: > > might_sleep() is a debugging aid and triggers rescheduling only for > certain kernel configurations. Replace with an explicit check and > reschedule to work for all kernel configurations. Fixes the following > trace: > > [ 572.945146]

[GIT PULL] OP-TEE driver fix for v5.11

2021-01-21 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this small patch taking care of a rcu_sched trace in some corner cases when OP-TEE is invoked. Thanks, Jens The following changes since commit e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62: Linux 5.11-rc2 (2021-01-03 15:55:30 -0800) are available in the Git

Re: [PATCH] optee: simplify i2c access

2021-02-07 Thread Jens Wiklander
Hi Jorge, On Wed, Jan 27, 2021 at 11:41 AM Jens Wiklander wrote: > > Hi Arnd, > > On Mon, Jan 25, 2021 at 12:38 PM Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > Storing a bogus i2c_client structure on the stack adds overhead and > > causes a

Re: [PATCH] optee: simplify i2c access

2021-02-08 Thread Jens Wiklander
On Mon, Feb 8, 2021 at 9:32 AM Jorge Ramirez-Ortiz, Foundries wrote: > > On 08/02/21, Jorge Ramirez-Ortiz, Foundries wrote: > > On 08/02/21, Jens Wiklander wrote: > > > Hi Jorge, > > > > > > On Wed, Jan 27, 2021 at 11:41 AM Jens Wiklander > > > wr

[GIT PULL] OP-TEE I2C simplification for v5.12

2021-02-08 Thread Jens Wiklander
Hello arm-soc maintainers, Please pull this fix eliminating a stack frame size warning and also simplifying I2C access in the OP-TEE driver. Thanks, Jens The following changes since commit e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62: Linux 5.11-rc2 (2021-01-03 15:55:30 -0800) are available in

Re: [PATCH] tee: optee: remove need_resched() before cond_resched()

2021-01-26 Thread Jens Wiklander
Hi Rouven and Sumit, On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander wrote: > > Testing need_resched() before cond_resched() is not needed as an > equivalent test is done internally in cond_resched(). So drop the > need_resched() test. > > Fixes: dcb3b06d9c34 ("tee: opt

Re: [PATCH] tee: optee: replace might_sleep with cond_resched

2021-01-04 Thread Jens Wiklander
On Tue, Jan 5, 2021 at 6:42 AM Sumit Garg wrote: > > On Fri, 25 Sept 2020 at 12:29, Jens Wiklander via OP-TEE > wrote: > > > > On Fri, Sep 18, 2020 at 7:45 PM Rouven Czerwinski > > wrote: > > > > > > On Kernels with CONFIG_PREEMPT_NONE might_slee

[PATCH] tee: optee: remove need_resched() before cond_resched()

2021-01-25 Thread Jens Wiklander
Testing need_resched() before cond_resched() is not needed as an equivalent test is done internally in cond_resched(). So drop the need_resched() test. Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched") Signed-off-by: Jens Wiklander --- drivers/tee/optee/call.c

Re: [PATCH] optee: simplify i2c access

2021-01-27 Thread Jens Wiklander
er to read > and avoids the warning. > > Fixes: c05210ab9757 ("drivers: optee: allow op-tee to access devices on the > i2c bus") > Signed-off-by: Arnd Bergmann > --- > drivers/tee/optee/rpc.c | 31 --- > 1 file changed, 16 insertions(+), 15 dele

Re: [GIT PULL] OP-TEE driver for v5.11

2020-11-26 Thread Jens Wiklander
Hi Arnd, On Thu, Nov 26, 2020 at 10:00 PM Arnd Bergmann wrote: > > On Wed, Nov 25, 2020 at 1:01 PM Jens Wiklander > wrote: > > > > Hello arm-soc maintainers, > > > > Please pull this small patch which allows the OP-TEE driver to work with > > ARMv7 based

Re: [PATCH 061/141] tee: Fix fall-through warnings for Clang

2020-11-22 Thread Jens Wiklander
ssues/115 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/tee/tee_core.c | 1 + > 1 file changed, 1 insertion(+) Acked-by: Jens Wiklander Thanks, Jens

[PATCH v4 0/5] generic TEE subsystem

2015-07-08 Thread Jens Wiklander
uses an struct rw_semaphore as synchronization for driver detachment - uses alloc/register pattern from TPM Thanks, Jens Jens Wiklander (5): arm/arm64: add smccc ARCH32 dt/bindings: add bindings for optee tee: generic TEE subsystem tee: add OP-TEE driver Documentation: tee su

[PATCH v4 3/5] tee: generic TEE subsystem

2015-07-08 Thread Jens Wiklander
milar implementations trying to solve the same problem: * "optee_linuxdriver" by among others Jean-michel DELORME and Emmanuel MICHEL * "Generic TrustZone Driver" by Javier González Signed-off-by: Jens Wiklander --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS

[PATCH v4 4/5] tee: add OP-TEE driver

2015-07-08 Thread Jens Wiklander
communicate with secure world Signed-off-by: Jens Wiklander --- MAINTAINERS | 5 + drivers/tee/Kconfig | 10 + drivers/tee/Makefile | 1 + drivers/tee/optee/Kconfig | 8 + drivers/tee/optee/Makefile| 5 + drivers/tee/optee/call.c

[PATCH v4 2/5] dt/bindings: add bindings for optee

2015-07-08 Thread Jens Wiklander
Introduces optee prefix and adds bindings for ARM TrustZone based OP-TEE implementation. Signed-off-by: Jens Wiklander --- Documentation/devicetree/bindings/optee/optee.txt | 17 + Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 2 files changed, 18 insertions

[PATCH v4 5/5] Documentation: tee subsystem and op-tee driver

2015-07-08 Thread Jens Wiklander
Signed-off-by: Jens Wiklander --- Documentation/00-INDEX | 2 + Documentation/tee.txt | 117 + MAINTAINERS| 1 + 3 files changed, 120 insertions(+) create mode 100644 Documentation/tee.txt diff --git a/Documentation/00-INDEX b

[PATCH v4 1/5] arm/arm64: add smccc ARCH32

2015-07-08 Thread Jens Wiklander
Adds helpers to do SMC based on ARM SMC Calling Convention. CONFIG_HAVE_SMCCC is enabled for architectures that may support the SMC instruction. It's the responsibility of the caller to know if the SMC instruction is supported by the platform. Signed-off-by: Jens Wiklander --- arch/arm/Kc

Re: [PATCH v4 3/5] tee: generic TEE subsystem

2015-07-09 Thread Jens Wiklander
On Wed, Jul 08, 2015 at 11:10:26AM -0600, Jason Gunthorpe wrote: > On Wed, Jul 08, 2015 at 12:16:30PM +0200, Jens Wiklander wrote: > > > +static void tee_device_complete_unused(struct kref *kref) > > +{ > > + struct tee_device *teedev; > > + > > + teedev =

  1   2   3   >