[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H7yLgM7WAnubjkBx27E7UUTpMC+x93y=t6YkcEWBafFGQ@mail.gmail.com>
Date: Fri, 9 Jun 2023 10:04:13 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Qing Zhang <zhangqing@...ngson.cn>
Cc: WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, Colin King <colin.i.king@...il.com>
Subject: Re: [PATCH] LoongArch: Avoid uninitialized alignment_mask
Queued, thanks.
Huacai
On Thu, Jun 8, 2023 at 9:02 PM Qing Zhang <zhangqing@...ngson.cn> wrote:
>
> The hardware monitoring points for instruction fetching and
> load/store operations need to align 4 bytes or 1/2/4/8 bytes respectively.
>
> Reported-by: Colin King <colin.i.king@...il.com>
> Signed-off-by: Qing Zhang <zhangqing@...ngson.cn>
> ---
> arch/loongarch/kernel/hw_breakpoint.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/loongarch/kernel/hw_breakpoint.c b/arch/loongarch/kernel/hw_breakpoint.c
> index 2406c95b34cc..021b59c248fa 100644
> --- a/arch/loongarch/kernel/hw_breakpoint.c
> +++ b/arch/loongarch/kernel/hw_breakpoint.c
> @@ -396,6 +396,8 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
>
> if (hw->ctrl.type != LOONGARCH_BREAKPOINT_EXECUTE)
> alignment_mask = 0x7;
> + else
> + alignment_mask = 0x3;
> offset = hw->address & alignment_mask;
>
> hw->address &= ~alignment_mask;
> --
> 2.20.1
>
>
Powered by blists - more mailing lists