<div dir="ltr"><div>Hi, Kazu.</div><div><br></div><div dir="ltr">On Thu, Mar 24, 2022 at 3:01 PM HAGIO KAZUHITO(萩尾 一仁) <<a href="mailto:k-hagio-ab@nec.com">k-hagio-ab@nec.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">-----Original Message-----<br>
> 1.) When I tested live system with "crash vmlinux /proc/kcore" in kernel v5.7,<br>
>     I met the following crash issue:<br>
>        ........................................<br>
>        crash: seek error: kernel virtual address: ffff75e9fffff000  type: "pud page"<br>
>        ........................................<br>
> <br>
> 2.) The root cause is the PTOV does not work correctly for some kernel,<br>
>     and then arm64_vtop_4level_4k() does not work correctly too.<br>
> <br>
>     Why PTOV does not work?<br>
> <br>
>     Because the physvirt_offset does not get the correct value.<br>
> <br>
> 3.) This patch uses symbol_value_from_proc_kallsyms() to get the<br>
>     virtual address of "physvirt_offset", and then uses<br>
>     READMEM(,..,KCORE_USE_VADDR) to get the correct value of<br>
>     "physvirt_offset".<br>
> <br>
>     And also updates the ms->phys_offset which is initialized with<br>
>     a wrong value in kernel version [5.4, 5.10).<br>
> <br>
>     Also add more comments for arm64_calc_physvirt_offset().<br>
> <br>
> Signed-off-by: Huang Shijie <<a href="mailto:shijie@os.amperecomputing.com" target="_blank">shijie@os.amperecomputing.com</a>><br>
> ---<br>
> v1 --> v2:<br>
>       v1 tried to get the correct value for phys_offset,<br>
>       and then get the physvirt_offset correctly.<br>
> <br>
>       v2 tried to get the physvirt_offset correctly,<br>
>       and them update phys_offset correctly.<br>
> <br>
>       Tested this patch with kernel 5.7.<br>
<br>
Thank you for the change.  The code looks good to me.<br>
<br>
Acked-by: Kazuhito Hagio <<a href="mailto:k-hagio-ab@nec.com" target="_blank">k-hagio-ab@nec.com</a>><br>
<br>
Lianbo, can we add the following with this?  it's missing in help -m.<br></blockquote><div><br></div><div>Sure. This looks good, I will add the fix when merging, maybe today.</div><div>BTW: I am testing them today.</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">
@@ -1065,6 +1065,7 @@ arm64_dump_machdep_table(ulong arg)<br>
                fprintf(fp, "        kimage_voffset: %016lx\n", ms->kimage_voffset);<br>
        }<br>
        fprintf(fp, "           phys_offset: %lx\n", ms->phys_offset);<br>
+       fprintf(fp, "       physvirt_offset: %lx\n", ms->physvirt_offset);<br>
        fprintf(fp, "__exception_text_start: %lx\n", ms->__exception_text_start);<br>
        fprintf(fp, "  __exception_text_end: %lx\n", ms->__exception_text_end);<br>
        fprintf(fp, " __irqentry_text_start: %lx\n", ms->__irqentry_text_start);<br>
<br>
Thanks,<br>
Kazu<br>
<br>
</blockquote></div></div>