[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3698088e-fe00-227e-f15f-ee394735a9a5@linux.ibm.com>
Date: Thu, 17 Sep 2020 10:26:07 -0300
From: Rogerio Alves <rcardoso@...ux.ibm.com>
To: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>, mpe@...erman.id.au,
christophe.leroy@....fr
Cc: mikey@...ling.org, jniethe5@...il.com, pedromfc@...ux.ibm.com,
linux-kernel@...r.kernel.org, paulus@...ba.org,
rogealve@...ux.ibm.com, naveen.n.rao@...ux.vnet.ibm.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v6 6/8] powerpc/watchpoint: Add hw_len wherever missing
On 9/2/20 1:29 AM, Ravi Bangoria wrote:
> There are couple of places where we set len but not hw_len. For
> ptrace/perf watchpoints, when CONFIG_HAVE_HW_BREAKPOINT=Y, hw_len
> will be calculated and set internally while parsing watchpoint.
> But when CONFIG_HAVE_HW_BREAKPOINT=N, we need to manually set
> 'hw_len'. Similarly for xmon as well, hw_len needs to be set
> directly.
>
> Fixes: b57aeab811db ("powerpc/watchpoint: Fix length calculation for unaligned target")
> Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Tested-by: Rogerio Alves <rcardoso@...ux.ibm.com>
> ---
> arch/powerpc/kernel/ptrace/ptrace-noadv.c | 1 +
> arch/powerpc/xmon/xmon.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kernel/ptrace/ptrace-noadv.c b/arch/powerpc/kernel/ptrace/ptrace-noadv.c
> index c9122ed91340..48c52426af80 100644
> --- a/arch/powerpc/kernel/ptrace/ptrace-noadv.c
> +++ b/arch/powerpc/kernel/ptrace/ptrace-noadv.c
> @@ -219,6 +219,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf
> brk.address = ALIGN_DOWN(bp_info->addr, HW_BREAKPOINT_SIZE);
> brk.type = HW_BRK_TYPE_TRANSLATE | HW_BRK_TYPE_PRIV_ALL;
> brk.len = DABR_MAX_LEN;
> + brk.hw_len = DABR_MAX_LEN;
> if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
> brk.type |= HW_BRK_TYPE_READ;
> if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index df7bca00f5ec..55c43a6c9111 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -969,6 +969,7 @@ static void insert_cpu_bpts(void)
> brk.address = dabr[i].address;
> brk.type = (dabr[i].enabled & HW_BRK_TYPE_DABR) | HW_BRK_TYPE_PRIV_ALL;
> brk.len = 8;
> + brk.hw_len = 8;
> __set_breakpoint(i, &brk);
> }
> }
>
Powered by blists - more mailing lists