@@ -177,13 +177,7 @@ void __init enable_errata_workarounds(void);
void verify_local_cpu_errata(void);
-#ifdef CONFIG_HOTPLUG_CPU
-void verify_local_cpu_capabilities(void);
-#else
-static inline void verify_local_cpu_capabilities(void)
-{
-}
-#endif
+void check_local_cpu_capabilities(void);
u64 read_system_reg(u32 id);
@@ -860,18 +860,11 @@ static inline void set_sys_caps_initialised(void)
* cannot do anything to fix it up and could cause unexpected failures. So
* we park the CPU.
*/
-void verify_local_cpu_capabilities(void)
+static void verify_local_cpu_capabilities(void)
{
int i;
const struct arm64_cpu_capabilities *caps;
- /*
- * If we haven't computed the system capabilities, there is nothing
- * to verify.
- */
- if (!sys_caps_initialised)
- return;
-
verify_local_cpu_errata();
caps = arm64_features;
@@ -902,6 +895,20 @@ void verify_local_cpu_capabilities(void)
}
}
+void check_local_cpu_capabilities(void)
+{
+ /*
+ * If we haven't finalised the system capabilities, this CPU gets
+ * a chance to update the errata work arounds.
+ * Otherwise, this CPU should verify that it has all the system
+ * advertised capabilities.
+ */
+ if (!sys_caps_initialised)
+ check_local_cpu_errata();
+ else
+ verify_local_cpu_capabilities();
+}
+
#else /* !CONFIG_HOTPLUG_CPU */
static inline void set_sys_caps_initialised(void)
@@ -239,8 +239,6 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
info->reg_mvfr2 = read_cpuid(MVFR2_EL1);
cpuinfo_detect_icache_policy(info);
-
- check_local_cpu_errata();
}
void cpuinfo_store_cpu(void)
@@ -161,7 +161,7 @@ asmlinkage notrace void secondary_start_kernel(void)
* this CPU ticks all of those. If it doesn't, the CPU will
* fail to come online.
*/
- verify_local_cpu_capabilities();
+ check_local_cpu_capabilities();
if (cpu_ops[cpu]->cpu_postboot)
cpu_ops[cpu]->cpu_postboot();
@@ -360,6 +360,12 @@ void __init smp_prepare_boot_cpu(void)
{
set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
cpuinfo_store_boot_cpu();
+ /*
+ * Run the errata work around checks on the boot CPU, once we have
+ * initialised the cpu feature infrastructure from
+ * cpuinfo_store_boot_cpu() above.
+ */
+ check_local_cpu_errata();
}
static u64 __init of_get_cpu_mpidr(struct device_node *dn)