Bug 117621

Summary: Support for unaligned watchpoints
Product: Platform Specific/Hardware Reporter: Pavel Labath (labath)
Component: ARMAssignee: linux-arm-kernel (linux-arm-kernel)
Status: NEW ---    
Severity: enhancement    
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: All of them Subsystem:
Regression: No Bisected commit-id:
Attachments: A test program demonstrating the issue.

Description Pavel Labath 2016-05-04 10:47:12 UTC
ARM hardware supports setting watchpoints on adresses which are not word-aligned. However, the current kernel implementation does not support this feature due to the need to convert the watchpoint data to a generic format. See arch_bp_generic_fields (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/hw_breakpoint.c#n347), which ignores any more complicated bit sequences.

It would be great if we could get unaligned watchpoints working as well.
Comment 1 Pavel Labath 2016-05-26 15:42:49 UTC
Created attachment 217691 [details]
A test program demonstrating the issue.

Output of the test program on my device is:
Setting address to fffc5470
Setting control to 00000031
Test 0 OK.
Setting address to fffc5470
Setting control to 00000051
ptrace.c:36: set_watchpoint: assertion "0 == ptrace(PTRACE_SETHBPREGS, child, -2, &control)" failed