From 58225d51069909dca2bc9865333092e0aaa48f7d Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Thu, 5 Jan 2017 09:23:33 -0500 Subject: [PATCH] Fix for the ARM64 "bt" command in Linux 4.10 and later kernels that are configured with CONFIG_THREAD_INFO_IN_TASK. Without the patch, the "bt" command will fail for active tasks in dumpfiles that were generated by the kdump facility. (takahiro.akashi@linaro.org) --- arm64.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arm64.c b/arm64.c index 1a95c5b..6eaf96d 100644 --- a/arm64.c +++ b/arm64.c @@ -2447,7 +2447,7 @@ arm64_in_kdump_text(struct bt_info *bt, struct arm64_stackframe *frame) (*ptr < ms->crash_kexec_end) && INSTACK(*(ptr - 1), bt)) { bt->bptr = ((ulong)(ptr - 1) - (ulong)base) - + bt->tc->thread_info; + + task_to_stackbase(bt->tc->task); if (CRASHDEBUG(1)) fprintf(fp, "%lx: %lx (crash_kexec)\n", bt->bptr, *ptr); return TRUE; @@ -2456,20 +2456,22 @@ arm64_in_kdump_text(struct bt_info *bt, struct arm64_stackframe *frame) (*ptr < ms->crash_save_cpu_end) && INSTACK(*(ptr - 1), bt)) { bt->bptr = ((ulong)(ptr - 1) - (ulong)base) - + bt->tc->thread_info; + + task_to_stackbase(bt->tc->task); if (CRASHDEBUG(1)) fprintf(fp, "%lx: %lx (crash_save_cpu)\n", bt->bptr, *ptr); return TRUE; } } else { if ((*ptr >= ms->crash_kexec_start) && (*ptr < ms->crash_kexec_end)) { - bt->bptr = ((ulong)ptr - (ulong)base) + bt->tc->thread_info; + bt->bptr = ((ulong)ptr - (ulong)base) + + task_to_stackbase(bt->tc->task); if (CRASHDEBUG(1)) fprintf(fp, "%lx: %lx (crash_kexec)\n", bt->bptr, *ptr); return TRUE; } if ((*ptr >= ms->crash_save_cpu_start) && (*ptr < ms->crash_save_cpu_end)) { - bt->bptr = ((ulong)ptr - (ulong)base) + bt->tc->thread_info; + bt->bptr = ((ulong)ptr - (ulong)base) + + task_to_stackbase(bt->tc->task); if (CRASHDEBUG(1)) fprintf(fp, "%lx: %lx (crash_save_cpu)\n", bt->bptr, *ptr); return TRUE;