[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wt4qpgi5isj5m6wq33pomvm6borvafuzktekc7lgtoitscar5q@brixzj3lccbw>
Date: Wed, 3 Sep 2025 12:19:18 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc: Peter Zijlstra <peterz@...radead.org>,
Huacai Chen <chenhuacai@...nel.org>, Nathan Chancellor <nathan@...nel.org>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/3] objtool/LoongArch: Fix unreachable instruction
warnings about EFISTUB
On Mon, Sep 01, 2025 at 04:39:29PM +0800, Tiezhu Yang wrote:
> On 2025/9/1 下午4:19, Peter Zijlstra wrote:
> > On Mon, Sep 01, 2025 at 03:21:55PM +0800, Tiezhu Yang wrote:
> > > When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist the
> > > following objtool warnings:
> > >
> > > vmlinux.o: warning: objtool: .head.text+0x0: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x18: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x38: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x3c: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x40: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x44: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x54: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x58: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x6c: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x84: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x94: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x9c: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0xc4: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0xf8: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0xfc: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x104: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x10c: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x11c: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x120: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x124: unreachable instruction
> > > vmlinux.o: warning: objtool: .head.text+0x144: unreachable instruction
> > >
> > > The instructions in the .head.text section are related with EFISTUB,
> > > they are image header and can be ignored by objtool, so just check the
> > > section name in ignore_unreachable_insn() to ignore it.
> >
> > I am confused; why do the efi/libstub functions generate this error?
> >
> > Is this zboot-header.S perhaps? Why can't we properly annotate that
> > file?
>
> This is arch/loongarch/kernel/head.S.
>
> There is "OBJECT_FILES_NON_STANDARD_head.o := y" in Makefile
> to skip objtool checking for head.o, but OBJECT_FILES_NON_STANDARD
> does not work for link time validation of vmlinux.o.
>
> At the beginning, give UNWIND_HINT_UNDEFINED for these instructions,
> but there is an argument in the previous RFC [1]:
>
> "The efi header is completely not code, the annotations are very strange."
>
> Josh suggested to do something to put these instructions in the data
> section, but as said in the previous reply, it needs to modify the link
> process and seems too complicated and expensive for this warning to some
> extent.
>
> So I did this change for objtool.
I don't like this workaround either, how exactly is it complicated and
expensive to put the data in a data section?
--
Josh
Powered by blists - more mailing lists