diff options
author | Edison Ai <edison.ai@arm.com> | 2019-08-06 13:38:27 +0800 |
---|---|---|
committer | Edison Ai <edison.ai@arm.com> | 2019-08-16 11:32:04 +0800 |
commit | e95a75ad9be37cdd39db0c787751002cc65fc9f5 (patch) | |
tree | 49050c028d7d343d25cf77ce7bba5bcc41a61ac4 | |
parent | 9cc26248d1f51581a872a4c29d6ad9f7746aec66 (diff) | |
download | trusted-firmware-m-e95a75ad9be37cdd39db0c787751002cc65fc9f5.tar.gz |
Core: Refine psa_set_rhandle()
Save reverse handle when process psa_set_rhandle() for the connect
handle had been created before psa_set_rhandle() is called.
Change-Id: I4026935ca2c82191bfd19b6a7dcdf2ba02ac7889
Signed-off-by: Edison Ai <edison.ai@arm.com>
-rw-r--r-- | secure_fw/core/ipc/tfm_svcalls.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/secure_fw/core/ipc/tfm_svcalls.c b/secure_fw/core/ipc/tfm_svcalls.c index c2f50e0c1a..e7a57677af 100644 --- a/secure_fw/core/ipc/tfm_svcalls.c +++ b/secure_fw/core/ipc/tfm_svcalls.c @@ -504,16 +504,10 @@ static void tfm_svcall_psa_set_rhandle(uint32_t *args) tfm_panic(); } - /* - * Connection handle is not created while SP is processing PSA_IPC_CONNECT - * message. Store reverse handle temporarily and re-set it after the - * connection created. - */ - if (msg->handle != PSA_NULL_HANDLE) { - tfm_spm_set_rhandle(msg->service, msg->handle, rhandle); - } else { - msg->msg.rhandle = rhandle; - } + msg->msg.rhandle = rhandle; + + /* Store reverse handle for following client calls. */ + tfm_spm_set_rhandle(msg->service, msg->handle, rhandle); } /** @@ -830,11 +824,6 @@ static void tfm_svcall_psa_reply(uint32_t *args) */ if (status == PSA_SUCCESS) { ret = msg->handle; - - /* Set reverse handle after connection created if needed. */ - if (msg->msg.rhandle) { - tfm_spm_set_rhandle(service, msg->handle, msg->msg.rhandle); - } } else if (status == PSA_ERROR_CONNECTION_REFUSED) { ret = PSA_ERROR_CONNECTION_REFUSED; } else if (status == PSA_ERROR_CONNECTION_BUSY) { |