qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@dornerworks.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Julien Grall" <julien.grall@arm.com>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] hw/arm/boot: Increase compliance with kernel arm64 boot protocol.
Date: Tue, 16 Oct 2018 11:02:00 +0100	[thread overview]
Message-ID: <20181016110200.0b20a7f3@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <65e2edeee9d94a288938da9cec4b16bb@dornerworks.com>

On Tue, 16 Oct 2018 01:19:35 +0000
Stewart Hildebrand <Stewart.Hildebrand@dornerworks.com> wrote:

Hi,

Stewart, thanks a lot for picking this up!

> On Monday, October 15, 2018 6:05 PM, Philippe Mathieu-Daudé wrote:
> > Hi Stewart,
> > 
> > On 15/10/2018 23:26, Stewart Hildebrand wrote:  
> > > +            /* For the virt board, we write our startup
> > > "bootloader" at the very
> > > +             * bottom of RAM, so that bit can't be used for the
> > > image. To avoid
> > > +             * overlap in case the image requests to be loaded
> > > at an offset
> > > +             * smaller than our bootloader, we increment the
> > > load offset to the
> > > +             * next 2MB.
> > > +             */
> > > +            if (kernel_load_offset < FIXUP_MAX) {  
> > 
> > I don't understand how this is related to FIXUP_MAX...  
> 
> You're right, my apologies, it's not directly related.
> write_bootloader() calculates the size of the bootloader like so:
>     len = 0;
>     while (insns[len].fixup != FIXUP_TERMINATOR) {
>         len++;
>     }
> 
> The size of the bootloader then would be len * sizeof(uint32_t)
> 
> It would be nice not to have to repeat that logic in
> load_aarch64_image(). I'll send out a v2 after I take some time to
> wrap my head around it... 

I wonder if this could be done much easier, since TEXT_OFFSET must
actually be page aligned. So all we would need is an *upper bound* for
the bootloader size, as long as that is below 4K we wouldn't even loose
anything.

Cheers,
Andre.

> >   
> > > +                kernel_load_offset += 2 << 20;  
> > 
> > You can use += 2 * MiB; which is easier to review.  
> 
> OK, I will include this in v2.

  reply	other threads:[~2018-10-16 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 21:26 [Qemu-devel] [PATCH] hw/arm/boot: Increase compliance with kernel arm64 boot protocol Stewart Hildebrand
2018-10-15 22:05 ` Philippe Mathieu-Daudé
2018-10-16  1:19   ` Stewart Hildebrand
2018-10-16 10:02     ` Andre Przywara [this message]
2018-10-16 10:04       ` Peter Maydell

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=20181016110200.0b20a7f3@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=Stewart.Hildebrand@dornerworks.com \
    --cc=julien.grall@arm.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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).