]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
objtool/loongarch: Add unwind hints in prepare_frametrace()
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 1 Apr 2025 04:26:43 +0000 (21:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:28 +0000 (14:39 +0200)
commit26bf086ebd7019928aca7b0f8972d9ef09faeb09
tree0cf38c02be7a82c9c7d6fa829e645a07f50e9060
parentd80168db5e0c68426c67c7568e12b4b8a4550abf
objtool/loongarch: Add unwind hints in prepare_frametrace()

[ Upstream commit 7c977393b8277ed319e92e4b598b26598c9d30c0 ]

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

Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support")
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/270cadd8040dda74db2307f23497bb68e65db98d.1743481539.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503280703.OARM8SrY-lkp@intel.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/include/asm/stacktrace.h
arch/loongarch/include/asm/unwind_hints.h