From 399fb08fff2e4a0cad4cd1cf0ece84db6670447f Mon Sep 17 00:00:00 2001 From: Andrew Thoelke Date: Tue, 20 May 2014 21:43:27 +0100 Subject: Use a vector table for TSP entrypoints The TSP has a number of entrypoints used by the TSP on different occasions. These were provided to the TSPD as a table of function pointers, and required the TSPD to read the entry in the table, which is in TSP memory, in order to program the exception return address. Ideally, the TSPD has no access to the TSP memory. This patch changes the table of function pointers into a vector table of single instruction entrypoints. This allows the TSPD to calculate the entrypoint address instead of read it. Fixes ARM-software/tf-issues#160 Change-Id: Iec6e055d537ade78a45799fbc6f43765a4725ad3 --- bl32/tsp/tsp_main.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'bl32/tsp/tsp_main.c') diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index 1c3f3b98..ad7ee0a2 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -60,22 +60,6 @@ static tsp_args_t tsp_smc_args[PLATFORM_CORE_COUNT]; ******************************************************************************/ work_statistics_t tsp_stats[PLATFORM_CORE_COUNT]; -/******************************************************************************* - * Single reference to the various entry points exported by the test secure - * payload. A single copy should suffice for all cpus as they are not expected - * to change. - ******************************************************************************/ -static const entry_info_t tsp_entry_info = { - tsp_std_smc_entry, - tsp_fast_smc_entry, - tsp_cpu_on_entry, - tsp_cpu_off_entry, - tsp_cpu_resume_entry, - tsp_cpu_suspend_entry, - tsp_fiq_entry, -}; - - /******************************************************************************* * The BL32 memory footprint starts with an RO sections and ends * with a section for coherent RAM. Use it to find the memory size @@ -118,7 +102,7 @@ static tsp_args_t *set_smc_args(uint64_t arg0, /******************************************************************************* * TSP main entry point where it gets the opportunity to initialize its secure * state/applications. Once the state is initialized, it must return to the - * SPD with a pointer to the 'tsp_entry_info' structure. + * SPD with a pointer to the 'tsp_vector_table' jump table. ******************************************************************************/ uint64_t tsp_main(void) { @@ -147,12 +131,7 @@ uint64_t tsp_main(void) tsp_stats[linear_id].cpu_on_count); spin_unlock(&console_lock); - /* - * TODO: There is a massive assumption that the SPD and SP can see each - * other's memory without issues so it is safe to pass pointers to - * internal memory. Replace this with a shared communication buffer. - */ - return (uint64_t) &tsp_entry_info; + return (uint64_t) &tsp_vector_table; } /******************************************************************************* -- cgit