From: Philipp Rudo <prudo@redhat.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Masamitsu Yamazaki <yamazaki-msmt@nec.com>,
Kazuhito Hagio <k-hagio-ab@nec.com>,
kexec@lists.infradead.org
Subject: Re: [RFA] makedumpfile: fix access to os_info for /proc/kcore
Date: Fri, 6 Sep 2024 17:12:14 +0200 [thread overview]
Message-ID: <20240906171214.116763f7@rotkaeppchen> (raw)
In-Reply-To: <ZtsTRgzbnFZhkNmV@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Hi Alex,
On Fri, 6 Sep 2024 16:35:50 +0200
Alexander Gordeev <agordeev@linux.ibm.com> wrote:
> On Wed, Sep 04, 2024 at 06:12:59PM +0200, Philipp Rudo wrote:
>
> Hi Philipp,
>
> > Hi Alex,
> >
> > our QE found a problem when trying to run makedumpfile with /proc/kcore
> > on s390. For example
> >
> > # makedumpfile --mem-usage /proc/kcore
> > s390x_init_vm: Can't get s390x os_info ptr.
> >
> > The exact options passed to makedumpfile don't matter. The error is
> > always the same. Trying the same on a dump file created from
> > /proc/vmcore works fine. As the function in question was introduced
> > with you commit 6f8325d ("[PATCH v2 2/2] s390x: uncouple virtual and
> > physical address spaces") I'm reaching out to you.
> >
> > Looking at /proc/kcore with crash I noticed that
> > abs_lowcore->os_info (aka. address 0xe18) is zero. Hence the check
> >
> > if (!readmem(PADDR, S390X_LC_OS_INFO, &addr,
> > sizeof(addr)) || !addr) {
> > ERRMSG("Can't get s390x os_info ptr.\n");
> > return FALSE;
> > }
> >
> > at the beginning of s390x_init_vm fails. My theory is that when trying
> > to access the absolute lowcore via /proc/kcore the read gets prefixed
> > and thus ends up in the per-cpu lowcore. As the os_info field isn't set
> > in the per-cpu lowcore the read returns 0, triggering the error.
>
> Yes, I think your analysis is correct.
\o/ I haven't lost all my s390 skills, yet.
> > I played around with crash trying to access the absolute lowcore via
> > __abs_lowcore and lowcore_ptr but failed. I always ended up in the
> > per-cpu lowcore. I also tried to get the address of os_info from the
> > dwarf information but that only returnes a virtual address which cannot
> > be used in the function that sets up vm...
> >
> > Any idea how this problem could be fixed?
>
> I will take a deeper look at it.
Thanks!
>
> > Thanks
> > Philipp
>
> Thanks for reporting!
>
> > P.S. While looking at the function I found one nit. Right after the
> > check mentioned above there's an other check for
> >
> > if (addr == 0)
> > return TRUE;
> >
> > which can never be true as the !addr from above already handles this
> > case.
>
> It will be TRUE when readmem() succeeded and read out zero.
> In fact, || !addr condition is redundant. Do you want to send a patch?
Could you take over the patch? I'm not really sure, when addr == 0 is
expected. You are much more qualified to describe that.
Thanks
Philipp
expected.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2024-09-06 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 16:12 [RFA] makedumpfile: fix access to os_info for /proc/kcore Philipp Rudo
2024-09-06 14:35 ` Alexander Gordeev
2024-09-06 15:12 ` Philipp Rudo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906171214.116763f7@rotkaeppchen \
--to=prudo@redhat.com \
--cc=agordeev@linux.ibm.com \
--cc=k-hagio-ab@nec.com \
--cc=kexec@lists.infradead.org \
--cc=yamazaki-msmt@nec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.