Skip to contentSkip to conversation

Fix kprobes breakpoint handling.

S390 Martin Schwidefsky 1 participant 1 message Jan 26, 2007 s390

lore
Share & tools
lore
#0 lore raw

From: Heiko Carstens <[email protected]>

[S390] Fix kprobes breakpoint handling.

In case of an illegal op the die notifier gets called with DIE_TRAP instead of DIE_BPT first.

---

 arch/s390/kernel/traps.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
arch/s390/kernel/traps.c +9 -2
diff -urpN linux-2.6/arch/s390/kernel/traps.c linux-2.6-patched/arch/s390/kernel/traps.c
@@ -490,8 +490,15 @@ static void illegal_op(struct pt_regs * 
 #endif
 		} else
 			signal = SIGILL;
-	} else
-		signal = SIGILL;
+	} else {
+		/*
+		 * If we get an illegal op in kernel mode, send it through the
+		 * kprobes notifier. If kprobes doesn't pick it up, SIGILL
+		 */
+		if (notify_die(DIE_BPT, "bpt", regs, interruption_code,
+			       3, SIGTRAP) != NOTIFY_STOP)
+			signal = SIGILL;
+	}
 
 #ifdef CONFIG_MATHEMU
         if (signal == SIGFPE)