Skip to content

Commit 8b2da50

Browse files
Ravi Bangoriagregkh
authored andcommitted
powerpc/watchpoint: Add hw_len wherever missing
[ Upstream commit 58da598 ] 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: b57aeab ("powerpc/watchpoint: Fix length calculation for unaligned target") Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200902042945.129369-7-ravi.bangoria@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9abfdda commit 8b2da50

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

arch/powerpc/kernel/ptrace/ptrace-noadv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf
219219
brk.address = ALIGN_DOWN(bp_info->addr, HW_BREAKPOINT_SIZE);
220220
brk.type = HW_BRK_TYPE_TRANSLATE;
221221
brk.len = DABR_MAX_LEN;
222+
brk.hw_len = DABR_MAX_LEN;
222223
if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
223224
brk.type |= HW_BRK_TYPE_READ;
224225
if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)

arch/powerpc/xmon/xmon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ static void insert_cpu_bpts(void)
969969
brk.address = dabr[i].address;
970970
brk.type = (dabr[i].enabled & HW_BRK_TYPE_DABR) | HW_BRK_TYPE_PRIV_ALL;
971971
brk.len = 8;
972+
brk.hw_len = 8;
972973
__set_breakpoint(i, &brk);
973974
}
974975
}

0 commit comments

Comments
 (0)