----- Original Message ----- > > Hi Prabhakar, > > > > On Mon, Dec 30, 2019 at 9:55 AM Prabhakar Kushwaha > > <prabhakar.pkin@xxxxxxxxx> wrote: > >> > >> Dear Bhupesh, > >> > >> On Tue, Dec 24, 2019 at 9:39 AM Prabhakar Kushwaha > >> <prabhakar.pkin@xxxxxxxxx> wrote: > >> > > >> > On Tue, Dec 24, 2019 at 1:09 AM Bhupesh Sharma <bhsharma@xxxxxxxxxx> > >> wrote: > >> > > > >> > > On Mon, Dec 23, 2019 at 7:49 PM Prabhakar Kushwaha > >> > > <prabhakar.pkin@xxxxxxxxx> wrote: > >> > > > > >> > > > On Mon, Dec 23, 2019 at 7:32 PM Dave Anderson > >> <anderson@xxxxxxxxxx> wrote: > >> > > > > > >> > > > > > >> > > > > > >> > > > > ----- Original Message ----- > >> > > > > > __exception_text_start and __exception_text_end is used to > >> group functions > >> > > > > > and place according to linker script in such a way to achieve > >> > > > > > kprobe blacklist. Linux commit b6e43c0e3129 ("arm64: remove > >> __exception > >> > > > > > annotations") has removed __exception_text_start and > >> > > > > > __exception_text_end and uses NOKPROBE_SYMBOL() for blacklist > >> kprobes. > >> > > > > > > >> > > > > > So removing references of __exception_text_start and > >> __exception_text_end > >> > > > > > for ARM64. > >> > > > > > >> > > > > NAK for a couple of reasons... > >> > > > > > >> > > > > First, they cannot be removed for backward-compatibility > >> purposes, and secondly > >> > > > > an alternative method is required for arm64_back_trace_cmd() for > >> handling > >> > > > > exception frames. > >> > > > > > >> > > > > >> > > > We are getting following error with crash tool with latest kernel. > >> > > > crash: cannot resolve "__exception_text_start" error > >> > > > > >> > > > it is because of Linux commit b6e43c0e3129 which removes > >> > > > __exception_text_start and __exception_text_end. > >> > > > We need to find alternate way of fixing it. > >> > > > >> > > I cannot seem to remember reproducing this issue with crash with > >> > > latest kernel on my arm64 boards. > >> > > Can you be more specific on the exact kernel version and the crash > >> > > command you used, just to be sure we are able to reproduce the same? > >> > > > >> > > >> > We are seeing this issue on Thuder X platform (arm64). > >> > > >> > Please find details of commit id. > >> > A) crash tool: https://github.com/crash-utility/crash.git > >> > commit: af7f78dc501b8acf7fee3f924f69e93513d0a74b (Fix for the "log > >> -a" option.) > >> > > >> > B) Linux: > >> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > >> > commit: 46cf053efec6a3a5f343fead837777efe8252a46 (Linux 5.5-rc3) > >> > > >> > C) Kexec: > >> https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git > >> > commit: bd077966e2b9041c24df5b689e67670f02be7b0d (kexec-tools: Fix > >> > conversion overflow when compiling on 32-bit platforms) > >> > > >> > > >> > Logs > >> > root@ubuntu$ ./crash /proc/vmcore /usr/src/tovards/linux/vmlinux > >> > > >> > crash 7.2.7++ > >> > Copyright (C) 2002-2019 Red Hat, Inc. > >> > Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation > >> > Copyright (C) 1999-2006 Hewlett-Packard Co > >> > Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited > >> > Copyright (C) 2006, 2007 VA Linux Systems Japan K.K. > >> > Copyright (C) 2005, 2011 NEC Corporation > >> > Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc. > >> > Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. > >> > This program is free software, covered by the GNU General Public > >> License, > >> > and you are welcome to change it and/or distribute copies of it under > >> > certain conditions. Enter "help copying" to see the conditions. > >> > This program has absolutely no warranty. Enter "help warranty" for > >> details. > >> > > >> > vmcoreinfo : vabits_actual: 48 > >> > GNU gdb (GDB) 7.6 > >> > Copyright (C) 2013 Free Software Foundation, Inc. > >> > License GPLv3+: GNU GPL version 3 or later > >> <http://gnu.org/licenses/gpl.html> > >> > This is free software: you are free to change and redistribute it. > >> > There is NO WARRANTY, to the extent permitted by law. Type "show > >> copying" > >> > and "show warranty" for details. > >> > This GDB was configured as "aarch64-unknown-linux-gnu". > >> > For bug reporting instructions, please see: > >> > <http://www.gnu.org/software/gdb/bugs/>... > >> > > >> > crash: cannot resolve "__exception_text_start" > >> > > >> > >> i hope you got sometime to reproduce this issue. > >> It can also be seen on Linux 5.5-rc4 tag > >> (fd6988496e79a6a4bdb514a4655d2920209eb85d). > >> > >> crash-util commit 5e975dd8c817ea6aea35e1e15b83c378aee9c136 (HEAD -> > >> master, origin/master, origin/HEAD) > > > > I was able to reproduce the issue with latest Linus's tree. I am > > working on a patch (as per Dave's suggestion) to fix backward > > compatibility as well as 'arm64_back_trace_cmd()' (bt command support) > > and will post it out soon (I am hoping to post out a version after the > > new year break). > > > > Thanks and a Happy New Year, > > Bhupesh > > > > Thanks Bhupesh, I'm also out until next week. > > And yeah, for 5.5 and later kernels it looks like > arm64_in_exception_text() will have to check the incoming > address's symbol name against the set of exception handler > symbol names. The older kernels can still utilize the handy > text range between __exception_text_start/__exception_text_end. > > Kind of a pain, but I don't know what the alternative would be. > > Dave Hi Bhupesh, Here's what I'm thinking... (attached patch) Thanks, Dave
diff --git a/arm64.c b/arm64.c index 6c2c58f..93e55d3 100644 --- a/arm64.c +++ b/arm64.c @@ -1644,10 +1644,11 @@ arm64_stackframe_init(void) machdep->machspec->kern_eframe_offset = SIZE(pt_regs); } - machdep->machspec->__exception_text_start = - symbol_value("__exception_text_start"); - machdep->machspec->__exception_text_end = - symbol_value("__exception_text_end"); + if ((sp1 = kernel_symbol_search("__exception_text_start")) && + (sp2 = kernel_symbol_search("__exception_text_end"))) { + machdep->machspec->__exception_text_start = sp1->value; + machdep->machspec->__exception_text_end = sp2->value; + } if ((sp1 = kernel_symbol_search("__irqentry_text_start")) && (sp2 = kernel_symbol_search("__irqentry_text_end"))) { machdep->machspec->__irqentry_text_start = sp1->value; @@ -1856,20 +1857,38 @@ arm64_eframe_search(struct bt_info *bt) return count; } +static char *arm64_exception_functions[] = { + "do_undefinstr", + "do_sysinstr", + "do_debug_exception", + "do_mem_abort", + "do_el0_irq_bp_hardening", + "do_sp_pc_abort", + NULL +}; + static int arm64_in_exception_text(ulong ptr) { struct machine_specific *ms = machdep->machspec; - - if ((ptr >= ms->__exception_text_start) && - (ptr < ms->__exception_text_end)) - return TRUE; + char *name, **func; if (ms->__irqentry_text_start && ms->__irqentry_text_end && ((ptr >= ms->__irqentry_text_start) && (ptr < ms->__irqentry_text_end))) return TRUE; + if (ms->__exception_text_start && ms->__exception_text_end) { + if ((ptr >= ms->__exception_text_start) && + (ptr < ms->__exception_text_end)) + return TRUE; + } else if ((name = closest_symbol(ptr))) { /* Linux 5.5 and later */ + for (func = &arm64_exception_functions[0]; *func; func++) { + if (STREQ(name, *func)) + return TRUE; + } + } + return FALSE; }
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility