Re: [PATCH v1 3/3] LoongArch: Fix unreachable instruction warnings about entry functions

From: Josh Poimboeuf
Date: Wed Sep 03 2025 - 15:22:51 EST


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?

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.

--
Josh