loongarch: Use ASM_REACHABLE
commit 624bde3465f660e54a7cd4c1efc3e536349fead5 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) <peterz@infradead.org> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://lore.kernel.org/r/20241128094312.133437051@infradead.org Closes: https://lore.kernel.org/loongarch/20250307214943.372210-1-ojeda@kernel.org/ Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4a442cd27b
commit
3c0369e453
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <asm/break.h>
|
#include <asm/break.h>
|
||||||
#include <linux/stringify.h>
|
#include <linux/stringify.h>
|
||||||
|
#include <linux/objtool.h>
|
||||||
|
|
||||||
#ifndef CONFIG_DEBUG_BUGVERBOSE
|
#ifndef CONFIG_DEBUG_BUGVERBOSE
|
||||||
#define _BUGVERBOSE_LOCATION(file, line)
|
#define _BUGVERBOSE_LOCATION(file, line)
|
||||||
@@ -33,25 +34,25 @@
|
|||||||
|
|
||||||
#define ASM_BUG_FLAGS(flags) \
|
#define ASM_BUG_FLAGS(flags) \
|
||||||
__BUG_ENTRY(flags) \
|
__BUG_ENTRY(flags) \
|
||||||
break BRK_BUG
|
break BRK_BUG;
|
||||||
|
|
||||||
#define ASM_BUG() ASM_BUG_FLAGS(0)
|
#define ASM_BUG() ASM_BUG_FLAGS(0)
|
||||||
|
|
||||||
#define __BUG_FLAGS(flags) \
|
#define __BUG_FLAGS(flags, extra) \
|
||||||
asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)));
|
asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \
|
||||||
|
extra);
|
||||||
|
|
||||||
#define __WARN_FLAGS(flags) \
|
#define __WARN_FLAGS(flags) \
|
||||||
do { \
|
do { \
|
||||||
instrumentation_begin(); \
|
instrumentation_begin(); \
|
||||||
__BUG_FLAGS(BUGFLAG_WARNING|(flags)); \
|
__BUG_FLAGS(BUGFLAG_WARNING|(flags), ASM_REACHABLE); \
|
||||||
annotate_reachable(); \
|
|
||||||
instrumentation_end(); \
|
instrumentation_end(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define BUG() \
|
#define BUG() \
|
||||||
do { \
|
do { \
|
||||||
instrumentation_begin(); \
|
instrumentation_begin(); \
|
||||||
__BUG_FLAGS(0); \
|
__BUG_FLAGS(0, ""); \
|
||||||
unreachable(); \
|
unreachable(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user