aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel/cpufeature.c')
-rw-r--r--arch/arm64/kernel/cpufeature.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index cdf1dca64133..53fab76d3c39 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -895,28 +895,6 @@ static u64 __raw_read_system_reg(u32 sys_id)
895} 895}
896 896
897/* 897/*
898 * Park the CPU which doesn't have the capability as advertised
899 * by the system.
900 */
901static void fail_incapable_cpu(char *cap_type,
902 const struct arm64_cpu_capabilities *cap)
903{
904 int cpu = smp_processor_id();
905
906 pr_crit("CPU%d: missing %s : %s\n", cpu, cap_type, cap->desc);
907 /* Mark this CPU absent */
908 set_cpu_present(cpu, 0);
909
910 /* Check if we can park ourselves */
911 if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die)
912 cpu_ops[cpu]->cpu_die(cpu);
913 asm(
914 "1: wfe\n"
915 " wfi\n"
916 " b 1b");
917}
918
919/*
920 * Run through the enabled system capabilities and enable() it on this CPU. 898 * Run through the enabled system capabilities and enable() it on this CPU.
921 * The capabilities were decided based on the available CPUs at the boot time. 899 * The capabilities were decided based on the available CPUs at the boot time.
922 * Any new CPU should match the system wide status of the capability. If the 900 * Any new CPU should match the system wide status of the capability. If the
@@ -944,8 +922,11 @@ void verify_local_cpu_capabilities(void)
944 * If the new CPU misses an advertised feature, we cannot proceed 922 * If the new CPU misses an advertised feature, we cannot proceed
945 * further, park the cpu. 923 * further, park the cpu.
946 */ 924 */
947 if (!feature_matches(__raw_read_system_reg(caps[i].sys_reg), &caps[i])) 925 if (!feature_matches(__raw_read_system_reg(caps[i].sys_reg), &caps[i])) {
948 fail_incapable_cpu("arm64_features", &caps[i]); 926 pr_crit("CPU%d: missing feature: %s\n",
927 smp_processor_id(), caps[i].desc);
928 cpu_die_early();
929 }
949 if (caps[i].enable) 930 if (caps[i].enable)
950 caps[i].enable(NULL); 931 caps[i].enable(NULL);
951 } 932 }
@@ -953,8 +934,11 @@ void verify_local_cpu_capabilities(void)
953 for (i = 0, caps = arm64_hwcaps; caps[i].matches; i++) { 934 for (i = 0, caps = arm64_hwcaps; caps[i].matches; i++) {
954 if (!cpus_have_hwcap(&caps[i])) 935 if (!cpus_have_hwcap(&caps[i]))
955 continue; 936 continue;
956 if (!feature_matches(__raw_read_system_reg(caps[i].sys_reg), &caps[i])) 937 if (!feature_matches(__raw_read_system_reg(caps[i].sys_reg), &caps[i])) {
957 fail_incapable_cpu("arm64_hwcaps", &caps[i]); 938 pr_crit("CPU%d: missing HWCAP: %s\n",
939 smp_processor_id(), caps[i].desc);
940 cpu_die_early();
941 }
958 } 942 }
959} 943}
960 944