<div dir="ltr"><div dir="ltr">On Wed, Jun 29, 2022 at 2:40 PM qianli zhao <<a href="mailto:zhaoqianligood@gmail.com">zhaoqianligood@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,Lianbo<br>
Thank you for your feedback.<br>
<br>
My kernel version is 5.10.59, and this issue is happened when the</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
ramdumps without vmcoreinfo.<br></blockquote><div><br></div><div>Thank you for the explanation.</div><div><br></div><div>It is important to point this(*without vmcoreinfo*) out in the patch log. That can help understand this issue. Can you add it to the patch log?</div><div><br></div><div>In addition, I just got a dump file generated by the "virsh dump" command, the dumpfile doesn't have the vmcoreinfo, and get the same errors </div><div>with or without this patch, can you also double check? Maybe it is a similar issue.</div><div><br></div><div>[root@hpe-apollo-cn99xx-18 home]# /home/crash/crash vmlinux dump.core --machdep vabits_actual=48<br><br>crash 8.0.1++<br>Copyright (C) 2002-2022  Red Hat, Inc.<br>Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation<br>Copyright (C) 1999-2006  Hewlett-Packard Co<br>Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited<br>Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.<br>Copyright (C) 2005, 2011, 2020-2022  NEC Corporation<br>Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.<br>Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.<br>Copyright (C) 2015, 2021  VMware, Inc.<br>This program is free software, covered by the GNU General Public License,<br>and you are welcome to change it and/or distribute copies of it under<br>certain conditions.  Enter "help copying" to see the conditions.<br>This program has absolutely no warranty.  Enter "help warranty" for details.<br> <br>NOTE: setting vabits_actual to: 48<br><br>WARNING: kimage_voffset cannot be determined from the dumpfile.<br>       Try using the command line option: --machdep kimage_voffset=<addr><br>GNU gdb (GDB) 10.2<br>Copyright (C) 2021 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.<br>Type "show copying" and "show warranty" for details.<br>This GDB was configured as "aarch64-unknown-linux-gnu".<br>Type "show configuration" for configuration details.<br>Find the GDB manual and other documentation resources online at:<br>    <<a href="http://www.gnu.org/software/gdb/documentation/">http://www.gnu.org/software/gdb/documentation/</a>>.<br><br>For help, type "help".<br>Type "apropos word" to search for commands related to "word"...<br><br>crash: read error: kernel virtual address: ffff8000119cee00  type: "possible"<br>WARNING: cannot read cpu_possible_map<br>crash: read error: kernel virtual address: ffff8000119cf208  type: "present"<br>WARNING: cannot read cpu_present_map<br>crash: read error: kernel virtual address: ffff8000119cec00  type: "online"<br>WARNING: cannot read cpu_online_map<br>crash: read error: kernel virtual address: ffff8000119cf408  type: "active"<br>WARNING: cannot read cpu_active_map<br>crash: read error: kernel virtual address: ffff8000120c97a8  type: "shadow_timekeeper xtime_sec"<br>crash: read error: kernel virtual address: ffff8000119e1668  type: "init_uts_ns"<br>crash: vmlinux and dump.core do not match!<br><br>Usage:<br><br>  crash [OPTION]... NAMELIST MEMORY-IMAGE[@ADDRESS]        (dumpfile form)<br>  crash [OPTION]... [NAMELIST]                          (live system form)<br><br>Enter "crash -h" for details.<br></div><div><br></div><div>Thanks.</div><div>Lianbo</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I guess your scene may have vmcore,the following logic helps to<br>
correctly locate MODULES/VMALLOC ranges with right kernel version.<br>
<br>
 279                         ms->kimage_end = (sp ? sp->value : 0);<br>
 280<br>
 281                         if (ms->struct_page_size && (r =<br>
arm64_get_va_range(ms))) {------------->//If there is a vmcore, it<br>
will go to the following codes<br>
 282                                 /* We can get all the<br>
MODULES/VMALLOC/VMEMMAP ranges now.*/<br>
 283                                 ms->modules_vaddr       = r->modules_vaddr;<br>
 284                                 ms->modules_end         =<br>
r->modules_end - 1;<br>
 285                                 ms->vmalloc_start_addr  =<br>
r->vmalloc_start_addr;<br>
 286                                 ms->vmalloc_end         =<br>
r->vmalloc_end - 1;<br>
 287                                 ms->vmemmap_vaddr       = r->vmemmap_vaddr;<br>
 288                                 ms->vmemmap_end         =<br>
r->vmemmap_end - 1;<br>
 289                         } else if (ms->VA_BITS_ACTUAL)<br>
{------------>//unable to locate the version and other information<br>
through vmcore<br>
}<br>
<br>
lijiang <<a href="mailto:lijiang@redhat.com" target="_blank">lijiang@redhat.com</a>> 于2022年6月29日周三 14:21写道:<br>
><br>
> Hi, Qianli<br>
> On Tue, Jun 28, 2022 at 9:55 AM lijiang <<a href="mailto:lijiang@redhat.com" target="_blank">lijiang@redhat.com</a>> wrote:<br>
>><br>
>> Hi, Kazu and Qianli<br>
>><br>
>> On Tue, Jun 28, 2022 at 9:17 AM HAGIO KAZUHITO(萩尾 一仁) <<a href="mailto:k-hagio-ab@nec.com" target="_blank">k-hagio-ab@nec.com</a>> wrote:<br>
>>><br>
>>> Hi Qianli,<br>
>>><br>
>>> thanks for the patch and explanation.  I was off.<br>
>>><br>
>>> On 2022/06/27 11:24, qianli zhao wrote:<br>
>>> > Hi,Kazu<br>
>>> ><br>
>>> > Would you like to help review this patch?<br>
>>><br>
>>> Sure, I think I can review it this week.<br>
>>><br>
>>> Lianbo, can you possibly reproduce and test this?<br>
>><br>
>><br>
>> OK, I will have a look and give feedback later.<br>
><br>
><br>
> Could you please point out the kernel version? I tried it with the latest kernel and did not reproduce this issue when disabling the kaslr feature(# CONFIG_RANDOMIZE_BASE is not set  or nokaslr)<br>
><br>
> crash > help -m<br>
> ..<br>
>     vmalloc_start_addr: ffff800008000000<br>
>            vmalloc_end: fffffbffefffffff<br>
>          modules_vaddr: ffff800000000000<br>
>            modules_end: ffff800007ffffff<br>
>          vmemmap_vaddr: fffffc0000000000<br>
>            vmemmap_end: fffffdffffffffff<br>
> ...<br>
><br>
> And the following information is dumped from the kernel(commit: 941e3e791269)<br>
> ...<br>
> [    0.000000] Virtual kernel memory layout:<br>
> [    0.000000]     modules : 0xffff800000000000 - 0xffff800008000000   (   128 MB)<br>
> [    0.000000]     vmalloc : 0xffff800008000000 - 0xfffffbfff0000000   (126975 GB)<br>
> ...<br>
> [    0.000000]     vmemmap : 0xfffffc0000000000 - 0xfffffe0000000000   (  2048 GB maximum)<br>
> [    0.000000]               0xfffffc000000bc00 - 0xfffffc023df40000   (  9183 MB actual)<br>
><br>
> I'm wondering if that can be only reproduced on the old kernel, right? Or did I miss anything else?<br>
><br>
> Thanks.<br>
> Lianbo<br>
><br>
>><br>
>>><br>
>>> Kazu<br>
>>><br>
>>> ><br>
>>> > qianli zhao <<a href="mailto:zhaoqianligood@gmail.com" target="_blank">zhaoqianligood@gmail.com</a>> 于2022年6月24日周五 10:56写道:<br>
>>> ><br>
>>> >><br>
>>> >> Hi,all<br>
>>> >><br>
>>> >> Here's some explanation for this patch<br>
>>> >><br>
>>> >> Without patch:<br>
>>> >> Consider the following scenario<br>
>>> >> ->arm64_init(PRE_GDB)<br>
>>> >> case PRE_GDB:<br>
>>> >> ...<br>
>>> >>   292                         } else if (ms->VA_BITS_ACTUAL) {<br>
>>> >>   293                                 ms->modules_vaddr =<br>
>>> >> (st->_stext_vmlinux & TEXT_OFFSET_MASK) -<br>
>>> >> ARM64_MODULES_VSIZE;-->//ms->modules_vaddr=0xfffffffff8000000<br>
>>> >>   294                                 ms->modules_end =<br>
>>> >> ms->modules_vaddr + ARM64_MODULES_VSIZE<br>
>>> >> -1;--->//ms->modules_end=0xffffffffffffffff<br>
>>> >>   295                                 ms->vmalloc_start_addr =<br>
>>> >> ms->modules_end + 1;--->//ms->vmalloc_start_addr=0<br>
>>> >> 296                         } else {<br>
>>> >>                                 ....<br>
>>> >>                                 }<br>
>>> >>                                 arm64_calc_kimage_voffset();<br>
>>> >> .....<br>
>>> >><br>
>>> >> Since arm64_calc_kimage_voffset() depends on vmalloc_start_addr,<br>
>>> >> kimage_voffset cannot be calculated correctly.<br>
>>> >><br>
>>> >> st->_stext_vmlinux can be initialized in numeric_forward(),just set<br>
>>> >> st->_stext_vmlinux to UNINITIALIZED.<br>
>>> >><br>
>>> >> ============<br>
>>> >> log as below:<br>
>>> >><br>
>>> >> $ ~/crash/crash/crash vmlinux DDRCS0.bin@0x80000000 --machdep vabits_actual=48<br>
>>> >><br>
>>> >> crash 8.0.1++<br>
>>> >> Copyright (C) 2002-2022  Red Hat, Inc.<br>
>>> >> Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation<br>
>>> >> Copyright (C) 1999-2006  Hewlett-Packard Co<br>
>>> >> Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited<br>
>>> >> Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.<br>
>>> >> Copyright (C) 2005, 2011, 2020-2022  NEC Corporation<br>
>>> >> Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.<br>
>>> >> Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.<br>
>>> >> Copyright (C) 2015, 2021  VMware, Inc.<br>
>>> >> This program is free software, covered by the GNU General Public License,<br>
>>> >> and you are welcome to change it and/or distribute copies of it under<br>
>>> >> certain conditions.  Enter "help copying" to see the conditions.<br>
>>> >> This program has absolutely no warranty.  Enter "help warranty" for details.<br>
>>> >><br>
>>> >> NOTE: setting vabits_actual to: 48<br>
>>> >><br>
>>> >> WARNING: kimage_voffset cannot be determined from the dumpfile.<br>
>>> >>         Try using the command line option: --machdep kimage_voffset=<addr><br>
>>> >> GNU gdb (GDB) 10.2<br>
>>> >> Copyright (C) 2021 Free Software Foundation, Inc.<br>
>>> >> License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html" rel="noreferrer" target="_blank">http://gnu.org/licenses/gpl.html</a>><br>
>>> >> This is free software: you are free to change and redistribute it.<br>
>>> >> There is NO WARRANTY, to the extent permitted by law.<br>
>>> >> Type "show copying" and "show warranty" for details.<br>
>>> >> This GDB was configured as "--host=x86_64-pc-linux-gnu<br>
>>> >> --target=aarch64-elf-linux".<br>
>>> >> Type "show configuration" for configuration details.<br>
>>> >> Find the GDB manual and other documentation resources online at:<br>
>>> >>      <<a href="http://www.gnu.org/software/gdb/documentation/" rel="noreferrer" target="_blank">http://www.gnu.org/software/gdb/documentation/</a>>.<br>
>>> >><br>
>>> >> For help, type "help".<br>
>>> >> Type "apropos word" to search for commands related to "word"...<br>
>>> >><br>
>>> >> crash: read error: kernel virtual address: ffff80001083d4a0  type:<br>
>>> >> "kernel_config_data"<br>
>>> >> WARNING: cannot read kernel_config_data<br>
>>> >> crash: read error: kernel virtual address: ffff80001170e798  type: "possible"<br>
>>> >> WARNING: cannot read cpu_possible_map<br>
>>> >> crash: read error: kernel virtual address: ffff80001170e7a8  type: "present"<br>
>>> >> WARNING: cannot read cpu_present_map<br>
>>> >> crash: read error: kernel virtual address: ffff80001170e788  type: "online"<br>
>>> >> WARNING: cannot read cpu_online_map<br>
>>> >> crash: read error: kernel virtual address: ffff80001170e7c0  type: "active"<br>
>>> >> WARNING: cannot read cpu_active_map<br>
>>> >> crash: read error: kernel virtual address: ffff8000122e00f0  type:<br>
>>> >> "shadow_timekeeper xtime_sec"<br>
>>> >> crash: read error: kernel virtual address: ffff80001171dc04  type: "init_uts_ns"<br>
>>> >> crash: vmlinux and /var/tmp/ramdump_elf_m2ivkg do not match!<br>
>>> >><br>
>>> >> Usage:<br>
>>> >><br>
>>> >>    crash [OPTION]... NAMELIST MEMORY-IMAGE[@ADDRESS]     (dumpfile form)<br>
>>> >>    crash [OPTION]... [NAMELIST]                          (live system form)<br>
>>> >><br>
>>> >> Enter "crash -h" for details.<br>
>>> >><br>
>>> >> Qianli Zhao <<a href="mailto:zhaoqianligood@gmail.com" target="_blank">zhaoqianligood@gmail.com</a>> 于2022年6月24日周五 00:14写道:<br>
>>> >>><br>
>>> >>> From: Qianli Zhao <<a href="mailto:qianli.zhao@horizon.ai" target="_blank">qianli.zhao@horizon.ai</a>><br>
>>> >>><br>
>>> >>> Setting st->_stext_vmlinux to UNINITIALIZED to search for "_stext" from the vmlinux<br>
>>> >>> Without the patch, if we do not enable kaslr, will get the wrong<br>
>>> >>> MODULES/VMALLOC ranges, cause parsing dump failure<br>
>>> >>><br>
>>> >>> Signed-off-by: Qianli Zhao <<a href="mailto:qianli.zhao@horizon.ai" target="_blank">qianli.zhao@horizon.ai</a>><br>
>>> >>> ---<br>
>>> >>>   arm64.c | 3 +++<br>
>>> >>>   1 file changed, 3 insertions(+)<br>
>>> >>><br>
>>> >>> diff --git a/arm64.c b/arm64.c<br>
>>> >>> index 0f615cf..4458a66 100644<br>
>>> >>> --- a/arm64.c<br>
>>> >>> +++ b/arm64.c<br>
>>> >>> @@ -149,6 +149,9 @@ arm64_init(int when)<br>
>>> >>><br>
>>> >>>                  ms = machdep->machspec;<br>
>>> >>><br>
>>> >>> +               if (ms->VA_BITS_ACTUAL)<br>
>>> >>> +                       st->_stext_vmlinux = UNINITIALIZED;<br>
>>> >>> +<br>
>>> >>>                  if (!ms->kimage_voffset && STREQ(pc->live_memsrc, "/dev/crash"))<br>
>>> >>>                          ioctl(pc->mfd, DEV_CRASH_ARCH_DATA, &ms->kimage_voffset);<br>
>>> >>><br>
>>> >>> --<br>
>>> >>> 2.17.1<br>
>>> >>><br>
<br>
</blockquote></div></div>