From 3472c2b5ee2ebd4790e5ba72987463675e40749a Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Sat, 25 Nov 2023 15:26:43 +0800 Subject: [PATCH] lzma: Relax memory limit for lzma decompressor 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 Signed-off-by: WANG Rui Signed-off-by: Simon Horman --- kexec/lzma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/lzma.c b/kexec/lzma.c index 2fc07e6c..56778d1d 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);