Skip to content

Commit e71ab66

Browse files
Peter Zijlstrajfvogel
Peter Zijlstra
authored andcommitted
loongarch: Use ASM_REACHABLE
commit 624bde3 upstream. annotate_reachable() is unreliable since the compiler is free to place random code inbetween two consecutive asm() statements. This removes the last and only annotate_reachable() user. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Closes: https://lore.kernel.org/loongarch/[email protected]/ Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3c0369e453ffc4b1d240c81043467ac7ccc6bb6f) Signed-off-by: Jack Vogel <[email protected]>
1 parent 4c15a25 commit e71ab66

File tree

1 file changed

+7
-6
lines changed
  • arch/loongarch/include/asm

1 file changed

+7
-6
lines changed

arch/loongarch/include/asm/bug.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <asm/break.h>
66
#include <linux/stringify.h>
7+
#include <linux/objtool.h>
78

89
#ifndef CONFIG_DEBUG_BUGVERBOSE
910
#define _BUGVERBOSE_LOCATION(file, line)
@@ -33,25 +34,25 @@
3334

3435
#define ASM_BUG_FLAGS(flags) \
3536
__BUG_ENTRY(flags) \
36-
break BRK_BUG
37+
break BRK_BUG;
3738

3839
#define ASM_BUG() ASM_BUG_FLAGS(0)
3940

40-
#define __BUG_FLAGS(flags) \
41-
asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)));
41+
#define __BUG_FLAGS(flags, extra) \
42+
asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \
43+
extra);
4244

4345
#define __WARN_FLAGS(flags) \
4446
do { \
4547
instrumentation_begin(); \
46-
__BUG_FLAGS(BUGFLAG_WARNING|(flags)); \
47-
annotate_reachable(); \
48+
__BUG_FLAGS(BUGFLAG_WARNING|(flags), ASM_REACHABLE); \
4849
instrumentation_end(); \
4950
} while (0)
5051

5152
#define BUG() \
5253
do { \
5354
instrumentation_begin(); \
54-
__BUG_FLAGS(0); \
55+
__BUG_FLAGS(0, ""); \
5556
unreachable(); \
5657
} while (0)
5758

0 commit comments

Comments
 (0)