[PATCH kexec-tools] arm-zImage: prepare for more malloc requirements of zstd
Russell King
linux at armlinux.org.uk
Mon Aug 31 03:31:44 PDT 2026
On Sat, Aug 29, 2026 at 11:46:07AM +0200, Andreas Kemnade wrote:
> As there are plans for zstd in zImage for ARM, which requires more malloc
> size fo, decompression, increase the space.
>
> References:
> https://lore.kernel.org/lkml/ZFDMRst2O+RJUYuu@shell.armlinux.org.uk/#t
> https://lore.kernel.org/lkml/20260828-zstd2-v2-0-4d9ce7150877@kemnade.info/
>
> Suggested-by: Russell King (Oracle) <linux at armlinux.org.uk>
> Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
There's a better way to deal with this, added in commit adc5f7029376
("ARM: add malloc size to decompressor kexec size structure") in the
kernel. An additional member was added to the magic structure which
indicates the required malloc size.
In kexec-tools, this structure can be found as "struct zimage_tag"
but it is missing the extended entry in struct zimage_krnl_size.
This still requires the 4k stack to be added, but will give you the
size of the malloc. If this member is missing, then 64k should be
assumed.
Note that tag->hdr.size checks in kexec look incorrect, as this is
the number of 32-bit words from the start of the tag. It also looks
like find_extension_tag() assumes it's bytes rather than 32-bit
words. :(
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
More information about the kexec
mailing list