<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 27, 2021 at 11:17 AM HAGIO KAZUHITO(萩尾 一仁) <<a href="mailto:k-hagio-ab@nec.com">k-hagio-ab@nec.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Pingfan, Lianbo,<br>
<br>
-----Original Message-----<br>
> On Mon, Oct 25, 2021 at 4:43 PM HAGIO KAZUHITO(萩尾 一仁)<br>
> <<a href="mailto:k-hagio-ab@nec.com" target="_blank">k-hagio-ab@nec.com</a>> wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > Here is a patch for the issue reported by Ankur.<br>
> > Could you help test this with your ramdumps and arm64 machines?<br>
> ><br>
> The patch looks good to me. And I will schedule a machine to have a test.<br>
<br>
Pingfan, thank you for the check and test, it's very helpful.<br>
<br>
Ankur told me that the patch was working fine.<br>
<br>
Lianbo, my understanding is that to get a raw ramdump, hardware functionality<br></blockquote><div> </div><div>I mean that the raw dumpfile had been generated on my machine, but it didn't reproduce</div><div>this issue.  :-) </div><div>I guess that may be related to the  kernel '.config'.</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">
or something is required.  But maybe you can reproduce a similar situation<br>
with QEMU memory dump without vmcoreinfo?  e.g. on RHEL:<br>
<br>
  # virsh dump <domain> domain.dump --memory-only<br>
<br></blockquote><div> </div><div>Thank you for the suggestion, Kazu.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
but you may need a kernel configured with VA_BITS=48 to reproduce and check<br>
the fix, I guess.<br></blockquote><div> </div><div>I can confirm that kernel has enabled the VA_BITS=48 as below:</div>CONFIG_ARM64_VA_BITS_48=y<br>CONFIG_ARM64_VA_BITS=48<div>Thanks.</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">
<br>
Thanks,<br>
Kazu<br>
<br>
> <br>
> Regards,<br>
> Pingfan<br>
> > --<br>
> > From 028ddf655c847c16cce23198017d2ff0169bb4de Mon Sep 17 00:00:00 2001<br>
> > From: Kazuhito Hagio <<a href="mailto:k-hagio-ab@nec.com" target="_blank">k-hagio-ab@nec.com</a>><br>
> > Date: Mon, 25 Oct 2021 16:53:26 +0900<br>
> > Subject: [PATCH] arm64: Use VA_BITS for page_offset calculation<br>
> ><br>
> > Commit 167d37e347fe ("arm64: assign page_offset with VA_BITS kernel<br>
> > configuration value") changed the page_offset calculation from<br>
> > using VA_BITS_ACTUAL to CONFIG_ARM64_VA_BITS.  This caused an error<br>
> > for ramdumps without vmcoreinfo like this:<br>
> ><br>
> >   crash: vmlinux and /var/tmp/ramdump_elf_XUtCMT do not match!<br>
> ><br>
> > Set the vmcoreinfo value to VA_BITS if available, and use VA_BITS<br>
> > for page_offset calculation instead.<br>
> ><br>
> > Also remove ARM64_FLIP_PAGE_OFFSET_ACTUAL because it's not used<br>
> > actually.<br>
> ><br>
> > Reported-by: Ankur Bansal <<a href="mailto:er.ankurbansal@gmail.com" target="_blank">er.ankurbansal@gmail.com</a>><br>
> > Signed-off-by: Kazuhito Hagio <<a href="mailto:k-hagio-ab@nec.com" target="_blank">k-hagio-ab@nec.com</a>><br>
> > ---<br>
> >  arm64.c | 5 ++++-<br>
> >  defs.h  | 4 +---<br>
> >  2 files changed, 5 insertions(+), 4 deletions(-)<br>
> ><br>
> > diff --git a/arm64.c b/arm64.c<br>
> > index 7069312671cf..3dcbcc642fda 100644<br>
> > --- a/arm64.c<br>
> > +++ b/arm64.c<br>
> > @@ -404,7 +404,7 @@ arm64_init(int when)<br>
> >                                 fprintf(fp, "CONFIG_ARM64_VA_BITS: %ld\n", ms->CONFIG_ARM64_VA_BITS);<br>
> >                                 fprintf(fp, "      VA_BITS_ACTUAL: %ld\n", ms->VA_BITS_ACTUAL);<br>
> >                                 fprintf(fp, "(calculated) VA_BITS: %ld\n", ms->VA_BITS);<br>
> > -                               fprintf(fp, " PAGE_OFFSET: %lx\n", ARM64_FLIP_PAGE_OFFSET_ACTUAL);<br>
> > +                               fprintf(fp, " PAGE_OFFSET: %lx\n", ARM64_FLIP_PAGE_OFFSET);<br>
> >                                 fprintf(fp, "    VA_START: %lx\n", ms->VA_START);<br>
> >                                 fprintf(fp, "     modules: %lx - %lx\n", ms->modules_vaddr,<br>
> ms->modules_end);<br>
> >                                 fprintf(fp, "     vmalloc: %lx - %lx\n", ms->vmalloc_start_addr,<br>
> ms->vmalloc_end);<br>
> > @@ -4031,6 +4031,9 @@ arm64_calc_VA_BITS(void)<br>
> >                                 error(FATAL, "cannot determine VA_BITS_ACTUAL\n");<br>
> >                 }<br>
> ><br>
> > +               if (machdep->machspec->CONFIG_ARM64_VA_BITS)<br>
> > +                       machdep->machspec->VA_BITS = machdep->machspec->CONFIG_ARM64_VA_BITS;<br>
> > +<br>
> >                 /*<br>
> >                  * The mm flip commit is introduced before 52-bits VA, which is before the<br>
> >                  * commit to export NUMBER(TCR_EL1_T1SZ)<br>
> > diff --git a/defs.h b/defs.h<br>
> > index 8b356d5e8959..971005596506 100644<br>
> > --- a/defs.h<br>
> > +++ b/defs.h<br>
> > @@ -3238,9 +3238,7 @@ typedef signed int s32;<br>
> >  #define ARM64_PAGE_OFFSET    ((0xffffffffffffffffUL) \<br>
> >                                         << (machdep->machspec->VA_BITS - 1))<br>
> >  /* kernels >= v5.4 the kernel VA space is flipped */<br>
> > -#define ARM64_FLIP_PAGE_OFFSET (-(1UL) << machdep->machspec->CONFIG_ARM64_VA_BITS)<br>
> > -#define ARM64_FLIP_PAGE_OFFSET_ACTUAL ((0xffffffffffffffffUL) \<br>
> > -                                       - ((1UL) << machdep->machspec->VA_BITS_ACTUAL) + 1)<br>
> > +#define ARM64_FLIP_PAGE_OFFSET (-(1UL) << machdep->machspec->VA_BITS)<br>
> ><br>
> >  #define ARM64_USERSPACE_TOP  ((1UL) << machdep->machspec->VA_BITS)<br>
> >  #define ARM64_USERSPACE_TOP_ACTUAL  ((1UL) << machdep->machspec->VA_BITS_ACTUAL)<br>
> > --<br>
> > 2.27.0<br>
> ><br>
</blockquote></div></div>