Skip to content

Commit 01fcac8

Browse files
chleroympe
authored andcommitted
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: 3a96570 ("powerpc: convert interrupt handlers to use wrappers") Cc: [email protected] # v5.12+ Signed-off-by: Christophe Leroy <[email protected]> Reviewed-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/aed174f5cbc06f2cf95233c071d8aac948e46043.1628611921.git.christophe.leroy@csgroup.eu
1 parent 9869416 commit 01fcac8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/powerpc/kernel/traps.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ DEFINE_INTERRUPT_HANDLER(RunModeException)
11041104
_exception(SIGTRAP, regs, TRAP_UNK, 0);
11051105
}
11061106

1107-
DEFINE_INTERRUPT_HANDLER(single_step_exception)
1107+
static void __single_step_exception(struct pt_regs *regs)
11081108
{
11091109
clear_single_step(regs);
11101110
clear_br_trace(regs);
@@ -1121,6 +1121,11 @@ DEFINE_INTERRUPT_HANDLER(single_step_exception)
11211121
_exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
11221122
}
11231123

1124+
DEFINE_INTERRUPT_HANDLER(single_step_exception)
1125+
{
1126+
__single_step_exception(regs);
1127+
}
1128+
11241129
/*
11251130
* After we have successfully emulated an instruction, we have to
11261131
* check if the instruction was being single-stepped, and if so,
@@ -1130,7 +1135,7 @@ DEFINE_INTERRUPT_HANDLER(single_step_exception)
11301135
static void emulate_single_step(struct pt_regs *regs)
11311136
{
11321137
if (single_stepping(regs))
1133-
single_step_exception(regs);
1138+
__single_step_exception(regs);
11341139
}
11351140

11361141
static inline int __parse_fpscr(unsigned long fpscr)

0 commit comments

Comments
 (0)