projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9623691
)
LoongArch: Avoid uninitialized alignment_mask
author
Qing Zhang
<zhangqing@loongson.cn>
Thu, 15 Jun 2023 06:35:52 +0000
(14:35 +0800)
committer
Huacai Chen
<chenhuacai@loongson.cn>
Thu, 15 Jun 2023 06:35:52 +0000
(14:35 +0800)
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>
arch/loongarch/kernel/hw_breakpoint.c
patch
|
blob
|
history
diff --git
a/arch/loongarch/kernel/hw_breakpoint.c
b/arch/loongarch/kernel/hw_breakpoint.c
index 2406c95b34cc4f0023f1db8755e60ff7ea0cc18a..021b59c248fac64413ad70a5387ee7a3f698b92d 100644
(file)
--- 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;