Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7497/1: hw_breakpoint: allow single-byte watchpoints on all addresses

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 <Ulrich.Weigand@de.ibm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Will Deacon and committed by
Russell King
d968d2b8 bf880114

+4 -3
+4 -3
arch/arm/kernel/hw_breakpoint.c
··· 610 610 /* Aligned */ 611 611 break; 612 612 case 1: 613 - /* Allow single byte watchpoint. */ 614 - if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) 615 - break; 616 613 case 2: 617 614 /* Allow halfword watchpoints and breakpoints. */ 618 615 if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) 616 + break; 617 + case 3: 618 + /* Allow single byte watchpoint. */ 619 + if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) 619 620 break; 620 621 default: 621 622 ret = -EINVAL;