Hi all,
This patchset optimizes handling of the argument struct passed to
call_with_arg when doing a yielding call to OP-TEE.
Prior to this was this struct allocated before the yielding call and
then freed after it had returned. In case many calls are made in succession
this results in quite a bit of unnecessary allocte/free and possibly also
switching back and forth to secure work in order to register if needed.
Another optimization handles the way the argument struct needed to do RPC
is passed. Please see the patch "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG" for details.
Thanks,
Jens
v1->v2:
* Split out a separate commit "optee: rename rpc_arg_count to
rpc_param_count"
* Check optee->rpc_param_count before calling optee_disable_shm_cache().
* Mention OPTEE_SMC_CALL_WITH_REGD_ARG in commit message.
v2->v3:
* Applied Sumit's R-B to "optee: rename rpc_arg_count to rpc_param_count"
and "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG"
* Fixed some review comments to "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG"
* Rebased on v5.18-rc1
v3->v4:
* Updated "optee: cache argument shared memory structs" to work with older
versions of the SMC-ABI when using dynamic shared memory.
Jens Wiklander (4):
optee: rename rpc_arg_count to rpc_param_count
optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG
optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET
optee: cache argument shared memory structs
drivers/tee/optee/call.c | 238 ++++++++++++++++++++++++------
drivers/tee/optee/core.c | 1 +
drivers/tee/optee/ffa_abi.c | 36 +++--
drivers/tee/optee/optee_ffa.h | 12 +-
drivers/tee/optee/optee_private.h | 31 +++-
drivers/tee/optee/optee_smc.h | 48 +++++-
drivers/tee/optee/smc_abi.c | 197 ++++++++++++++++++++-----
7 files changed, 461 insertions(+), 102 deletions(-)
--
2.31.1
While we pass uuid_null intentionally to ffa_partition_probe in
ffa_setup_partitions to get the count of the partitions, it must not be
uuid_null in ffa_partition_info_get which is used by the ffa_drivers
to fetch the specific partition info passing the UUID of the partition.
Fix ffa_partition_info_get by passing the received uuid down to
ffa_partition_probe so that the correct partition information is fetched.
Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions")
Reported-by: Arunachalam Ganapathy <arunachalam.ganapathy(a)arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla(a)arm.com>
---
drivers/firmware/arm_ffa/driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index ccccecae615f..6a913ac91e8e 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -588,7 +588,7 @@ static int ffa_partition_info_get(const char *uuid_str,
return -ENODEV;
}
- count = ffa_partition_probe(&uuid_null, &pbuf);
+ count = ffa_partition_probe(&uuid, &pbuf);
if (count <= 0)
return -ENOENT;
--
2.36.0
Variable rng_size is being initialized with a value that is never read,
the variable is being re-assigned later on. The initialization is
redundant and can be removed.
Cleans up cppcheck warning:
Variable 'rng_size' is assigned a value that is never used.
Signed-off-by: Colin Ian King <colin.i.king(a)gmail.com>
---
drivers/char/hw_random/optee-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index a948c0727b2b..96b5d546d136 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -115,7 +115,7 @@ static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
static int optee_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
{
struct optee_rng_private *pvt_data = to_optee_rng_private(rng);
- size_t read = 0, rng_size = 0;
+ size_t read = 0, rng_size;
int timeout = 1;
u8 *data = buf;
--
2.35.1
Hi,
OP-TEE Contributions (LOC) monthly meeting is planned for Thursday April 28
@17.00 (UTC + 2).
We have following on the agenda
- Fault Mitigation patterns in OP-TEE - Jens Wiklander
If you have any more topics you'd like to discuss, please let us know and
we can schedule them.
Meeting details:
---------------
Date/time: April 28(a)17.00 (UTC + 2)
https://everytimezone.com/s/700b9d66
Connection details: https://www.trustedfirmware.org/meetings/
Meeting notes: http://bit.ly/loc-notes
Regards,
Ruchika on behalf of the Linaro OP-TEE team
Hi all,
This patchset optimizes handling of the argument struct passed to
call_with_arg when doing a yielding call to OP-TEE.
Prior to this was this struct allocated before the yielding call and
then freed after it had returned. In case many calls are made in succession
this results in quite a bit of unnecessary allocte/free and possibly also
switching back and forth to secure work in order to register if needed.
Another optimization handles the way the argument struct needed to do RPC
is passed. Please see the patch "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG" for details.
Thanks,
Jens
v1->v2:
* Split out a separate commit "optee: rename rpc_arg_count to
rpc_param_count"
* Check optee->rpc_param_count before calling optee_disable_shm_cache().
* Mention OPTEE_SMC_CALL_WITH_REGD_ARG in commit message.
v2->v3:
* Applied Sumit's R-B to "optee: rename rpc_arg_count to rpc_param_count"
and "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG"
* Fixed some review comments to "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG"
* Rebased on v5.18-rc1
Jens Wiklander (4):
optee: rename rpc_arg_count to rpc_param_count
optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG
optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET
optee: cache argument shared memory structs
drivers/tee/optee/call.c | 238 ++++++++++++++++++++++++------
drivers/tee/optee/core.c | 1 +
drivers/tee/optee/ffa_abi.c | 36 +++--
drivers/tee/optee/optee_ffa.h | 12 +-
drivers/tee/optee/optee_private.h | 31 +++-
drivers/tee/optee/optee_smc.h | 48 +++++-
drivers/tee/optee/smc_abi.c | 162 +++++++++++++++-----
7 files changed, 428 insertions(+), 100 deletions(-)
--
2.31.1
Hello arm-soc maintainers,
Please pull this small OP-TEE driver fix for the error handling path in
the FF-A probe function.
Thanks,
Jens
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
git://git.linaro.org/people/jens.wiklander/linux-tee.git tags/optee-fix-for-v5.18
for you to fetch changes up to b5e22886839ae466fcf03295150094516c0fd8eb:
tee: optee: add missing mutext_destroy in optee_ffa_probe (2022-04-05 08:56:26 +0200)
----------------------------------------------------------------
OP-TEE fix missing mutex_destroy in probe error handling path
----------------------------------------------------------------
Dongliang Mu (1):
tee: optee: add missing mutext_destroy in optee_ffa_probe
drivers/tee/optee/ffa_abi.c | 1 +
1 file changed, 1 insertion(+)