[PATCH v2 2/3] ARM: compressed: Bump MALLOC_SIZE to 128 KiB

From: Andreas Kemnade

Date: Fri Aug 28 2026 - 16:33:08 EST


From: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>

The ZSTD compressor needs about 100 KiB.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
---
arch/arm/boot/compressed/Makefile | 2 +-
arch/arm/boot/compressed/head.S | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index e3f550d628578..fa6ee23cd72eb 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -62,7 +62,7 @@ ZTEXTADDR := 0
ZBSSADDR := ALIGN(8)
endif

-MALLOC_SIZE := 65536
+MALLOC_SIZE := 131072

AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE)
CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 9f406e9c0ea6f..23fbbe94da6e8 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -337,7 +337,7 @@ restart: adr r0, LC1
get_inflated_image_size r9, r10, lr

#ifndef CONFIG_ZBOOT_ROM
- /* malloc space is above the relocated stack (64k max) */
+ /* malloc space is above the relocated stack (128k max) */
add r10, sp, #MALLOC_SIZE
#else
/*
@@ -629,7 +629,7 @@ not_relocated: mov r0, #0
*/
mov r0, r4
mov r1, sp @ malloc space above stack
- add r2, sp, #MALLOC_SIZE @ 64k max
+ add r2, sp, #MALLOC_SIZE @ 128k max
mov r3, r7
bl decompress_kernel


--
2.47.3