Skip to content

Commit e08658a

Browse files
Ravi Bangoriampe
Ravi Bangoria
authored andcommitted
powerpc/watchpoint: Don't call dar_within_range() for Book3S
DAR is set to the first byte of overlap between actual access and watched range at DSI on Book3S processor. But actual access range might or might not be within user asked range. So for Book3S, it must not call dar_within_range(). This revert portion of commit 39413ae ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size."). Before patch: # ./tools/testing/selftests/powerpc/ptrace/perf-hwbreak ... TESTED: No overlap FAILED: Partial overlap: 0 != 2 TESTED: Partial overlap TESTED: No overlap FAILED: Full overlap: 0 != 2 failure: perf_hwbreak After patch: TESTED: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Fixes: 39413ae ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.") Reported-by: Michael Ellerman <[email protected]> Signed-off-by: Ravi Bangoria <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9eb425b commit e08658a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

arch/powerpc/kernel/hw_breakpoint.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args)
331331
}
332332

333333
info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ;
334-
if (!dar_within_range(regs->dar, info))
335-
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
336-
337-
if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info))
338-
goto out;
334+
if (IS_ENABLED(CONFIG_PPC_8xx)) {
335+
if (!dar_within_range(regs->dar, info))
336+
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
337+
} else {
338+
if (!stepping_handler(regs, bp, info))
339+
goto out;
340+
}
339341

340342
/*
341343
* As a policy, the callback is invoked in a 'trigger-after-execute'

0 commit comments

Comments
 (0)