Re: [PATCH 08/11] objtool/loongarch: Add unwind hints in prepare_frametrace()

From: Tiezhu Yang
Date: Tue Apr 01 2025 - 03:46:54 EST


On 04/01/2025 03:08 PM, Ingo Molnar wrote:

* Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:

If 'regs' points to a local stack variable, prepare_frametrace() stores
all registers to the stack. This confuses objtool as it expects them to
be restored from the stack later.

The stores don't affect stack tracing, so use unwind hints to hide them
from objtool.

Fixes the following warnings:

arch/loongarch/kernel/traps.o: warning: objtool: show_stack+0xe0: stack state mismatch: reg1[22]=-1+0 reg2[22]=-2-160
arch/loongarch/kernel/traps.o: warning: objtool: show_stack+0xe0: stack state mismatch: reg1[23]=-1+0 reg2[23]=-2-152

Cc: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202503280703.OARM8SrY-lkp@xxxxxxxxx/
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Note, I skipped this fix from tip:objtool/urgent for the time being,
because Tiezhu Yang indicated that he'd be reviewing and testing this
patch.

Tested-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>