Re: [PATCH v2 5/5] boot: Don't allow kernel_noload with compression

2023-11-14 Thread Tom Rini
On Sat, Nov 11, 2023 at 08:49:57PM -0700, Simon Glass wrote:

> 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 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 5/5] boot: Don't allow kernel_noload with compression

2023-11-11 Thread Simon Glass
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 
---

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