From: Amol Surati <suratiamol@gmail.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-devel@nongnu.org, "Greg Kurz" <groug@kaod.org>,
qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
"Joel Stanley" <joel@jms.id.au>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: Generate phandle for the "interrupt-parent" property
Date: Wed, 24 Jul 2019 20:25:04 +0530 [thread overview]
Message-ID: <20190724145504.GA29378@arch> (raw)
In-Reply-To: <20190724085730.GX25073@umbus.fritz.box>
On Wed, Jul 24, 2019 at 06:57:30PM +1000, David Gibson wrote:
> On Wed, Jul 24, 2019 at 09:11:54AM +0200, Cédric Le Goater wrote:
> > On 24/07/2019 05:23, David Gibson wrote:
> > > On Tue, Jul 23, 2019 at 11:01:38AM +0200, Cédric Le Goater wrote:
> > >> Devices such as the BT or serial devices require a valid
> > >> "interrupt-parent" phandle in the device tree and it is currently
> > >> empty (0x0). It was not a problem until now but since OpenFirmare
> > >> started using a recent libdft (>= 1.4.7), petitboot fails to boot the
> > >> system image with error :
> > >>
> > >> dtc_resize: fdt_open_into returned FDT_ERR_BADMAGIC
> > >>
> > >> Provide a phandle for the LPC bus.
> > >>
> > >> Suggested-by: Greg Kurz <groug@kaod.org>
> > >> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > >
> > > I've applied this, since it looks to be correct.
> > >
> > > But.. can you connect the dots for me in how this being missing
> > > results in a BADMAGIC error??
> >
> > Some binary called by petitboot segfaults when trying to kexec an image on
> > a system with a bogus DT (generated by QEMU). I don't know exactly which one
> > as I only see the error message above and the segv message in dmesg
>
> Ok, I'm still not seeing how that gets you to a BADMAGIC error.
If I may interject, as this patch is related to the qemu bug:
https://bugs.launchpad.net/qemu/+bug/1826827.
The error is printed by dtc_resize in kexec.c from kexec-lite
(antonblanchard/kexec-lite).
There are two places where dtc_resize is called -
(1) initialize_fdt, when kexec is passed a dtb file.
(2) fdt_from_fs, when kexec must make dtc read /proc/device-tree to form
a dtb.
If initialize_fdt is called with a file which is an invalid dtb, the
dtc_resize prints the FDT_ERR_BADMAGIC error.
Bug# 1826827 shows that dtc is one application that does
crash, although through the firing of an assertion, in the absence of
the mentioned properties. (fix to avoid the crash already checked into
dtc upstream, commit 8f69567622; to be released with dtc-v1.5.1).
Assuming that the crashing app (it is not known here what it is) is
supposed to create a dtb for kexec, and its crash leaves behind an
incomplete/invalid dtb file, the initialize_fdt might receive an invalid
dtb.
Another possibility for that error exists within the fdt_from_fs function,
but that needs a version of kexec-lite at least 5 years old, which is
unlikely to be used here I guess.
If this patch fixes both the crash and the error "dtc_resize: ....",
it is likely that dtc (or anything else which depends on libfdt) was the
cause of the crash, with dtc/libfdt version being < g8f69567622.
Thanks,
-amol
next prev parent reply other threads:[~2019-07-24 14:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-23 9:01 [Qemu-devel] [PATCH] ppc/pnv: Generate phandle for the "interrupt-parent" property Cédric Le Goater
2019-07-24 3:23 ` David Gibson
2019-07-24 7:11 ` Cédric Le Goater
2019-07-24 8:57 ` David Gibson
2019-07-24 9:27 ` Cédric Le Goater
2019-07-24 14:55 ` Amol Surati [this message]
2019-07-25 3:26 ` [Qemu-devel] [Qemu-ppc] " David Gibson
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=20190724145504.GA29378@arch \
--to=suratiamol@gmail.com \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=joel@jms.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).