@@ -68,24 +68,9 @@ int machine_kexec_prepare(struct kimage *kimage)
kexec_image_info(kimage);
- if (kimage->type != KEXEC_TYPE_CRASH) {
- if (cpus_are_stuck_in_kernel()) {
- pr_err("Can't kexec: failed CPUs are stuck in the kernel.\n");
- return -EBUSY;
- }
-
- if (num_online_cpus() > 1) {
- if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
- /* any_cpu as we don't mind being preempted */
- int any_cpu = raw_smp_processor_id();
-
- if (cpu_ops[any_cpu]->cpu_die)
- return 0;
- }
-
- pr_err("Can't kexec: no mechanism to offline secondary CPUs.\n");
- return -EBUSY;
- }
+ if (kimage->type != KEXEC_TYPE_CRASH && cpus_are_stuck_in_kernel()) {
+ pr_err("Can't kexec: CPUs are stuck in the kernel.\n");
+ return -EBUSY;
}
return 0;
@@ -163,7 +148,7 @@ void machine_kexec(struct kimage *kimage)
/*
* New cpus may have become stuck_in_kernel after we loaded the image.
*/
- BUG_ON(cpus_are_stuck_in_kernel() && (num_online_cpus() > 1));
+ BUG_ON(cpus_are_stuck_in_kernel() || (num_online_cpus() > 1));
reboot_code_buffer_phys = page_to_phys(kimage->control_code_page);
reboot_code_buffer = phys_to_virt(reboot_code_buffer_phys);