From: "Oliver O'Halloran" <oohall@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu
Date: Wed, 23 Oct 2019 23:44:41 +1100 [thread overview]
Message-ID: <CAOSf1CGjVt1v4RcazXTLkbm=fsswF8a5nqsLZod4=YwymLXPvg@mail.gmail.com> (raw)
In-Reply-To: <20191023112102.GN28442@gate.crashing.org>
On Wed, Oct 23, 2019 at 10:21 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote:
> > When booting under OF the zImage expects the initrd address and size to be
> > passed to it using registers r3 and r4. SLOF (guest firmware used by QEMU)
> > currently doesn't do this so the zImage is not aware of the initrd
> > location. This can result in initrd corruption either though the zImage
> > extracting the vmlinux over the initrd, or by the vmlinux overwriting the
> > initrd when relocating itself.
> >
> > QEMU does put the linux,initrd-start and linux,initrd-end properties into
> > the devicetree to vmlinux to find the initrd. We can work around the SLOF
> > bug by also looking those properties in the zImage.
>
> This is not a bug. What boot protocol requires passing the initrd start
> and size in GPR3, GPR4?
>
> The CHRP binding (what SLOF implements) requires passing two zeroes here.
> And ePAPR requires passing the address of a device tree and a zero, plus
> something in GPR6 to allow distinguishing what it does.
This is what is assumed by the zImage.pseries. I have no idea where
that assumption comes from,A B
> As Alexey says, initramfs works just fine, so please use that? initrd was
> deprecated when this code was written already.
That's not what Alexey said and the distinction between an initrd and
an initramfs is completely arbitrary.
>
>
> Segher
next prev parent reply other threads:[~2019-10-23 12:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 1:36 [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu Oliver O'Halloran
2019-10-23 7:00 ` Alexey Kardashevskiy
2019-10-23 11:21 ` Segher Boessenkool
2019-10-23 12:44 ` Oliver O'Halloran [this message]
2019-10-24 1:31 ` Alexey Kardashevskiy
2019-10-24 1:47 ` Alexey Kardashevskiy
2019-10-24 17:45 ` Segher Boessenkool
2019-10-25 0:03 ` Alexey Kardashevskiy
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='CAOSf1CGjVt1v4RcazXTLkbm=fsswF8a5nqsLZod4=YwymLXPvg@mail.gmail.com' \
--to=oohall@gmail.com \
--cc=aik@ozlabs.ru \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=segher@kernel.crashing.org \
--cc=stable@vger.kernel.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).