All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Marek Vasut <marex@denx.de>, Eddie James <eajames@linux.ibm.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Ralph Siemsen <ralph.siemsen@linaro.org>,
	Safae Ouajih <souajih@baylibre.com>,
	Sean Anderson <sean.anderson@seco.com>,
	Sean Anderson <seanga2@gmail.com>
Subject: Re: [PATCH 0/4] bootm: Handle compressed arm64 images with bootm
Date: Tue, 7 Nov 2023 08:04:50 -0500	[thread overview]
Message-ID: <20231107130450.GA6601@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ1BbpM_Ksr5aKg2zWLv1FPy-N_Kz6fbrkZoh=i7LfpMUA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2768 bytes --]

On Tue, Nov 07, 2023 at 05:23:05AM -0700, Simon Glass wrote:
> Hi Rasmus,
> 
> On Tue, 7 Nov 2023 at 02:56, Rasmus Villemoes
> <rasmus.villemoes@prevas.dk> wrote:
> >
> > On 05/11/2023 21.03, Simon Glass wrote:
> > > This little series corrects a problem I noticed with arm64 images,
> > > where the kernel is not recognised:
> >
> > The $subject is misleading, bootm works just fine with compressed arm64
> > images, with the type set to "kernel".
> >
> > >         Type:         Kernel Image (no loading done)
> > >         Compression:  gzip compressed
> >
> > Isn't that a non-sensical combination to begin with? Decompressing the
> > Image.gz kernel image to any location (however you determine that
> > destination) _is_ loading it.
> 
> Yes, I agree.
> 
> >
> > If you want XIP, obviously the image must be uncompressed in the FIT. I
> > don't understand what you're trying to do here.
> 
> Hmmm, I think I have just got confused about all of this, perhaps
> because ChromeOS uses kernel_noload with compression. Is that an
> invalid combination?

Yes, that sounds like an invalid combination.

> But then how does loading actually work? We don't want to put the load
> address in the FIT, since we don't know what it is...we want to use
> the address provided by the board. Which is kernel_noload...so how
> should this be implemented?

What do you mean, provided by the board? With kernel_noload we XIP the
payload, because the board provided (by loading us to) a safe place to
execute whatevers in there. In the olden days, that would mean (almost
certainly) the zImage which in turn was already compressed and
self-relocating. I know technically one could use the raw vmlinux
instead. With the Linux Kernel and ARCH=arm64 (and a few other arches
now too), they dropped the self-decompression part and the whole payload
must be decompressed. We handle this case in "booti" today by having to
have the board (via environment) say where to decompress to (and how
much space is available). Then we move it back to where we started from,
which is likely not necessary.

Looking at
https://www.kernel.org/doc/html/latest/arch/arm64/booting.html and
https://www.kernel.org/doc/html/latest/riscv/boot-image-header.html
stating "we're just like arm64" we can do better than we do today for
this format of OS image. If aren't compressed, we only need to ensure
that we are correctly aligned and move (and tell the user) if not. We
can even put the 2MB check under some legacy kernel CONFIG option (3.17
is over 9 years old). With respect to automatic decompression, if we
don't have something telling us where a buffer is and we can't pull from
the environment, we should tell the user and stop?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2023-11-07 13:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-05 20:03 [PATCH 0/4] bootm: Handle compressed arm64 images with bootm Simon Glass
2023-11-05 20:03 ` [PATCH 1/4] bootm: Allow ignoring the load address with kernel_noload Simon Glass
2023-11-05 21:19   ` Tom Rini
2023-11-06 17:25     ` Simon Glass
2023-11-06 18:30       ` Tom Rini
2023-11-06 19:58         ` Simon Glass
2023-11-06 20:15           ` Tom Rini
2023-11-07  1:09             ` Simon Glass
2023-11-05 20:03 ` [PATCH 2/4] bootm: Move arm64-image processing later Simon Glass
2023-11-05 21:20   ` Tom Rini
2023-11-06 17:25     ` Simon Glass
2023-11-05 20:03 ` [PATCH 3/4] image: Show the load address when decompressing Simon Glass
2023-11-05 20:03 ` [PATCH 4/4] image: Correct load_bug typo Simon Glass
2023-11-05 20:06 ` [PATCH 0/4] bootm: Handle compressed arm64 images with bootm Simon Glass
2023-11-07  9:56 ` Rasmus Villemoes
2023-11-07 12:23   ` Simon Glass
2023-11-07 13:04     ` Tom Rini [this message]
2023-11-07 13:31       ` Simon Glass
2023-11-07 13:49         ` Tom Rini
2023-11-07 14:30           ` Simon Glass
2023-11-07 19:04             ` Tom Rini

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=20231107130450.GA6601@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=eajames@linux.ibm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=joe.hershberger@ni.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marex@denx.de \
    --cc=mkl@pengutronix.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=ralph.siemsen@linaro.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sean.anderson@seco.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=souajih@baylibre.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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.