From: "H. Peter Anvin" <hpa@zytor.com>
To: Mingcong Bai <jeffbai@aosc.io>, linux-kernel@vger.kernel.org
Cc: "Kexy Biscuit" <kexybiscuit@aosc.io>,
"Xi Ruoyao" <xry111@xry111.site>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
x86@kernel.org, "Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Nick Terrell" <terrelln@fb.com>,
"David Sterba" <dsterba@suse.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Jan Stancek" <jstancek@redhat.com>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Petr Mladek" <pmladek@suse.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Simon Glass" <sjg@chromium.org>,
"Marco Elver" <elver@google.com>,
linux-kbuild@vger.kernel.org
Subject: Re: [RFC PATCH] x86/boot: use zstd -19 if building for 32-bit
Date: Tue, 28 Jul 2026 09:05:32 -0700 [thread overview]
Message-ID: <A7B9C461-C3EE-45FB-83E0-FFABB65F09B3@zytor.com> (raw)
In-Reply-To: <20260728143141.2870515-1-jeffbai@aosc.io>
On July 28, 2026 7:31:35 AM PDT, Mingcong Bai <jeffbai@aosc.io> wrote:
>When using native build environments (that is, 32-bit x86 chroot/container
>as build environment for 32-bit x86 binaries), `zstd -22' requests more
>virtual memory than that could be allowed on 32-bit hosts.
>
>Introduce `cmd_zstd_with_size' for CONFIG_X86_32 builds.
>
>This is quite possibly just stupid... But there doesn't seem to be a way
>to detect the host environment. So I'm sending this patch as a means to
>ask for your opinions.
>
>Any help would be greated appreciated.
>
>Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
>---
> arch/x86/boot/compressed/Makefile | 5 +++++
> scripts/Makefile.lib | 3 +++
> 2 files changed, 8 insertions(+)
>
>diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
>index 07e0e64b9a98..2261fb0d4d1d 100644
>--- a/arch/x86/boot/compressed/Makefile
>+++ b/arch/x86/boot/compressed/Makefile
>@@ -143,8 +143,13 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
> $(call if_changed,lzo_with_size)
> $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
> $(call if_changed,lz4_with_size)
>+ifdef CONFIG_X86_32
>+$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
>+ $(call if_changed,zstd_with_size)
>+else
> $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
> $(call if_changed,zstd22_with_size)
>+endif
>
> suffix-$(CONFIG_KERNEL_GZIP) := gz
> suffix-$(CONFIG_KERNEL_BZIP2) := bz2
>diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>index 0718e39cedda..09910dc57af3 100644
>--- a/scripts/Makefile.lib
>+++ b/scripts/Makefile.lib
>@@ -464,6 +464,9 @@ quiet_cmd_xzmisc = XZMISC $@
> quiet_cmd_zstd = ZSTD $@
> cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@
>
>+quiet_cmd_zstd = ZSTD $@
>+ cmd_zstd_with_size = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@
>+
> quiet_cmd_zstd22 = ZSTD22 $@
> cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra > $@
>
This is really just stupid. Basing it on the config setting is just plain wrong.
prev parent reply other threads:[~2026-07-28 16:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 14:31 Mingcong Bai
2026-07-28 14:42 ` Xi Ruoyao
2026-07-28 15:58 ` Ard Biesheuvel
2026-07-29 1:44 ` Mingcong Bai
2026-07-28 16:05 ` H. Peter Anvin [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=A7B9C461-C3EE-45FB-83E0-FFABB65F09B3@zytor.com \
--to=hpa@zytor.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dsterba@suse.com \
--cc=elver@google.com \
--cc=jeffbai@aosc.io \
--cc=jpoimboe@kernel.org \
--cc=jstancek@redhat.com \
--cc=kexybiscuit@aosc.io \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=sjg@chromium.org \
--cc=terrelln@fb.com \
--cc=tglx@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=x86@kernel.org \
--cc=xry111@xry111.site \
/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
all inboxes | Powered by JetHome®