fix: replace platform get core pos usage

It is incorrect for secure partitions to use the platform_get_core_pos
macro. MPIDR_EL1 read from S-EL1 is the impdef virtual MPIDR value set
by the SPMC on behalf of SP. The MPIDR value does not hold physical CPU
affinity values, but the linear vCPU index for the currently running
vCPU. Add an SPM helper to retrieve the vCPU index information and
update call sites to use this helper.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ic9927acc5b64d25331cb61a83d9acbdc83173e2b
diff --git a/spm/cactus/cactus_tests/cactus_test_simd.c b/spm/cactus/cactus_tests/cactus_test_simd.c
index a1366d3..bcf1c38 100644
--- a/spm/cactus/cactus_tests/cactus_test_simd.c
+++ b/spm/cactus/cactus_tests/cactus_test_simd.c
@@ -7,6 +7,7 @@
 #include "cactus_message_loop.h"
 #include "cactus_test_cmds.h"
 #include <fpu.h>
+#include <spm_helpers.h>
 #include "spm_common.h"
 
 /*
@@ -21,7 +22,8 @@
  */
 CACTUS_CMD_HANDLER(req_simd_fill, CACTUS_REQ_SIMD_FILL_CMD)
 {
-	core_pos = platform_get_core_pos(read_mpidr_el1());
+	/* Get vCPU index for currently running vCPU. */
+	core_pos = spm_get_my_core_pos();
 	fpu_state_write_rand(&sp_fpu_state_write);
 	return cactus_response(ffa_dir_msg_dest(*args),
 			       ffa_dir_msg_source(*args),
@@ -36,7 +38,8 @@
 {
 	bool test_succeed = false;
 
-	unsigned int core_pos1 = platform_get_core_pos(read_mpidr_el1());
+	/* Get vCPU index for currently running vCPU. */
+	unsigned int core_pos1 = spm_get_my_core_pos();
 	if (core_pos1 == core_pos) {
 		fpu_state_read(&sp_fpu_state_read);
 		if (fpu_state_compare(&sp_fpu_state_write,