[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-40f9249a73f6c251adea492b1c3d19d39e2a9bda@git.kernel.org>
Date: Fri, 29 Jan 2010 09:25:59 GMT
From: "tip-bot for K.Prasad" <prasad@...ux.vnet.ibm.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
stern@...land.harvard.edu, jan.kiszka@...mens.com,
fweisbec@...il.com, roland@...hat.com, tglx@...utronix.de,
prasad@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perf/core] x86/debug: Clear reserved bits of DR6 in do_debug()
Commit-ID: 40f9249a73f6c251adea492b1c3d19d39e2a9bda
Gitweb: http://git.kernel.org/tip/40f9249a73f6c251adea492b1c3d19d39e2a9bda
Author: K.Prasad <prasad@...ux.vnet.ibm.com>
AuthorDate: Thu, 28 Jan 2010 16:44:01 +0530
Committer: Frederic Weisbecker <fweisbec@...il.com>
CommitDate: Fri, 29 Jan 2010 02:26:10 +0100
x86/debug: Clear reserved bits of DR6 in do_debug()
Clear the reserved bits from the stored copy of debug status
register (DR6).
This will help easy bitwise operations such as quick testing
of a debug event origin.
Signed-off-by: K.Prasad <prasad@...ux.vnet.ibm.com>
Cc: Roland McGrath <roland@...hat.com>
Cc: Jan Kiszka <jan.kiszka@...mens.com>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: Ingo Molnar <mingo@...e.hu>
LKML-Reference: <20100128111401.GB13935@...ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
---
arch/x86/include/asm/debugreg.h | 3 +++
arch/x86/kernel/traps.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index 8240f76..b81002f 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -14,6 +14,9 @@
which debugging register was responsible for the trap. The other bits
are either reserved or not of interest to us. */
+/* Define reserved bits in DR6 which are always set to 1 */
+#define DR6_RESERVED (0xFFFF0FF0)
+
#define DR_TRAP0 (0x1) /* db0 */
#define DR_TRAP1 (0x2) /* db1 */
#define DR_TRAP2 (0x4) /* db2 */
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 3339917..1168e44 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -534,6 +534,9 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
get_debugreg(dr6, 6);
+ /* Filter out all the reserved bits which are preset to 1 */
+ dr6 &= ~DR6_RESERVED;
+
/* Catch kmemcheck conditions first of all! */
if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
return;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists