From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qing Zhang <zhangqing@loongson.cn>,
Colin King <colin.i.king@gmail.com>,
Huacai Chen <chenhuacai@loongson.cn>,
Sasha Levin <sashal@kernel.org>,
chenhuacai@kernel.org, loongarch@lists.linux.dev
Subject: [PATCH AUTOSEL 6.3 15/16] LoongArch: Avoid uninitialized alignment_mask
Date: Mon, 26 Jun 2023 17:49:55 -0400 [thread overview]
Message-ID: <20230626214956.178942-15-sashal@kernel.org> (raw)
In-Reply-To: <20230626214956.178942-1-sashal@kernel.org>
From: Qing Zhang <zhangqing@loongson.cn>
[ Upstream commit 0246d0aaf0a634a65135050011767b56ba351a8f ]
The hardware monitoring points for instruction fetching and load/store
operations need to align 4 bytes and 1/2/4/8 bytes respectively.
Reported-by: Colin King <colin.i.king@gmail.com>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 2406c95b34cc4..021b59c248fac 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.39.2
prev parent reply other threads:[~2023-06-26 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230626214956.178942-1-sashal@kernel.org>
2023-06-26 21:49 ` [PATCH AUTOSEL 6.3 13/16] LoongArch: Let pmd_present() return true when splitting pmd Sasha Levin
2023-06-26 21:49 ` [PATCH AUTOSEL 6.3 14/16] LoongArch: Fix the write_fcsr() macro Sasha Levin
2023-06-26 21:49 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230626214956.178942-15-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=colin.i.king@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=zhangqing@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).