[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <kjiyla6qj3l7ezspitulrdoc5laj2e6hoecvd254hssnpddczm@g6nkaombh6va>
Date: Thu, 4 Sep 2025 10:16:00 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc: Huacai Chen <chenhuacai@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Nathan Chancellor <nathan@...nel.org>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/3] LoongArch: Fix unreachable instruction warnings
about entry functions
On Thu, Sep 04, 2025 at 11:18:28AM +0800, Tiezhu Yang wrote:
> On 2025/9/4 上午3:22, Josh Poimboeuf wrote:
> > On Mon, Sep 01, 2025 at 03:21:56PM +0800, Tiezhu Yang wrote:
> > > +++ b/arch/loongarch/kernel/Makefile
> > > @@ -3,8 +3,6 @@
> > > # Makefile for the Linux/LoongArch kernel.
> > > #
> > > -OBJECT_FILES_NON_STANDARD_head.o := y
> > > -
> > > always-$(KBUILD_BUILTIN) := vmlinux.lds
> > > obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
> > > diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
> > > index e3865e92a917..a11880f3a7e1 100644
> > > --- a/arch/loongarch/kernel/head.S
> > > +++ b/arch/loongarch/kernel/head.S
> > > @@ -42,6 +42,7 @@ SYM_DATA(kernel_fsize, .long _kernel_fsize);
> > > .align 12
> > > SYM_CODE_START(kernel_entry) # kernel entry point
> > > + UNWIND_HINT_UNDEFINED
> >
> > Should this not be UNWIND_HINT_END_OF_STACK?
>
> Yes, makes sense, will do it in the next version.
>
> > I notice Loongarch doesn't seem to use that anywhere. How does any ORC
> > unwind succeed? UNWIND_HINT_UNDEFINED sets an error condition which
> > should cause a livepatch transition to stall.
>
> Actually, kernel_entry() or smpboot_entry() is recognized as the last
> frame, because at this point is_entry_func() is true and
> state->stack_info.type = STACK_TYPE_UNKNOWN in unwind_next_frame() of
> arch/loongarch/kernel/unwind_orc.c.
I think you can get rid of is_entry_func() in favor of just using
UNWIND_HINT_END_OF_STACK at all the entry points.
--
Josh
Powered by blists - more mailing lists