summaryrefslogtreecommitdiff
path: root/arch/powerpc/xmon/xmon_bpts.h
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2020-05-06 06:40:22 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-18 17:10:36 +0300
commit51c9ba11f17f25ace1ea6bbfd4586c59105432de (patch)
treefc73c26d5e4a31cdff40251d7f30c5c4a1f4b6b9 /arch/powerpc/xmon/xmon_bpts.h
parent802268fd82676ffce432776f60b93a0b15e58e0c (diff)
downloadlinux-51c9ba11f17f25ace1ea6bbfd4586c59105432de.tar.xz
powerpc/xmon: Move breakpoint instructions to own array
To execute an instruction out of line after a breakpoint, the NIP is set to the address of struct bpt::instr. Here a copy of the instruction that was replaced with a breakpoint is kept, along with a trap so normal flow can be resumed after XOLing. The struct bpt's are located within the data section. This is problematic as the data section may be marked as no execute. Instead of each struct bpt holding the instructions to be XOL'd, make a new array, bpt_table[], with enough space to hold instructions for the number of supported breakpoints. A later patch will move this to the text section. Make struct bpt::instr a pointer to the instructions in bpt_table[] associated with that breakpoint. This association is a simple mapping: bpts[n] -> bpt_table[n * words per breakpoint]. Currently we only need the copied instruction followed by a trap, so 2 words per breakpoint. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Alistair Popple <alistair@popple.id.au> Link: https://lore.kernel.org/r/20200506034050.24806-3-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc/xmon/xmon_bpts.h')
0 files changed, 0 insertions, 0 deletions