arm-zImage: prepare for more malloc requirements of zstd
Subsystems (2)
PATCH 1/1 arm-zImage: prepare for more malloc requirements of zstd
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/[email protected]/#t
https://lore.kernel.org/lkml/[email protected]/
--- kexec/arch/arm/kexec-zImage-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/arm/kexec-zImage-arm.c +2 -2
@@ -663,9 +663,9 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,/* * The zImage length does not include its stack (4k) or its -* malloc space (64k). Include this. +* malloc space (128k). Include this. */ - len +=0x11000 ; + len +=0x21000 ;dbgprintf ("zImage requires 0x%08llx bytes\n" , (unsigned long long )len);
Signature · 1 line
2.47.3
Hi Andreas,
Quoted 3 lines · Andreas Kemnade
As there are plans for zstd in zImage for ARM, which requires more malloc size fo, decompression, increase the space.
_size fo_ looks like a truncated _size for_ .
The high-level changes look good to me. Feel free to add:
Quoted 26 lines
References:
https://lore.kernel.org/lkml/[email protected]/#t
https://lore.kernel.org/lkml/[email protected]/Suggested-by Russell King (Oracle) <[email protected]>Signed-off-by Andreas Kemnade <[email protected]>--- kexec/arch/arm/kexec-zImage-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kexec/arch/arm/kexec-zImage-arm.c +2
-2@@ -663,9 +663,9 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,/* * The zImage length does not include its stack (4k) or its -* malloc space (64k). Include this. +* malloc space (128k). Include this. */ - len +=0x11000 ; + len +=0x21000 ;dbgprintf ("zImage requires 0x%08llx bytes\n" , (unsigned long long )len);
Signature · 2 lines
Regards, Mukesh Pilaniya
Quoted 9 lines · Andreas Kemnade
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/[email protected]/#t
https://lore.kernel.org/lkml/[email protected]/Suggested-by Russell King (Oracle) <[email protected]>Signed-off-by Andreas Kemnade <[email protected]>
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. :(
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!