diff options
author | Alistair Delva <adelva@google.com> | 2021-02-16 21:01:22 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-16 21:01:22 +0000 |
commit | efb2826bb8160e2d8e0fcec85133a7468484f9fd (patch) | |
tree | 37a21c69306801ee7cdda5167a30896c8740155b /bl32/tsp/tsp_main.c | |
parent | b00a71fc312c9781fa6f404dccfb55b062b2ccac (diff) | |
parent | faa476c0caaa598afa5a6109d17102db5fe35ec6 (diff) | |
download | platform_external_arm-trusted-firmware-master.tar.gz platform_external_arm-trusted-firmware-master.tar.bz2 platform_external_arm-trusted-firmware-master.zip |
Merge branch 'aosp/upstream-master' into HEAD am: faa476c0caHEADandroid-s-beta-5android-s-beta-4android-s-beta-3android-s-beta-2android-s-beta-1mastermain-cg-testing-releaseandroid-s-beta-5android-s-beta-4
Original change: https://android-review.googlesource.com/c/platform/external/arm-trusted-firmware/+/1589611
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I3a25534ceed4f8e188510641080d8b8ed49b8f62
Diffstat (limited to 'bl32/tsp/tsp_main.c')
-rw-r--r-- | bl32/tsp/tsp_main.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index e1d961cc6..01c9ec58f 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -273,11 +273,11 @@ tsp_args_t *tsp_cpu_resume_main(uint64_t max_off_pwrlvl, spin_lock(&console_lock); INFO("TSP: cpu 0x%lx resumed. maximum off power level %lld\n", read_mpidr(), max_off_pwrlvl); - INFO("TSP: cpu 0x%lx: %d smcs, %d erets %d cpu suspend requests\n", + INFO("TSP: cpu 0x%lx: %d smcs, %d erets %d cpu resume requests\n", read_mpidr(), tsp_stats[linear_id].smc_count, tsp_stats[linear_id].eret_count, - tsp_stats[linear_id].cpu_suspend_count); + tsp_stats[linear_id].cpu_resume_count); spin_unlock(&console_lock); #endif /* Indicate to the SPD that we have completed this request */ @@ -363,30 +363,38 @@ tsp_args_t *tsp_smc_handler(uint64_t func, uint64_t arg6, uint64_t arg7) { + uint128_t service_args; + uint64_t service_arg0; + uint64_t service_arg1; uint64_t results[2]; - uint64_t service_args[2]; uint32_t linear_id = plat_my_core_pos(); /* Update this cpu's statistics */ tsp_stats[linear_id].smc_count++; tsp_stats[linear_id].eret_count++; +#if LOG_LEVEL >= LOG_LEVEL_INFO + spin_lock(&console_lock); INFO("TSP: cpu 0x%lx received %s smc 0x%llx\n", read_mpidr(), ((func >> 31) & 1) == 1 ? "fast" : "yielding", func); INFO("TSP: cpu 0x%lx: %d smcs, %d erets\n", read_mpidr(), tsp_stats[linear_id].smc_count, tsp_stats[linear_id].eret_count); + spin_unlock(&console_lock); +#endif /* Render secure services and obtain results here */ results[0] = arg1; results[1] = arg2; /* - * Request a service back from dispatcher/secure monitor. This call - * return and thereafter resume execution + * Request a service back from dispatcher/secure monitor. + * This call returns and thereafter resumes execution. */ - tsp_get_magic(service_args); + service_args = tsp_get_magic(); + service_arg0 = (uint64_t)service_args; + service_arg1 = (uint64_t)(service_args >> 64U); #if CTX_INCLUDE_MTE_REGS /* @@ -399,20 +407,20 @@ tsp_args_t *tsp_smc_handler(uint64_t func, /* Determine the function to perform based on the function ID */ switch (TSP_BARE_FID(func)) { case TSP_ADD: - results[0] += service_args[0]; - results[1] += service_args[1]; + results[0] += service_arg0; + results[1] += service_arg1; break; case TSP_SUB: - results[0] -= service_args[0]; - results[1] -= service_args[1]; + results[0] -= service_arg0; + results[1] -= service_arg1; break; case TSP_MUL: - results[0] *= service_args[0]; - results[1] *= service_args[1]; + results[0] *= service_arg0; + results[1] *= service_arg1; break; case TSP_DIV: - results[0] /= service_args[0] ? service_args[0] : 1; - results[1] /= service_args[1] ? service_args[1] : 1; + results[0] /= service_arg0 ? service_arg0 : 1; + results[1] /= service_arg1 ? service_arg1 : 1; break; default: break; |