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/common/spm_helpers.h b/spm/common/spm_helpers.h
index 1d3ddc2..59cdaf1 100644
--- a/spm/common/spm_helpers.h
+++ b/spm/common/spm_helpers.h
@@ -23,4 +23,6 @@
int64_t spm_interrupt_enable(uint32_t int_id, bool enable, enum interrupt_pin pin);
int64_t spm_interrupt_deactivate(uint32_t vint_id);
+unsigned int spm_get_my_core_pos(void);
+
#endif /* SPMC_H */