mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 4/4] Fix kgdb/kdb to conform to int3 format
@ 2016-01-29 18:19 Jeffrey Merkey
  0 siblings, 0 replies; only message in thread
From: Jeffrey Merkey @ 2016-01-29 18:19 UTC (permalink / raw)
  To: hpa, jason.wessel, jeffmerkey, kgdb-bugreport, linux-kernel,
	mingo, tglx, x86

If a breakpoint is triggered under x86 with an int3 that
kdb does not know about, it will report it as a catastrophic
error rather than just assuming it was told to enter the debugger.

The macro that defines the kgdb breakpoint also needs to
conform to the newer gas format without the numbers.

Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
---
 arch/x86/include/asm/kgdb.h     | 2 +-
 kernel/debug/kdb/kdb_debugger.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/kgdb.h b/arch/x86/include/asm/kgdb.h
index 332f98c..e24908a 100644
--- a/arch/x86/include/asm/kgdb.h
+++ b/arch/x86/include/asm/kgdb.h
@@ -77,7 +77,7 @@ enum regnames {
 
 static inline void arch_kgdb_breakpoint(void)
 {
-	asm("   int $3");
+	asm volatile("int3");
 }
 #define BREAK_INSTR_SIZE	1
 #define CACHE_FLUSH_IS_SAFE	1
diff --git a/kernel/debug/kdb/kdb_debugger.c b/kernel/debug/kdb/kdb_debugger.c
index 15e1a7a..d9b944d 100644
--- a/kernel/debug/kdb/kdb_debugger.c
+++ b/kernel/debug/kdb/kdb_debugger.c
@@ -55,7 +55,7 @@ int kdb_stub(struct kgdb_state *ks)
 	int error = 0;
 	kdb_bp_t *bp;
 	unsigned long addr = kgdb_arch_pc(ks->ex_vector, ks->linux_regs);
-	kdb_reason_t reason = KDB_REASON_OOPS;
+	kdb_reason_t reason = KDB_REASON_KEYBOARD;
 	kdb_dbtrap_t db_result = KDB_DB_NOBPT;
 	int i;
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-29 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 18:19 [PATCH 4/4] Fix kgdb/kdb to conform to int3 format Jeffrey Merkey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®