All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb+git@google.com>
To: linux-efi@vger.kernel.org
Cc: loongarch@lists.linux.dev, Ard Biesheuvel <ardb@kernel.org>,
	 Dmitry Antipov <dmantipov@yandex.ru>,
	Huacai Chen <chenhuacai@kernel.org>,
	 WANG Xuerui <kernel@xen0n.name>
Subject: [PATCH 3/3] efi/libstub: Provide library helpers only where needed
Date: Thu, 26 Nov 2026 16:50:21 +0100	[thread overview]
Message-ID: <20261126155017.2401147-8-ardb+git@google.com> (raw)
In-Reply-To: <20261126155017.2401147-5-ardb+git@google.com>

From: Ard Biesheuvel <ardb@kernel.org>

Now that dead stub code is being eliminated by the linker, the only
remaining user of the 64-bit left shift and clz/ctz helper routines is
ZSTD compression, and only in some cases:

- the 64-bit left shift is only needed on 32-bit architectures
- the clz/ctz helper is needed on all RISC-V and 32-bit reduced
  LoongArch

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/libstub/Makefile | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
index 20b5b77956d1..ba6d67e5cd78 100644
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -98,14 +98,15 @@ CFLAGS_arm32-stub.o		:= -DTEXT_OFFSET=$(TEXT_OFFSET)
 
 zboot-obj-y			:= zboot-decompress-gzip.o
 CFLAGS_zboot-decompress-gzip.o	+= -I$(srctree)/lib/zlib_inflate
-zboot-obj-$(CONFIG_KERNEL_ZSTD)	:= zboot-decompress-zstd.o lib-xxhash.o
+
+zstd-obj-$(CONFIG_32BIT)	:= lib-ashldi3.o
+zstd-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o
+zstd-obj-$(CONFIG_32BIT_REDUCED) += lib-clz_ctz.o # loongarch
+zboot-obj-$(CONFIG_KERNEL_ZSTD)	:= zboot-decompress-zstd.o lib-xxhash.o \
+				   $(zstd-obj-y)
 CFLAGS_zboot-decompress-zstd.o	+= -I$(srctree)/lib/zstd
 
-zboot-riscv-obj-$(CONFIG_32BIT)	:= lib-ashldi3.o lib-lshrdi3.o
-zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o $(zboot-riscv-obj-y)
-zboot-obj-$(CONFIG_LOONGARCH)	+= lib-clz_ctz.o
 lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o $(zboot-obj-y)
-
 lib-$(CONFIG_UNACCEPTED_MEMORY) += unaccepted_memory.o bitmap.o find.o
 
 targets				:= $(lib-y)
-- 
2.56.1.839.g22a8290db9-goog


  parent reply	other threads:[~2026-11-26 15:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 15:50 [PATCH 0/3] efi/libstub: Fix library dependencies Ard Biesheuvel
2026-11-26 15:50 ` [PATCH 1/3] efi/libstub: loongarch: Provide 64-bit integer shift helpers for 32-bit Ard Biesheuvel
2026-11-26 15:50 ` [PATCH 2/3] efi/zboot: Eliminate unused code from the zboot executable Ard Biesheuvel
2026-11-26 15:50 ` Ard Biesheuvel [this message]
2026-11-26 16:22   ` [PATCH 3/3] efi/libstub: Provide library helpers only where needed Dmitry Antipov
2026-11-26 16:29     ` Ard Biesheuvel
2026-11-27  2:28   ` Huacai Chen
2026-11-27  7:13     ` Ard Biesheuvel
2026-11-27  9:11       ` Ard Biesheuvel
2026-11-27  9:48         ` Ard Biesheuvel
2026-11-27 12:57           ` Ard Biesheuvel

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=20261126155017.2401147-8-ardb+git@google.com \
    --to=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=dmantipov@yandex.ru \
    --cc=kernel@xen0n.name \
    --cc=linux-efi@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.