kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: WANG Rui <wangrui@loongson.cn>
To: kexec@lists.infradead.org
Cc: Florian Fainelli <florian@openwrt.org>,
	Huacai Chen <chenhuacai@kernel.org>, hev <r@hev.cc>,
	WANG Rui <wangrui@loongson.cn>
Subject: [PATCH] lzma: Relax memory limit for lzma decompressor
Date: Sat, 25 Nov 2023 15:26:43 +0800	[thread overview]
Message-ID: <20231125072643.116681-1-wangrui@loongson.cn> (raw)

The kexec cannot load LZMA compressed vmlinuz.efi on LoongArch.

  Try LZMA decompression.
  lzma_decompress_file: read on /tmp/Image4yyfhM of 65536 bytes failed
  pez_prepare: decompressed size 8563960
  pez_prepare: done
  Cannot load vmlinuz.efi

The root cause is that lzma decompressor requires more memory usage,
which exceeds the current 64M limit.

Reported-by: Huacai Chen <chenhuacai@kernel.org>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
---
 kexec/lzma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/lzma.c b/kexec/lzma.c
index 2fc07e6..56778d1 100644
--- a/kexec/lzma.c
+++ b/kexec/lzma.c
@@ -73,7 +73,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
 		ret = lzma_alone_encoder(&lzfile->strm, &opt_lzma);
 	} else {
 		ret = lzma_auto_decoder(&lzfile->strm,
-					UINT64_C(64) * 1024 * 1024, 0);
+					UINT64_C(128) * 1024 * 1024, 0);
 	}
 	if (ret != LZMA_OK) {
 		fclose(fp);
-- 
2.42.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

             reply	other threads:[~2023-11-25  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25  7:26 WANG Rui [this message]
2023-11-27 13:47 ` [PATCH] lzma: Relax memory limit for lzma decompressor Simon Horman

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=20231125072643.116681-1-wangrui@loongson.cn \
    --to=wangrui@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=florian@openwrt.org \
    --cc=kexec@lists.infradead.org \
    --cc=r@hev.cc \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).