U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>,
	Simon Glass <sjg@chromium.org>,
	Eddie James <eajames@linux.ibm.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Safae Ouajih <souajih@baylibre.com>
Subject: [PATCH v2 5/5] boot: Don't allow kernel_noload with compression
Date: Sat, 11 Nov 2023 20:49:57 -0700	[thread overview]
Message-ID: <20231112035001.103897-2-sjg@chromium.org> (raw)
In-Reply-To: <20231112035001.103897-1-sjg@chromium.org>

It is not possible to execute the kernel in-place without loading it.
Detect this and show an error, to avoid a crash.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Add a 'success' case to the cover letter
- Redo how the arm64 support is implemented

 boot/bootm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/bootm.c b/boot/bootm.c
index 4c150e895f2f..e3f5f81becd7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -248,6 +248,10 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
 	}
 
 	if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
+		if (images.os.comp != IH_COMP_NONE) {
+			puts("Cannot use kernel_noload with compression\n");
+			return 1;
+		}
 		images.os.load = images.os.image_start;
 		images.ep += images.os.image_start;
 	}
-- 
2.42.0.869.gea05f2083d-goog


  parent reply	other threads:[~2023-11-12  3:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12  3:49 [PATCH v2 0/5] bootm: Handle compressed arm64 images with bootm Simon Glass
2023-11-12  3:49 ` [PATCH v2 1/5] image: Correct load_bug typo Simon Glass
2023-11-14 16:40   ` Tom Rini
2023-11-12  3:49 ` [PATCH v2 2/5] image: Show the load address when decompressing Simon Glass
2023-11-14 22:36   ` Tom Rini
2023-11-12  3:49 ` [PATCH v2 3/5] bootm: Allow omitting the load address Simon Glass
2023-11-14 16:38   ` Tom Rini
2023-11-14 18:04     ` Tom Rini
2023-11-18 17:10       ` Simon Glass
2023-11-12  3:49 ` [PATCH v2 4/5] bootm: Move arm64-image processing later Simon Glass
2023-11-12  3:49 ` Simon Glass [this message]
2023-11-14 16:31   ` [PATCH v2 5/5] boot: Don't allow kernel_noload with compression 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=20231112035001.103897-2-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=eajames@linux.ibm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=marex@denx.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=souajih@baylibre.com \
    --cc=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox