Messages in this thread | | | Date | Tue, 22 Jun 2021 10:14:38 +0000 | From | Huang Shijie <> | Subject | Re: [PATCH] arm64: kexec: flush log to console in nmi_panic() |
| |
Hi Will, On Mon, Jun 21, 2021 at 11:08:37AM +0100, Will Deacon wrote: > > > That sounds like something which should be done in the core code, rather > > > than the in the architecture backend (and looks like panic() might do this > > > already?) > > In the non-kdump code path, the core code will take care of it, please read the > > code in panic(). > > > > But in the kdump code path, the architecture code should take care of it. > > Why the discrepancy? Wouldn't it make more sense to do this in panic() for > both cases, if the prints that we want to display are coming from panic() > itself?
In the kdump code path, code call like this: panic() -->__crash_kexec() --> machine_kexec();
When we reach arm64's machine_kexec(), it means we can __NOT__ return to the panic(), we will run to the kdump linux kernel by cpu_soft_restart().
So we can not depend the panic() to print the log. :)
By the way, I quote part of the arm64 log after we enter __crash_kexec() in NMI context: 1.) the log in machine_crash_shutdown() .............. pr_crit("SMP: stopping secondary CPUs\n"); .............. pr_info("Starting crashdump kernel...\n"); ..............
2.) the log in machine_kexec()
.............. WARN(in_kexec_crash && (stuck_cpus || smp_crash_stop_failed()), "Some CPUs may be stale, kdump will be unreliable.\n"); .............. the logs in kexec_segment_flush(kimage); .............. pr_info("Bye!\n");
We cannot remove them all, and need to flush all the logs above to console in the NMI context.
Thanks Huang Shijie
| |