[GIT,pull] x86/core for v6.5-rc1

Message ID 168890380261.187070.2103277819790991312.tglx@xen13
State New
Headers
Series [GIT,pull] x86/core for v6.5-rc1 |

Commit Message

Thomas Gleixner July 9, 2023, 11:57 a.m. UTC
  Linus,

please pull the latest x86/core branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-core-2023-07-09

up to:  b1472a60a584: x86/smp: Don't send INIT to boot CPU


A single fix for the mechanism to park CPUs with an INIT IPI.

On shutdown or kexec, the kernel tries to park the non-boot CPUs with an
INIT IPI. But the same code path is also used by the crash utility. If the
CPU which panics is not the boot CPU then it sends an INIT IPI to the boot
CPU which resets the machine. Prevent this by validating that the CPU which
runs the stop mechanism is the boot CPU. If not, leave the other CPUs in
HLT.


Thanks,

	tglx

------------------>
Thomas Gleixner (1):
      x86/smp: Don't send INIT to boot CPU


 arch/x86/kernel/smpboot.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

pr-tracker-bot@kernel.org July 9, 2023, 5:46 p.m. UTC | #1
The pull request you sent on Sun,  9 Jul 2023 13:57:03 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-core-2023-07-09

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/e3da8db05531829cf64f922491be6f052acc5fba

Thank you!
  

Patch

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 4ee43396b910..7417d9b55b21 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1473,6 +1473,14 @@  bool smp_park_other_cpus_in_init(void)
 	if (apic->wakeup_secondary_cpu_64 || apic->wakeup_secondary_cpu)
 		return false;
 
+	/*
+	 * If this is a crash stop which does not execute on the boot CPU,
+	 * then this cannot use the INIT mechanism because INIT to the boot
+	 * CPU will reset the machine.
+	 */
+	if (this_cpu)
+		return false;
+
 	for_each_present_cpu(cpu) {
 		if (cpu == this_cpu)
 			continue;