Patchwork [v2,2/3] powerpc: Bail out of KGDB when we've been triggered

login
register
mail settings
Submitter Tiejun Chen
Date Aug. 23, 2012, 2:10 a.m.
Message ID <1345687820-5248-2-git-send-email-tiejun.chen@windriver.com>
Download mbox | patch
Permalink /patch/179482/
State Accepted, archived
Commit 949616cf2d3095d1bb6b3d155c1cc963abd98b5c
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Tiejun Chen - Aug. 23, 2012, 2:10 a.m.
We need to skip a breakpoint exception when it occurs after
a breakpoint has already been removed.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
v2: simply kgdb_skipexception() return path. 

 arch/powerpc/kernel/kgdb.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index bbabc5a..05adb69 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -101,6 +101,21 @@  static int computeSignal(unsigned int tt)
 	return SIGHUP;		/* default for things we don't know about */
 }
 
+/**
+ *
+ *	kgdb_skipexception - Bail out of KGDB when we've been triggered.
+ *	@exception: Exception vector number
+ *	@regs: Current &struct pt_regs.
+ *
+ *	On some architectures we need to skip a breakpoint exception when
+ *	it occurs after a breakpoint has been removed.
+ *
+ */
+int kgdb_skipexception(int exception, struct pt_regs *regs)
+{
+	return kgdb_isremovedbreak(regs->nip);
+}
+
 static int kgdb_call_nmi_hook(struct pt_regs *regs)
 {
 	kgdb_nmicallback(raw_smp_processor_id(), regs);