[RFC,v1,12/23] LoongArch: bug: Add reachable annotation to warning macros

Message ID 1687247415-32057-3-git-send-email-tangyouling@loongson.cn
State New
Headers
Series LoongArch: Add objtool and ORC unwinder support |

Commit Message

Youling Tang June 20, 2023, 7:50 a.m. UTC
  WARN* and BUG* both use `break 0x1` opcodes and the distinction is
provided by the contents of the bug table. This table is not accessible
to objtool, so add an annotation to WARN* macros to let objtool know
that break handler will return an resume the execution of the instructions
following the WARN's break.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
 arch/loongarch/include/asm/bug.h | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/bug.h
index d4ca3ba25418..08388876ade4 100644
--- a/arch/loongarch/include/asm/bug.h
+++ b/arch/loongarch/include/asm/bug.h
@@ -44,6 +44,7 @@ 
 do {								\
 	instrumentation_begin();				\
 	__BUG_FLAGS(BUGFLAG_WARNING|(flags));			\
+	annotate_reachable();					\
 	instrumentation_end();					\
 } while (0)