aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2013-07-01 00:19:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:20 -0400
commit3b743326ed2edd5e118950874f7bdaed5759f977 (patch)
tree278068b295a94d7acb9703bf37889b690d292ada /arch
parent277b5ae153a96d594ae6d61b244b936d6f77ff56 (diff)
powerpc/hw_brk: Fix off by one error when validating DAWR region end
commit e2a800beaca1f580945773e57d1a0e7cd37b1056 upstream. The Data Address Watchpoint Register (DAWR) on POWER8 can take a 512 byte range but this range must not cross a 512 byte boundary. Unfortunately we were off by one when calculating the end of the region, hence we were not allowing some breakpoint regions which were actually valid. This fixes this error. Signed-off-by: Michael Neuling <mikey@neuling.org> Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/hw_breakpoint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 1150ae7c22c3..f0b47d1a6b0e 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -176,7 +176,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
176 length_max = 512 ; /* 64 doublewords */ 176 length_max = 512 ; /* 64 doublewords */
177 /* DAWR region can't cross 512 boundary */ 177 /* DAWR region can't cross 512 boundary */
178 if ((bp->attr.bp_addr >> 10) != 178 if ((bp->attr.bp_addr >> 10) !=
179 ((bp->attr.bp_addr + bp->attr.bp_len) >> 10)) 179 ((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 10))
180 return -EINVAL; 180 return -EINVAL;
181 } 181 }
182 if (info->len > 182 if (info->len >