All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG REPORT] x86/apic: CPU Hang in x86 VM During Kdump
@ 2025-06-04  8:33 Yipeng Zou
  2025-07-26  9:50 ` Yipeng Zou
  2025-07-27 20:01 ` Thomas Gleixner
  0 siblings, 2 replies; 8+ messages in thread
From: Yipeng Zou @ 2025-06-04  8:33 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, x86, hpa, peterz, sohil.mehta,
	rui.zhang, arnd, yuntao.wang, linux-kernel
  Cc: zouyipeng

Recently, A issue has been reported that CPU hang in x86 VM.

The CPU halted during Kdump likely due to IPI issues when one CPU was
rebooting and another was in Kdump:

CPU0			  CPU2
========================  ======================
reboot			  Panic
machine shutdown	  Kdump
			  machine shutdown
stop other cpus
			  stop other cpus
...			  ...
local_irq_disable	  local_irq_disable
send_IPIs(REBOOT)	  [critical regions]
[critical regions]	  1) send_IPIs(REBOOT)
			  wait timeout
			  2) send_IPIs(NMI);
Halt,NMI context
			  3) lapic_shutdown [IPI is pending]
			  ...
			  second kernel start
			  4) init_bsp_APIC [IPI is pending]
			  ...
			  local irq enable
			  Halt, IPI context

In simple terms, when the Kdump jump to the second kernel, the IPI that
was pending in the first kernel remains and is responded to by the
second kernel.

I was thinking maybe we need mask IPI in clear_local_APIC() to solve this
problem. In that way, it will clear the pending IPI in both 3) and 4).

I can't seem to find a solution in the SDM manual. I want to ask if this
approach is feasible, or if there are other ways to fix the issue.

Signed-off-by: Yipeng Zou <zouyipeng@huawei.com>
---
 arch/x86/kernel/apic/apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index d73ba5a7b623..68c41d579303 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1117,6 +1117,8 @@ void clear_local_APIC(void)
 	}
 #endif
 
+	// Mask IPI here
+
 	/*
 	 * Clean APIC state for other OSs:
 	 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-08-11 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-04  8:33 [BUG REPORT] x86/apic: CPU Hang in x86 VM During Kdump Yipeng Zou
2025-07-26  9:50 ` Yipeng Zou
2025-07-27 12:39   ` Thomas Gleixner
2025-07-27 20:01 ` Thomas Gleixner
2025-07-29  8:53   ` Thomas Gleixner
2025-07-29 13:35     ` Yipeng Zou
2025-07-29 19:48       ` Thomas Gleixner
2025-08-11 12:51         ` Yipeng Zou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.