Bug 117621 - Support for unaligned watchpoints
Summary: Support for unaligned watchpoints
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: ARM (show other bugs)
Hardware: ARM Linux
: P1 enhancement
Assignee: linux-arm-kernel@lists.arm.linux.org.uk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-04 10:47 UTC by Pavel Labath
Modified: 2016-05-26 15:42 UTC (History)
0 users

See Also:
Kernel Version: All of them
Subsystem:
Regression: No
Bisected commit-id:


Attachments
A test program demonstrating the issue. (1.82 KB, text/x-csrc)
2016-05-26 15:42 UTC, Pavel Labath
Details

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

Note You need to log in before you can comment on or make changes to this bug.