powerpc/xmon: Enable HW instruction breakpoint on POWER8
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Fri, 28 Nov 2014 04:36:42 +0000 (10:06 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 2 Dec 2014 03:23:04 +0000 (14:23 +1100)
commit1ad7d70562eeb14df8b6d3e1a0a56f1bdfb990f7
tree35c8d05d77552e4baf4abce3dd345da946d3cc66
parentb5be75d00833a3f0ff76b1d7473119be33367faa
powerpc/xmon: Enable HW instruction breakpoint on POWER8

This patch enables support for hardware instruction breakpoint in xmon
on POWER8 platform with the help of a new register called the CIABR
(Completed Instruction Address Breakpoint Register). With this patch, a
single hardware instruction breakpoint can be added and cleared during
any active xmon debug session. The hardware based instruction breakpoint
mechanism works correctly with the existing TRAP based instruction
breakpoint available on xmon.

There are no powerpc CPU with CPU_FTR_IABR feature any more. This patch
has re-purposed all the existing IABR related code to work with CIABR
register based HW instruction breakpoint.

This has one odd feature, which is that when we hit a breakpoint xmon
doesn't tell us we have hit the breakpoint. This is because xmon is
expecting bp->address == regs->nip. Because CIABR fires on completition
regs->nip points to the instruction after the breakpoint. We could fix
that, but it would then confuse other parts of the xmon code which think
we need to emulate the instruction. [mpe]

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
arch/powerpc/xmon/xmon.c