Skip to content

Commit aa6998b

Browse files
committed
ARM: hw_breakpoint: Workaround for Cortex-A12/A17
It seems Cortex-A12/A17 do not report report watchpoint hit address that matches the watchpoint set as ARM64. Add this workaround for pass Android 8+ CTS bionic ptrace watchpoint_imprecise. Change-Id: I22f08a081d1436931cbed4e8b340237799299737 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
1 parent c017662 commit aa6998b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

arch/arm/kernel/hw_breakpoint.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,20 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr,
725725

726726
/* Check if the watchpoint value matches. */
727727
val = read_wb_reg(ARM_BASE_WVR + i);
728+
/*
729+
* It seems Cortex-A12/A17 do not report report
730+
* watchpoint hit address that matches the watchpoint
731+
* set as ARM64.
732+
* Add this workaround for pass Android 8+ CTS
733+
* bionic ptrace watchpoint_imprecise.
734+
*/
735+
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A12) {
736+
unsigned long dist;
737+
738+
dist = val > addr ? val - addr : addr - val;
739+
if (dist > 8)
740+
goto unlock;
741+
} else
728742
if (val != (addr & ~alignment_mask))
729743
goto unlock;
730744

0 commit comments

Comments
 (0)