mirror of https://github.com/crash-utility/crash
arm64: Fix segfault by "bt" command with offline cpus
Currently on arm64, NT_PRSTATUS notes in dumpfile are not mapped to online cpus and machine_specific->panic_task_regs correctly. As a result, the "bt" command can cause a segmentation fault. crash> bt -c 0 PID: 0 TASK: ffff8000117fa240 CPU: 0 COMMAND: "swapper/0" Segmentation fault (core dumped) To fix this, 1) make map_cpus_to_prstatus_kdump_cmprs() map the notes to dd->nt_prstatus_percpu also on arm64, and 2) move arm64_get_crash_notes() to machdep_init(POST_INIT) in order to apply the mapping to machine_specific->panic_task_regs. Resolves: https://github.com/crash-utility/crash/issues/105 Reported-by: xuchunmei000 <xuchunmei@linux.alibaba.com> Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com> Tested-by: David Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
e389667cf6
commit
dd35cf6fc5
2
arm64.c
2
arm64.c
|
@ -472,7 +472,7 @@ arm64_init(int when)
|
|||
arm64_stackframe_init();
|
||||
break;
|
||||
|
||||
case POST_VM:
|
||||
case POST_INIT:
|
||||
/*
|
||||
* crash_notes contains machine specific information about the
|
||||
* crash. In particular, it contains CPU registers at the time
|
||||
|
|
|
@ -111,8 +111,7 @@ map_cpus_to_prstatus_kdump_cmprs(void)
|
|||
if (pc->flags2 & QEMU_MEM_DUMP_COMPRESSED) /* notes exist for all cpus */
|
||||
goto resize_note_pointers;
|
||||
|
||||
if (!(online = get_cpus_online()) || (online == kt->cpus) ||
|
||||
machine_type("ARM64"))
|
||||
if (!(online = get_cpus_online()) || (online == kt->cpus))
|
||||
goto resize_note_pointers;
|
||||
|
||||
if (CRASHDEBUG(1))
|
||||
|
|
Loading…
Reference in New Issue