All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Antipov" <dmantipov@yandex.ru>,
	"Ard Biesheuvel" <ardb@kernel.org>
Cc: "Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	linux-efi@vger.kernel.org, "kernel test robot" <lkp@intel.com>
Subject: Re: [PATCH] efi/libstub: fix building loongarch32 without zboot enabled
Date: Thu, 26 Nov 2026 10:26:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-235286@kernel.org> (raw)
In-Reply-To: <20261126101452.590895-1-dmantipov@yandex.ru>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] efi/libstub: dropping $(zboot-obj-y) breaks all
  CONFIG_EFI_ZBOOT builds
- [High] efi/libstub: removing shift helpers breaks riscv32
  CONFIG_EFI_ZBOOT link
- [High] efi/libstub: removing lib-clz_ctz.o breaks ZSTD
  CONFIG_EFI_ZBOOT link
--

commit 903c012d44a1b7b277bbfa82862bc5644c32ea38
Author: Dmitry Antipov <dmantipov@yandex.ru>

efi/libstub: fix building loongarch32 without zboot enabled

This commit moves loongarch32 shift helper library objects from
CONFIG_EFI_ZBOOT to CONFIG_EFI_GENERIC_STUB and removes the riscv and
loongarch zboot helper objects from drivers/firmware/efi/libstub/Makefile.

> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index 0c5fbc21d2a29..6b569b648e374 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -97,11 +97,11 @@ CFLAGS_zboot-decompress-gzip.o	+= -I$(srctree)/lib/zlib_inflate
>  zboot-obj-$(CONFIG_KERNEL_ZSTD)	:= zboot-decompress-zstd.o lib-xxhash.o
>  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-loongarch-obj-$(CONFIG_32BIT) := lib-ashldi3.o lib-lshrdi3.o
> -zboot-obj-$(CONFIG_LOONGARCH)	+= lib-clz_ctz.o $(zboot-loongarch-obj-y)

[Severity: High]
Does removing lib-ashldi3.o and lib-lshrdi3.o on 32-bit RISC-V break
linking vmlinuz.efi.elf when CONFIG_EFI_ZBOOT is enabled, regressing
442082297e3d ("riscv: fix building compressed EFI image")?

The aliases in arch/riscv/kernel/image-vars.h are only included in
vmlinux.lds.S when linking vmlinux.  Makefile.zboot links vmlinuz.efi.elf
as a standalone binary using zboot.lds and
drivers/firmware/efi/libstub/lib.a, where efi_zboot_entry() ->
efi_handle_cmdline() -> memparse() still needs __efistub___ashldi3 and
__efistub___lshrdi3.

[Severity: High]
Does dropping lib-clz_ctz.o for CONFIG_RISCV and CONFIG_LOONGARCH break
CONFIG_EFI_ZBOOT builds with CONFIG_KERNEL_ZSTD=y?

zboot-decompress-zstd.c uses __builtin_ctz* and __builtin_clz* via
lib/zstd/common/bits.h.  On RISC-V without Zbb and on 32-bit LoongArch,
the compiler emits calls to __ctz* and __clz* that remain unresolved when
linking vmlinuz.efi.elf against drivers/firmware/efi/libstub/lib.a.

> -lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o $(zboot-obj-y)
> +extra-loongarch-obj-$(CONFIG_32BIT)	:= lib-ashldi3.o lib-lshrdi3.o
> +extra-obj-$(CONFIG_LOONGARCH)	+= $(extra-loongarch-obj-y)
> +lib-$(CONFIG_EFI_GENERIC_STUB)	+= $(extra-obj-y)
> +
> +lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o

[Severity: High]
Does removing $(zboot-obj-y) from lib-$(CONFIG_EFI_ZBOOT) break all
CONFIG_EFI_ZBOOT builds?

zboot-obj-y holds zboot-decompress-gzip.o or zboot-decompress-zstd.o and
lib-xxhash.o, so dropping $(zboot-obj-y) leaves
__efistub_efi_zboot_decompress_init and __efistub_efi_zboot_decompress
undefined when linking vmlinuz.efi.elf from zboot.o.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126101452.590895-1-dmantipov@yandex.ru?part=1

  reply	other threads:[~2026-11-26 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 10:14 [PATCH] efi/libstub: fix building loongarch32 without zboot enabled Dmitry Antipov
2026-11-26 10:14 ` Dmitry Antipov
2026-11-26 10:26 ` sashiko-bot [this message]
2026-11-26 10:27 ` Ard Biesheuvel
2026-11-26 10:27   ` 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=sashiko-outbox-235286@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=dmantipov@yandex.ru \
    --cc=kernel@xen0n.name \
    --cc=linux-efi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=sashiko-reviews@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.