Skip to contentSkip to conversation

x86/debug changes for v3.11

GIT PULL Ingo Molnar 1 participant 1 message Jul 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-debug-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-debug-for-linus

HEAD: 13bfd47a0ef68fc8b21e67873dbdf269c7db6b59 x86/tboot: Provide debugfs interfaces to access TXT log

Misc debuggability improvements:

- Optimize the x86 CPU register printout a bit

- Expose the tboot TXT log via debugfs

- Small do_debug() cleanup

Thanks,

Ingo

------------------>
Dave Jones (1):
x86/debug: Only print out DR registers if they are not power-on defaults

Qiaowei Ren (1):
x86/tboot: Provide debugfs interfaces to access TXT log

Rusty Russell (1):
x86: Remove weird PTR_ERR() in do_debug

 arch/x86/kernel/process_32.c | 11 +++++--
 arch/x86/kernel/process_64.c |  9 +++++-
 arch/x86/kernel/tboot.c      | 73 ++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/traps.c      |  2 +-
 4 files changed, 90 insertions(+), 5 deletions(-)
arch/x86/kernel/process_32.c +8 -3
index 7305f7d..f84cfd1 100644
@@ -110,11 +110,16 @@ void __show_regs(struct pt_regs *regs, int all)
 	get_debugreg(d1, 1);
 	get_debugreg(d2, 2);
 	get_debugreg(d3, 3);
-	printk(KERN_DEFAULT "DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
-			d0, d1, d2, d3);
-
 	get_debugreg(d6, 6);
 	get_debugreg(d7, 7);
+
+	/* Only print out debug registers if they are in their non-default state. */
+	if ((d0 == 0) && (d1 == 0) && (d2 == 0) && (d3 == 0) &&
+	    (d6 == DR6_RESERVED) && (d7 == 0x400))
+		return;
+
+	printk(KERN_DEFAULT "DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
+			d0, d1, d2, d3);
 	printk(KERN_DEFAULT "DR6: %08lx DR7: %08lx\n",
 			d6, d7);
 }
arch/x86/kernel/process_64.c +8 -1
index 355ae06..a8b9abc 100644
@@ -105,11 +105,18 @@ void __show_regs(struct pt_regs *regs, int all)
 	get_debugreg(d0, 0);
 	get_debugreg(d1, 1);
 	get_debugreg(d2, 2);
-	printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
 	get_debugreg(d3, 3);
 	get_debugreg(d6, 6);
 	get_debugreg(d7, 7);
+
+	/* Only print out debug registers if they are in their non-default state. */
+	if ((d0 == 0) && (d1 == 0) && (d2 == 0) && (d3 == 0) &&
+	    (d6 == DR6_RESERVED) && (d7 == 0x400))
+		return;
+
+	printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
 	printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
+
 }
 
 void release_thread(struct task_struct *dead_task)
arch/x86/kernel/tboot.c +73 -0

91 lines not on this page · raw message

arch/x86/kernel/traps.c +1 -1
index 772e2a8..9340dfb 100644
@@ -437,7 +437,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
 	/* Store the virtualized DR6 value */
 	tsk->thread.debugreg6 = dr6;
 
-	if (notify_die(DIE_DEBUG, "debug", regs, PTR_ERR(&dr6), error_code,
+	if (notify_die(DIE_DEBUG, "debug", regs, (long)&dr6, error_code,
 							SIGTRAP) == NOTIFY_STOP)
 		goto exit;