Thread (2 messages) flat view 2 messages, 1 author, 2012-08-07
DORMANTno replies

[PATCH 2/2] ARM: hw_breakpoints: allow single-byte watchpoints on all addresses

From: Will Deacon <hidden>
Date: 2012-08-07 15:49:48
Subsystem: arm pmu profiling and debugging, arm port, the rest · Maintainers: Will Deacon, Mark Rutland, Russell King, Linus Torvalds

Breakpoint validation currently fails for single-byte watchpoints on
addresses ending in 11b. There is no reason to forbid such a watchpoint,
so extend the validation code to allow it.

Cc: Ulrich Weigand <redacted>
Signed-off-by: Will Deacon <redacted>
---
 arch/arm/kernel/hw_breakpoint.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 418d980..4eedfde 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -610,13 +610,14 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
 		/* Aligned */
 		break;
 	case 1:
-		/* Allow single byte watchpoint. */
-		if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
-			break;
 	case 2:
 		/* Allow halfword watchpoints and breakpoints. */
 		if (info->ctrl.len == ARM_BREAKPOINT_LEN_2)
 			break;
+	case 3:
+		/* Allow single byte watchpoint. */
+		if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
+			break;
 	default:
 		ret = -EINVAL;
 		goto out;
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help