Open adamliyi opened 2 years ago
This patch helps to show the full nmi_panic log:
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c
index e16b248699d5..e961464a881e 100644
--- a/arch/arm64/kernel/machine_kexec.c
+++ b/arch/arm64/kernel/machine_kexec.c
@@ -6,6 +6,7 @@
* Copyright (C) Huawei Futurewei Technologies.
*/
+#include <linux/console.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
@@ -188,6 +189,8 @@ void machine_kexec(struct kimage *kimage)
"Some CPUs may be stale, kdump will be unreliable.\n");
pr_info("Bye!\n");
+ if (in_nmi())
+ console_flush_on_panic(CONSOLE_FLUSH_PENDING);
local_daif_mask();
A workaround patch added to linux-5.4.y tree: https://github.com/AmpereComputing/ampere-lts-kernel/commit/e26e6ac22363fcb24f31bb72dad4aaba4a76e8c7 "ACPI: AGDI: Complete sdei handler with SDEI_EVENT_COMPLETE_AND_RESUME before nmi_panic". This patch fixed SMMU hang issue when kdump.
According to bellow upstream community discussion, this requires ATF fix.
Details, refer to: [1] TF-A community discussion: https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/NB7PH7C32LQ5PRCCMISZ7EOVI3XFBI3X/#GPGW66B5MKUZFCAS2EJLBBZIZNSCMAA4
[2] Kernel discussion: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20211012142910.9688-1-zhangliguang@linux.alibaba.com/
Tested on latest linus_master (5.8-rc1):
On Altra, configure crashkernel by adding kernel option:
sysrq can trigger kdump, vmcore file can be generated:
AGDI can trigger kernel panic, but kdump cannot work:
Note, here is error when rebooting (these error can be ignored)
Since the AGDI nmi_panic() is invoked from SDEI context, some drivers in crashkernel (secondary kernel) cannot be initialized correctly. We can add these drivers in blacklist, as bellow:
Secondary kernel hangs at arm_smmu_driver_init