aboutsummaryrefslogtreecommitdiff
path: root/bl32/tsp
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-03-20 01:46:21 -0500
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-03-20 01:46:21 -0500
commitae7b922d87597ecde226be632633f11a17ccba20 (patch)
treee7e1ba6b9b37bf66681b20d6ca8ffc24ddbcbee9 /bl32/tsp
parentc9796852718f66fab99f9e27d58e18fd757dbe60 (diff)
downloadtrusted-firmware-a-ae7b922d87597ecde226be632633f11a17ccba20.tar.gz
Bug fix: Protect TSP prints with lock
CPUs use console to print debug/info messages. This critical section must be guarded by locks to avoid overlaps in messages from multiple CPUs. Change-Id: I786bf90072c1ed73c4f53d8c950979d95255e67e Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Diffstat (limited to 'bl32/tsp')
-rw-r--r--bl32/tsp/tsp_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c
index 9da2f9af99..e9478380c0 100644
--- a/bl32/tsp/tsp_main.c
+++ b/bl32/tsp/tsp_main.c
@@ -371,12 +371,16 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
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;