[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ttui91jo.ffs@tglx>
Date: Wed, 05 Jul 2023 10:59:23 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Baokun Li <libaokun1@...wei.com>
Cc: arjan@...ux.intel.com, ashok.raj@...el.com,
ashok.raj@...ux.intel.com, ebiederm@...ssion.com,
linux-kernel@...r.kernel.org, mario.limonciello@....com,
thomas.lendacky@....com, tony.luck@...el.com,
tonyb@...ernetics.com, x86@...nel.org,
yangerkun <yangerkun@...wei.com>, Baoquan He <bhe@...hat.com>,
kexec@...ts.infradead.org
Subject: Re: [BUG REPORT] Triggering a panic in an x86 virtual machine does
not wait
On Mon, Jul 03 2023 at 11:44, Baokun Li wrote:
> When I manually trigger panic in a qume x86 VM with
>
> `echo c > /proc/sysrq-trigger`,
>
> I find that the VM will probably reboot directly, but the
> PANIC_TIMEOUT is 0.
> This prevents us from exporting the vmcore via panic, and even if we succeed
> in panic exporting the vmcore, the processes in the vmcore are mostly
> stop_this_cpu(). By dichotomizing we found the patch that introduced the
> behavior change
>
> 45e34c8af58f ("x86/smp: Put CPUs into INIT on shutdown if possible"),
Bah, I missed that this is used by crash too. So if this happens to be
invoked on an AP, i.e. not on CPU 0, then the INIT will reset the
machine. Fix below.
Thanks,
tglx
---
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ed2d51960a7d..e1aa2cd7734b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1348,6 +1348,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;
Powered by blists - more mailing lists