arm64: compat: Allow single-byte watchpoints on all addresses
authorWill Deacon <will@kernel.org>
Mon, 29 Jul 2019 10:06:17 +0000 (11:06 +0100)
committerWill Deacon <will@kernel.org>
Mon, 29 Jul 2019 10:06:17 +0000 (11:06 +0100)
Commit d968d2b801d8 ("ARM: 7497/1: hw_breakpoint: allow single-byte
watchpoints on all addresses") changed the validation requirements for
hardware watchpoints on arch/arm/. Update our compat layer to implement
the same relaxation.

Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/hw_breakpoint.c

index dceb8452094876c58cfacf93f350292084c02998..67b3bae50b926549f2550e1d8ed3eba045192227 100644 (file)
@@ -536,13 +536,14 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
                        /* Aligned */
                        break;
                case 1:
-                       /* Allow single byte watchpoint. */
-                       if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
-                               break;
                case 2:
                        /* Allow halfword watchpoints and breakpoints. */
                        if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
                                break;
+               case 3:
+                       /* Allow single byte watchpoint. */
+                       if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
+                               break;
                default:
                        return -EINVAL;
                }