]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/watchpoint: Fix 512 byte boundary limit
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Thu, 23 Jul 2020 09:08:04 +0000 (14:38 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 26 Jul 2020 13:34:18 +0000 (23:34 +1000)
commit45cef600cc6eaffebce57e95ee88213e24b17ad7
tree894e7d6cc52f24e580cb4cb1f92db0701fa7c552
parentf501932d56eb8d4909040f00acd6f8b33c8a7fe2
powerpc/watchpoint: Fix 512 byte boundary limit

Milton Miller reported that we are aligning start and end address to
wrong size SZ_512M. It should be SZ_512. Fix that.

While doing this change I also found a case where ALIGN() comparison
fails. Within a given aligned range, ALIGN() of two addresses does not
match when start address is pointing to the first byte and end address
is pointing to any other byte except the first one. But that's not true
for ALIGN_DOWN(). ALIGN_DOWN() of any two addresses within that range
will always point to the first byte. So use ALIGN_DOWN() instead of
ALIGN().

Fixes: 65d2e1f67088 ("powerpc/watchpoint: Use builtin ALIGN*() macros")
Reported-by: Milton Miller <miltonm@us.ibm.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Tested-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200723090813.303838-2-ravi.bangoria@linux.ibm.com
arch/powerpc/kernel/hw_breakpoint.c