diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5c7ae4c3954be9..1c797ec6eee600 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1078,8 +1078,13 @@ config PARAVIRT_TIME_ACCOUNTING If in doubt, say N here. +config KEXEC_HACK + bool "kexec hack" + help + Do some ad-hoc patching to SMP-related code so that kexec works. + config KEXEC - depends on PM_SLEEP_SMP + depends on (PM_SLEEP_SMP || KEXEC_HACK) select KEXEC_CORE bool "kexec system call" help diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 6f6ff072acbde7..863d46437aa915 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -1126,7 +1126,10 @@ static bool have_cpu_die(void) bool cpus_are_stuck_in_kernel(void) { +#ifndef CONFIG_KEXEC_HACK bool smp_spin_tables = (num_possible_cpus() > 1 && !have_cpu_die()); - return !!cpus_stuck_in_kernel || smp_spin_tables; +#else + return false; +#endif } diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index 7e1624ecab3c80..61c978b10789ab 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c @@ -49,6 +49,10 @@ static int smp_spin_table_cpu_init(unsigned int cpu) if (!dn) return -ENODEV; +#ifdef CONFIG_KEXEC_HACK + return -ENOSYS; +#endif + /* * Determine the address from which the CPU is polling. */