Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <linux@armlinux.org.uk>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: kexec@lists.infradead.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Baoquan He <baoquan.he@linux.dev>,
	Mike Rapoport <rppt@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Simon Horman <horms@kernel.org>,
	j.neuschaefer@gmx.net
Subject: Re: [PATCH kexec-tools] arm-zImage: prepare for more malloc requirements of zstd
Date: Mon, 31 Aug 2026 11:31:44 +0100	[thread overview]
Message-ID: <apVYEC-uTnadmbnT@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260829094607.689485-1-andreas@kemnade.info>

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@armlinux.org.uk>
> Signed-off-by: Andreas Kemnade <andreas@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!


      parent reply	other threads:[~2026-08-31 10:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  9:46 [PATCH kexec-tools] arm-zImage: prepare for more malloc requirements of zstd Andreas Kemnade
2026-08-31  9:59 ` Mukesh Pilaniya
2026-08-31 10:31 ` Russell King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apVYEC-uTnadmbnT@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@kemnade.info \
    --cc=baoquan.he@linux.dev \
    --cc=horms@kernel.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=kexec@lists.infradead.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox