
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5G5N -------------------------------- The reboot process needs to acquire the lock for log printing, but the CPU holding the lock cannot release it while in NMI context, preventing the system from completing the reboot process normally. The primary function of nmi_shootdown_cpus() is to send NMI to all other CPUs. By adding zap_locks(), it reinitializes logbuf_lock and console_owner_lock, clears the owner and waiters of console_owner_lock, and reinitializes console_sem. This ensures that even if logbuf_lock is held, other CPUs calling printk in NMI context won't deadlock due to inability to acquire the lock. Fixes: c4ac4263a019 ("crashdump: x86: add NMI handler to capture other CPUs") Signed-off-by: Xiaomeng Zhang <zhangxiaomeng13@huawei.com> --- arch/x86/kernel/reboot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 970296f4403b..c5470431a1b6 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -924,6 +924,7 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback) mdelay(1); msecs--; } + zap_locks(); /* * Leave the nmi callback set, shootdown is a one-time thing. Clearing -- 2.34.1