]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/watchpoint: Prepare handler to handle more than one watchpoint
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>
Thu, 14 May 2020 11:17:38 +0000 (16:47 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 May 2020 14:14:37 +0000 (00:14 +1000)
commit566d56589d91defb4f49eccaf1828d25405a7b6a
treebcc0e89c4e3c86721f6b2c73003ac78ba8170814
parent85ac2a9c8648b3e6cb8a2b10c5742d8aa6be7d6b
powerpc/watchpoint: Prepare handler to handle more than one watchpoint

Currently we assume that we have only one watchpoint supported by hw.
Get rid of that assumption and use dynamic loop instead. This should
make supporting more watchpoints very easy.

With more than one watchpoint, exception handler needs to know which
DAWR caused the exception, and hw currently does not provide it. So
we need sw logic for the same. To figure out which DAWR caused the
exception, check all different combinations of user specified range,
DAWR address range, actual access range and DAWRX constrains. For ex,
if user specified range and actual access range overlaps but DAWRX is
configured for readonly watchpoint and the instruction is store, this
DAWR must not have caused exception.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Reviewed-by: Michael Neuling <mikey@neuling.org>
[mpe: Unsplit multi-line printk() strings, fix some sparse warnings]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200514111741.97993-14-ravi.bangoria@linux.ibm.com
arch/powerpc/include/asm/processor.h
arch/powerpc/include/asm/sstep.h
arch/powerpc/kernel/hw_breakpoint.c
arch/powerpc/kernel/process.c