[PATCH 2/2] kprobes: remove spurious MSR_SE masking

Ananth N Mavinakayanahalli ananth at in.ibm.com
Sat May 28 01:43:32 EST 2005


Hi,

single_step_exception() masks MSR_SE upon entry. We don't have to do it
again during kprobe post processing.

This also will help applications like itrace that'd want to single-step
more than once, after a kprobe hit.

Regards,
Ananth

Remove spurious MSR_SE reset during kprobe processing. single_step_exception()
already does it for us. Reset it to be safe when executing the fault_handler.

Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>

 arch/ppc64/kernel/kprobes.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.12-rc5/arch/ppc64/kernel/kprobes.c
===================================================================
--- linux-2.6.12-rc5.orig/arch/ppc64/kernel/kprobes.c	2005-05-27 14:40:42.000000000 -0400
+++ linux-2.6.12-rc5/arch/ppc64/kernel/kprobes.c	2005-05-27 14:50:38.000000000 -0400
@@ -214,8 +214,6 @@ static void resume_execution(struct kpro
 	ret = emulate_step(regs, p->ainsn.insn[0]);
 	if (ret == 0)
 		regs->nip = (unsigned long)p->addr + 4;
-
-	regs->msr &= ~MSR_SE;
 }
 
 static inline int post_kprobe_handler(struct pt_regs *regs)
@@ -260,6 +258,7 @@ static inline int kprobe_fault_handler(s
 
 	if (kprobe_status & KPROBE_HIT_SS) {
 		resume_execution(current_kprobe, regs);
+		regs->msr &= ~MSR_SE;
 		regs->msr |= kprobe_saved_msr;
 
 		unlock_kprobes();



More information about the Linuxppc64-dev mailing list