[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <24260.1352235206@neuling.org>
Date: Wed, 07 Nov 2012 07:53:26 +1100
From: Michael Neuling <mikey@...ling.org>
To: Aravinda Prasad <aravinda@...ux.vnet.ibm.com>
cc: linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org,
fweisbec@...hat.com, benh@...nel.crashing.org
Subject: Re: [PATCH] Enable hardware breakpoint upon re-registering
Aravinda Prasad <aravinda@...ux.vnet.ibm.com> wrote:
> On powerpc, ptrace will disable hardware breakpoint request once the
> breakpoint is hit. It is the responsibility of the caller to set it
> again. However, when the caller sets the hardware breakpoint again
> using ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, addr), the hardware
> breakpoint is not enabled.
>
> While gdb's approach is to unregister and re-register the hardware
> breakpoint every time the breakpoint is hit - which is working fine,
> this could affect other programs trying to re-register hardware
> breakpoint without unregistering.
>
> This patch enables hardware breakpoint if the caller is re-registering.
>
> Signed-off-by: Aravinda Prasad <aravinda@...ux.vnet.ibm.com>
Passes my tests here and I don't think it'll break existing gdb. So FWIW
Acked-by: Michael Neuling <mikey@...ling.org>
Thanks!
> ---
> arch/powerpc/kernel/ptrace.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index 79d8e56..09371d0 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -952,6 +952,10 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
> arch_bp_generic_fields(data &
> (DABR_DATA_WRITE | DABR_DATA_READ),
> &attr.bp_type);
> +
> + /* Enable breakpoint */
> + attr.disabled = false;
> +
> ret = modify_user_hw_breakpoint(bp, &attr);
> if (ret) {
> ptrace_put_breakpoints(task);
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@...ts.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
--
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