powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Wed, 2 Sep 2020 04:29:41 +0000 (09:59 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 15 Sep 2020 12:13:19 +0000 (22:13 +1000)
commitedc8dd99b29e4d705c45e2a3a6c01b096ee056db
treea4c11d255b80af1ef92b189c4a53b4c65ca7c113
parent9b6b7c680cc20971444d9f836e49fc98848bcd0a
powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c

Power10 hw has multiple DAWRs but hw doesn't tell which DAWR caused
the exception. So we have a sw logic to detect that in hw_breakpoint.c.
But hw_breakpoint.c gets compiled only with CONFIG_HAVE_HW_BREAKPOINT=Y.
Move DAWR detection logic outside of hw_breakpoint.c so that it can be
reused when CONFIG_HAVE_HW_BREAKPOINT is not set.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200902042945.129369-5-ravi.bangoria@linux.ibm.com
arch/powerpc/include/asm/hw_breakpoint.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/hw_breakpoint.c
arch/powerpc/kernel/hw_breakpoint_constraints.c [new file with mode: 0644]