diff options
author | K.Prasad <prasad@linux.vnet.ibm.com> | 2009-06-01 14:17:06 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-06-02 16:47:00 -0400 |
commit | 62edab9056a6cf0c9207339c8892c923a5217e45 (patch) | |
tree | 2becd775fdc2a25df3daacf69d80685b251fbed9 /arch/x86/kernel/kprobes.c | |
parent | 0722db015c246204044299eae3b02d18d3ca4faf (diff) |
hw-breakpoints: reset bits in dr6 after the corresponding exception is handled
This patch resets the bit in dr6 after the corresponding exception is
handled in code, so that we keep a clean track of the current virtual debug
status register.
[ Impact: keep track of breakpoints triggering completion ]
Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch/x86/kernel/kprobes.c')
-rw-r--r-- | arch/x86/kernel/kprobes.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index 7b5169d2b000..b5b1848c5336 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <asm/pgtable.h> | 54 | #include <asm/pgtable.h> |
55 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
56 | #include <asm/alternative.h> | 56 | #include <asm/alternative.h> |
57 | #include <asm/debugreg.h> | ||
57 | 58 | ||
58 | void jprobe_return_end(void); | 59 | void jprobe_return_end(void); |
59 | 60 | ||
@@ -967,8 +968,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
967 | ret = NOTIFY_STOP; | 968 | ret = NOTIFY_STOP; |
968 | break; | 969 | break; |
969 | case DIE_DEBUG: | 970 | case DIE_DEBUG: |
970 | if (post_kprobe_handler(args->regs)) | 971 | if (post_kprobe_handler(args->regs)) { |
972 | /* | ||
973 | * Reset the BS bit in dr6 (pointed by args->err) to | ||
974 | * denote completion of processing | ||
975 | */ | ||
976 | (*(unsigned long *)ERR_PTR(args->err)) &= ~DR_STEP; | ||
971 | ret = NOTIFY_STOP; | 977 | ret = NOTIFY_STOP; |
978 | } | ||
972 | break; | 979 | break; |
973 | case DIE_GPF: | 980 | case DIE_GPF: |
974 | /* | 981 | /* |