[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xyrcgkl7ud5pgh4h5yjyejz646bc22fnnwxahaoafqvnqintf3@mdhtfaybai67>
Date: Tue, 26 Aug 2025 16:39:34 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: Tiezhu Yang <yangtiezhu@...ngson.cn>,
Peter Zijlstra <peterz@...radead.org>, Nathan Chancellor <nathan@...nel.org>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/2] objtool/LoongArch: Fix fall through warning
about efi_boot_kernel()
On Tue, Aug 26, 2025 at 09:03:34PM +0800, Huacai Chen wrote:
> On Tue, Aug 26, 2025 at 8:33 PM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
> >
> > On 2025/8/26 下午4:32, Huacai Chen wrote:
> > > On Tue, Aug 26, 2025 at 2:46 PM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
> > >>
> > >> When compiling with LLVM and CONFIG_LTO_CLANG is set, there exists
> > >> the following objtool warning:
> > >>
> > >> vmlinux.o: warning: objtool: __efistub_efi_boot_kernel()
> > >> falls through to next function __efistub_exit_boot_func()
> >
> > ...
> >
> > >> -typedef void __noreturn (*kernel_entry_t)(bool efi, unsigned long cmdline,
> > >> +typedef void (*kernel_entry_t)(bool efi, unsigned long cmdline,
> > >> unsigned long systab);
> > > From my point of view this is incorrect, this function is indeed a
> > > noreturn function, and this modification makes LoongArch different to
> > > other architectures.
> > >
> > > Maybe it is better to let objtool ignore the whole
> > > drivers/firmware/efi/libstub directory. Because efistub is discarded
> > > at runtime so it is useless for stack unwinder.
> >
> > I tested the following change but there is no effect, the objtool
> > warning still exists, this is because OBJECT_FILES_NON_STANDARD
> > does not work for link time validation of vmlinux.o according to
> > tools/objtool/Documentation/objtool.txt.
> Then I think objtool needs to be improved to handle this case, this
> problem is not arch specific.
Yeah, objtool should really be ignoring this code altogether. On x86,
that's not a problem because the EFI stub code isn't linked into
vmlinux.o. It gets linked in separately:
$ git grep vmlinux-libs
arch/x86/boot/compressed/Makefile:vmlinux-libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
arch/x86/boot/compressed/Makefile:vmlinux-libs-$(CONFIG_X86_64) += $(objtree)/arch/x86/boot/startup/lib.a
arch/x86/boot/compressed/Makefile:$(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE
IMO, the proper fix is to change the loongarch build to do the same.
vmlinux.o is intended to be proper kernel code.
--
Josh
Powered by blists - more mailing lists