From d12b029ac8e95bf6623e96cc12bca060f4f93d26 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Thu, 18 Feb 2010 18:24:18 +0100 Subject: [PATCH] --- yaml --- r: 180723 b: refs/heads/master c: 326264a02448b0ac51f78f178b78e830aa077a0b h: refs/heads/master i: 180721: 1c85544c1f80026d0943e05b20b47e7bbd7ae6d9 180719: 39195406873460ab340068a13b422d0823096c27 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/processor.h | 2 ++ trunk/arch/x86/kernel/ptrace.c | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f7fa85dc2e65..9dcfdb8ea974 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84d710926797a6e317e7e94654a3ccd771cfd8a3 +refs/heads/master: 326264a02448b0ac51f78f178b78e830aa077a0b diff --git a/trunk/arch/x86/include/asm/processor.h b/trunk/arch/x86/include/asm/processor.h index fc801bab1b3b..b753ea59703a 100644 --- a/trunk/arch/x86/include/asm/processor.h +++ b/trunk/arch/x86/include/asm/processor.h @@ -450,6 +450,8 @@ struct thread_struct { struct perf_event *ptrace_bps[HBP_NUM]; /* Debug status used for traps, single steps, etc... */ unsigned long debugreg6; + /* Keep track of the exact dr7 value set by the user */ + unsigned long ptrace_dr7; /* Fault info: */ unsigned long cr2; unsigned long trap_no; diff --git a/trunk/arch/x86/kernel/ptrace.c b/trunk/arch/x86/kernel/ptrace.c index 017d937639fe..0c1033d61e59 100644 --- a/trunk/arch/x86/kernel/ptrace.c +++ b/trunk/arch/x86/kernel/ptrace.c @@ -702,7 +702,7 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n) } else if (n == 6) { val = thread->debugreg6; } else if (n == 7) { - val = ptrace_get_dr7(thread->ptrace_bps); + val = thread->ptrace_dr7; } return val; } @@ -778,8 +778,11 @@ int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val) return rc; } /* All that's left is DR7 */ - if (n == 7) + if (n == 7) { rc = ptrace_write_dr7(tsk, val); + if (!rc) + thread->ptrace_dr7 = val; + } ret_path: return rc;