Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/interrupt: Do not call single_step_exception() from other exceptions

single_step_exception() is called by emulate_single_step() which
is called from (at least) alignment exception() handler and
program_check_exception() handler.

Redefine it as a regular __single_step_exception() which is called
by both single_step_exception() handler and emulate_single_step()
function.

Fixes: 3a96570ffceb ("powerpc: convert interrupt handlers to use wrappers")
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/aed174f5cbc06f2cf95233c071d8aac948e46043.1628611921.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
01fcac8e 98694166

+7 -2
+7 -2
arch/powerpc/kernel/traps.c
··· 1104 1104 _exception(SIGTRAP, regs, TRAP_UNK, 0); 1105 1105 } 1106 1106 1107 - DEFINE_INTERRUPT_HANDLER(single_step_exception) 1107 + static void __single_step_exception(struct pt_regs *regs) 1108 1108 { 1109 1109 clear_single_step(regs); 1110 1110 clear_br_trace(regs); ··· 1121 1121 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); 1122 1122 } 1123 1123 1124 + DEFINE_INTERRUPT_HANDLER(single_step_exception) 1125 + { 1126 + __single_step_exception(regs); 1127 + } 1128 + 1124 1129 /* 1125 1130 * After we have successfully emulated an instruction, we have to 1126 1131 * check if the instruction was being single-stepped, and if so, ··· 1135 1130 static void emulate_single_step(struct pt_regs *regs) 1136 1131 { 1137 1132 if (single_stepping(regs)) 1138 - single_step_exception(regs); 1133 + __single_step_exception(regs); 1139 1134 } 1140 1135 1141 1136 static inline int __parse_fpscr(unsigned long fpscr)