]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
objtool/LoongArch: Mark special atomic instruction as INSN_BUG type
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 18 Sep 2025 11:43:36 +0000 (19:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:13:45 +0000 (11:13 +0200)
commitb6f29fa5f60367d91e606db64c12e7086423c2d5
tree574ddbb7942c0b9eaa4ab5f41756df8e79ed7a99
parent89d40cc647daf6ed0dcdaae5b2892b10c361579d
objtool/LoongArch: Mark special atomic instruction as INSN_BUG type

commit 539d7344d4feaea37e05863e9aa86bd31f28e46f upstream.

When compiling with LLVM and CONFIG_RUST is set, there exists the
following objtool warning:

  rust/compiler_builtins.o: warning: objtool: __rust__unordsf2(): unexpected end of section .text.unlikely.

objdump shows that the end of section .text.unlikely is an atomic
instruction:

  amswap.w        $zero, $ra, $zero

According to the LoongArch Reference Manual, if the amswap.w atomic
memory access instruction has the same register number as rd and rj,
the execution will trigger an Instruction Non-defined Exception, so
mark the above instruction as INSN_BUG type to fix the warning.

Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/arch/loongarch/include/asm/inst.h
tools/objtool/arch/loongarch/decode.c