opened
a2t2
username_0
I have a situation where I am writing a single instance TA which has two commands. Command 1 takes long and a different client may need to invoke command 2 in the mean time.

Client 1 can invoke Command 1 fine. It takes a few seconds to complete.
During that time, if Client 2 invokes Command 2, I observe the following:

```
DEBUG:   [0x0] TEE-CORE:tee_ta_init_static_ta_session:159:    Lookup for Static TA d85467d1-cb7e-450b-98c749c8914a8802
DEBUG:   [0x0] TEE-CORE:init_session_with_signed_ta:614:    Load dynamic TA
DEBUG:   [0x0] TEE-CORE:ta_load:396: Loaded TA at 0x3f200000
DEBUG:   [0x0] TEE-CORE:ta_load:397: ELF load address 0x40006000
DEBUG:   [0x0] TEE-CORE:init_session_with_signed_ta:620:       dyn TA : d85467d1-cb7e-450b-98c749c8914a8802
ERROR:   TEE-CORE: INFO:    USER-TA: Executing command 1
// Command 2 invocation
DEBUG:   [0x1] TEE-CORE:tee_ta_init_session_with_context:395:    ... Re-open TA d85467d1-cb7e-450b-98c749c8914a8802
DEBUG:   [0x1] TEE-CORE:wq_rpc:57: sleep thread 1 0x3f037028

```
My TA is configured as follows:
`#define TA_FLAGS                    (TA_FLAG_SINGLE_INSTANCE | TA_FLAG_INSTANCE_KEEP_ALIVE | TA_FLAG_MULTI_SESSION | TA_FLAG_EXEC_DDR)`

Is it possible for command 2 to be executed from a different client while command 1 is still executing ?

Thanks.
Does OPTEE support multiple clients for single instance TA ?
issue
created
jforissier
username_1
Hi @username_0,

For concurrent execution you need to clear the single instance flag. See the GlobalPlatform Internal Core API Specification v1.1 sections 2.1.6 "Instance Types" and 4.5 "Trusted Application Configuration Properties".
comment
created
a2t2
username_0
Based on how I read this, it seems to imply that multi session is not ignored if singleinstance is set to true. Please correct if I'm reading this incorrectly. 

Thanks.
comment
created
jforissier
username_1
You can have multiple sessions, but not invoking commands at the same time (sorry I don't have the spec right now so can't point to a specific section).
comment
created
tranhuanltv
username_2
comment