[PATCH kexec-tools v3] arm-zImage: prepare for more malloc requirements of zstd
Tom Fitzhenry
tom at tom-fitzhenry.me.uk
Tue Sep 22 05:14:24 PDT 2026
I tested this in QEMU with kexec-tools at 43c5cba85ad2 plus this patch:
1. Against unmodified Linux 8d3ae59288f1 (gzip): kexec reads the
64 KiB malloc size from the header and boots the second kernel via
kexec -e without regression:
# /bin/kexec-patched --debug -l /boot/zImage
--initrd=/boot/tiny-initrd.cpio.gz --append="console=ttyAMA0 kexec_booted=1"
[...]
zImage size 0x1a3500, file size 0x1a3500
offset 0x00007770 tag 0x5a534c4b size 24
zImage requires 0x001b4500 bytes
[...]
$ printf "0x%x\n" $((0x001b4500 - 0x001a3500))
0x11000 # 0x1000 (4 KiB stack) + 0x10000 (64 KiB malloc)
2. Against Linux 8d3ae59288f1 with the v2 ARM zstd series[1] applied:
kexec reads the increased 128 KiB malloc size from the
header and boots the second kernel via kexec -e:
# /bin/kexec-patched --debug -l /boot/zImage
--initrd=/boot/tiny-initrd.cpio.gz --append="console=ttyAMA0 kexec_booted=1"
[...]
zImage size 0x182548, file size 0x182548
offset 0x00017370 tag 0x5a534c4b size 24
zImage requires 0x001a3548 bytes
[...]
$ printf "0x%x\n" $((0x001a3548 - 0x00182548))
0x21000 # 0x1000 (4 KiB stack) + 0x20000 (128 KiB malloc)
Thank you addressing my comments.
Reviewed-by: Tom Fitzhenry <tom at tom-fitzhenry.me.uk>
Tested-by: Tom Fitzhenry <tom at tom-fitzhenry.me.uk>
[1]
https://lore.kernel.org/lkml/20260828-zstd2-v2-0-4d9ce7150877@kemnade.info/
More information about the kexec
mailing list