Skip to contentSkip to conversation

ia64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus()

PATCH New Pingfan Liu 1 participant 3 messages Jan 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ia64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus()

kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on either reboot_cpu or the first online cpu.

So machine_shutdown() should pass smp_processor_id() as the primary cpu to smp_shutdown_nonboot_cpus().

Cc Geert Uytterhoeven <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Kees Cook <[email protected]>
Cc Jens Axboe <[email protected]>

To: [email protected]

---
 arch/ia64/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/kernel/process.c +1 -1
index 834df24a88f1..88ca3f587783 100644
@@ -575,7 +575,7 @@ cpu_halt (void)
 
 void machine_shutdown(void)
 {
-	smp_shutdown_nonboot_cpus(reboot_cpu);
+	smp_shutdown_nonboot_cpus(smp_processor_id());
 
 #ifdef CONFIG_KEXEC
 	kexec_disable_iosapic();
Signature · 1 line
2.31.1
#1 lore raw

PATCH 2/3 arm: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus()

kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on either reboot_cpu or the first online cpu.

So machine_shutdown() should pass smp_processor_id() as the primary cpu to smp_shutdown_nonboot_cpus().

Cc Russell King <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Lee Jones <[email protected]>

To: [email protected]

---
 arch/arm/kernel/reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/reboot.c +1 -1
index 3044fcb8d073..898405682e08 100644
@@ -91,7 +91,7 @@ void soft_restart(unsigned long addr)
  */
 void machine_shutdown(void)
 {
-	smp_shutdown_nonboot_cpus(reboot_cpu);
+	smp_shutdown_nonboot_cpus(smp_processor_id());
 }
 
 /*
Signature · 7 lines
2.31.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH 3/3 arm64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus()

In reply to Pingfan Liu

kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on either reboot_cpu or the first online cpu.

So machine_shutdown() should pass smp_processor_id() as the primary cpu to smp_shutdown_nonboot_cpus().

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Peter Collingbourne <[email protected]>
Cc Marc Zyngier <[email protected]>

To: [email protected]

---
 arch/arm64/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/process.c +1 -1
index aacf2f5559a8..e1d2179ca845 100644
@@ -85,7 +85,7 @@ void arch_cpu_idle_dead(void)
  */
 void machine_shutdown(void)
 {
-	smp_shutdown_nonboot_cpus(reboot_cpu);
+	smp_shutdown_nonboot_cpus(smp_processor_id());
 }
 
 /*
Signature · 7 lines
2.31.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel