powerpc: Don't allow the use of EMIT_BUG_ENTRY with BUGFLAG_WARNING
Warnings in assembly must use EMIT_WARN_ENTRY in order to generate the necessary entry in exception table. Check in EMIT_BUG_ENTRY that flags don't include BUGFLAG_WARNING. This change avoids problems like the one fixed by commit fd1eaaaaa686 ("powerpc/64s: Use EMIT_WARN_ENTRY for SRR debug warnings"). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/ddcb422102a37eb45f57694c7ef0ec6187964dff.1644742951.git.christophe.leroy@csgroup.eu
This commit is contained in:
parent
5a72345e6a
commit
38a1756861
@ -11,7 +11,7 @@
|
|||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLY__
|
||||||
#include <asm/asm-offsets.h>
|
#include <asm/asm-offsets.h>
|
||||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||||
.macro EMIT_BUG_ENTRY addr,file,line,flags
|
.macro __EMIT_BUG_ENTRY addr,file,line,flags
|
||||||
.section __bug_table,"aw"
|
.section __bug_table,"aw"
|
||||||
5001: .4byte \addr - 5001b, 5002f - 5001b
|
5001: .4byte \addr - 5001b, 5002f - 5001b
|
||||||
.short \line, \flags
|
.short \line, \flags
|
||||||
@ -22,7 +22,7 @@
|
|||||||
.previous
|
.previous
|
||||||
.endm
|
.endm
|
||||||
#else
|
#else
|
||||||
.macro EMIT_BUG_ENTRY addr,file,line,flags
|
.macro __EMIT_BUG_ENTRY addr,file,line,flags
|
||||||
.section __bug_table,"aw"
|
.section __bug_table,"aw"
|
||||||
5001: .4byte \addr - 5001b
|
5001: .4byte \addr - 5001b
|
||||||
.short \flags
|
.short \flags
|
||||||
@ -33,7 +33,14 @@
|
|||||||
|
|
||||||
.macro EMIT_WARN_ENTRY addr,file,line,flags
|
.macro EMIT_WARN_ENTRY addr,file,line,flags
|
||||||
EX_TABLE(\addr,\addr+4)
|
EX_TABLE(\addr,\addr+4)
|
||||||
EMIT_BUG_ENTRY \addr,\file,\line,\flags
|
__EMIT_BUG_ENTRY \addr,\file,\line,\flags
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro EMIT_BUG_ENTRY addr,file,line,flags
|
||||||
|
.if \flags & 1 /* BUGFLAG_WARNING */
|
||||||
|
.err /* Use EMIT_WARN_ENTRY for warnings */
|
||||||
|
.endif
|
||||||
|
__EMIT_BUG_ENTRY \addr,\file,\line,\flags
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
#else /* !__ASSEMBLY__ */
|
#else /* !__ASSEMBLY__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user