feat(cpufeat): do feature detection on secondary cores too

Feature detection currently only happens on the boot core, however, it
is possible to have asymmetry between cores. TF-A supports limited such
configurations so it should check secondary cores too.

Change-Id: Iee4955714685be9ae6a017af4a6c284e835ff299
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 4d641d3..9d300b4 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -120,8 +120,10 @@
  ******************************************************************************/
 void bl31_main(void)
 {
+	unsigned int core_pos = plat_my_core_pos();
+
 	/* Init registers that never change for the lifetime of TF-A */
-	cm_manage_extensions_el3(plat_my_core_pos());
+	cm_manage_extensions_el3(core_pos);
 
 	/* Init per-world context registers */
 	cm_manage_extensions_per_world();
@@ -131,7 +133,7 @@
 
 #if FEATURE_DETECTION
 	/* Detect if features enabled during compilation are supported by PE. */
-	detect_arch_features();
+	detect_arch_features(core_pos);
 #endif /* FEATURE_DETECTION */
 
 #if ENABLE_RUNTIME_INSTRUMENTATION
@@ -156,8 +158,6 @@
 	 * Initialize the GIC driver as well as per-cpu and global interfaces.
 	 * Platform has had an opportunity to initialise specifics.
 	 */
-	unsigned int core_pos = plat_my_core_pos();
-
 	gic_init(core_pos);
 	gic_pcpu_init(core_pos);
 	gic_cpuif_enable(core_pos);