[PATCH v2 3/3] bootm: increase kernel_noload decompression headroom from 4x to 8x

Simon Glass sjg at chromium.org
Wed Jun 3 18:52:10 CEST 2026


On 2026-05-27T15:04:32, Aristo Chen <aristo.chen at canonical.com> wrote:
> bootm: increase kernel_noload decompression headroom from 4x to 8x
>
> For a compressed kernel_noload image, bootm_load_os() allocates a buffer
> of ALIGN(image_len * 4, SZ_1M). The 4x factor is at the edge of what
> modern compressors (zstd, xz) achieve on real kernels, so a
> well-compressed vendor kernel can fail to boot at runtime with no
> intervening warning.
>
> Bump the headroom to 8x. The buffer is still bounded by the compressed
> image size, and the SZ_1M alignment keeps the overhead below 1 MiB on
> small kernels. Update the matching references in the kernel_noload
> sandbox tests so they stay in sync with the bound bootm_load_os()
> enforces.
>
> Suggested-by: Simon Glass <sjg at chromium.org>
> Signed-off-by: Aristo Chen <aristo.chen at canonical.com>
>
> boot/bootm.c              |  6 +++---
>  test/py/tests/test_fit.py | 14 +++++++-------
>  2 files changed, 10 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list