test(ff-a): test secondary core boot

Secure partitions register their secondary entrypoint at
initialization.
Added test to validate secondary core bring up:
- The primary VM in the ffa_secure_partitions test setup, starts the
secondary cores.
- Each secondary EC  is resumed from the first partition, the respective
pinned core's stack is setup, the mmu and caches are enabled, and
execution gets to the message loop (function `test_main_sp`).
- In the primary VM's execution context, it issues a echo request at
every core, to validate they are up and running.

Change-Id: I3a7e9f5fd8eb54181ed0d1af2becaed4268fa0fb
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/test/hftest/secure_service.c b/test/hftest/secure_service.c
index 3a7e246..cff2f00 100644
--- a/test/hftest/secure_service.c
+++ b/test/hftest/secure_service.c
@@ -18,12 +18,15 @@
 #include "test/abort.h"
 #include "test/hftest.h"
 
-alignas(4096) uint8_t kstack[4096];
+alignas(4096) uint8_t kstack[MAX_CPUS][4096];
 
-void test_main_sp(void);
+void test_main_sp(bool);
 
 noreturn void kmain(void)
 {
+	extern void secondary_ep_entry(void);
+	struct ffa_value res;
+
 	/*
 	 * Initialize the stage-1 MMU and identity-map the entire address space.
 	 */
@@ -33,7 +36,11 @@
 		abort();
 	}
 
-	test_main_sp();
+	/* Register entry point for secondary vCPUs. */
+	res = ffa_secondary_ep_register((uintptr_t)secondary_ep_entry);
+	EXPECT_EQ(res.func, FFA_SUCCESS_32);
+
+	test_main_sp(true);
 
 	/* Do not expect to get to this point, so abort. */
 	abort();