diff options
author | K.Prasad <prasad@linux.vnet.ibm.com> | 2010-06-15 02:05:31 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2010-06-22 05:40:50 -0400 |
commit | 2538c2d08f46141550a1e68819efa8fe31c6e3dc (patch) | |
tree | c84255fa8dbc9446d4ff546988adabc12450b880 | |
parent | 5aae8a53708025d4e718f0d2e7c2f766779ddc71 (diff) |
powerpc, hw_breakpoint: Handle concurrent alignment interrupts
If an alignment interrupt occurs on an instruction that is being
single-stepped, the alignment interrupt handler currently handles
the single-step condition by unconditionally sending a SIGTRAP to
the process. Other synchronous interrupts that result in the
instruction being emulated do likewise.
With hw_breakpoint support, the hw_breakpoint code needs to be able
to intercept these single-step events as well as those where the
instruction executes normally and a trace interrupt happens.
Fix this by making emulate_single_step() use the existing
single_step_exception() function instead of calling _exception()
directly. We then make single_step_exception() use the abstracted
clear_single_step() rather than clearing bits in the MSR image
directly so that emulate_single_step() will continue to work
correctly on Book 3E processors.
Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/traps.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 25fc33984c2b..e5fe5a8522a6 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -688,7 +688,7 @@ void RunModeException(struct pt_regs *regs) | |||
688 | 688 | ||
689 | void __kprobes single_step_exception(struct pt_regs *regs) | 689 | void __kprobes single_step_exception(struct pt_regs *regs) |
690 | { | 690 | { |
691 | regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */ | 691 | clear_single_step(regs); |
692 | 692 | ||
693 | if (notify_die(DIE_SSTEP, "single_step", regs, 5, | 693 | if (notify_die(DIE_SSTEP, "single_step", regs, 5, |
694 | 5, SIGTRAP) == NOTIFY_STOP) | 694 | 5, SIGTRAP) == NOTIFY_STOP) |
@@ -707,10 +707,8 @@ void __kprobes single_step_exception(struct pt_regs *regs) | |||
707 | */ | 707 | */ |
708 | static void emulate_single_step(struct pt_regs *regs) | 708 | static void emulate_single_step(struct pt_regs *regs) |
709 | { | 709 | { |
710 | if (single_stepping(regs)) { | 710 | if (single_stepping(regs)) |
711 | clear_single_step(regs); | 711 | single_step_exception(regs); |
712 | _exception(SIGTRAP, regs, TRAP_TRACE, 0); | ||
713 | } | ||
714 | } | 712 | } |
715 | 713 | ||
716 | static inline int __parse_fpscr(unsigned long fpscr) | 714 | static inline int __parse_fpscr(unsigned long fpscr) |