summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2020-05-06 05:40:39 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-18 16:10:38 +0200
commit7fccfcfba04f9cb46438f368755d368f6c57f3a0 (patch)
treefa9b92c62b0efd6f0d84019e701abb6df206e852 /arch/powerpc
parentpowerpc/xmon: Use a function for reading instructions (diff)
downloadlinux-7fccfcfba04f9cb46438f368755d368f6c57f3a0.tar.xz
linux-7fccfcfba04f9cb46438f368755d368f6c57f3a0.zip
powerpc/xmon: Move insertion of breakpoint for xol'ing
When a new breakpoint is created, the second instruction of that breakpoint is patched with a trap instruction. This assumes the length of the instruction is always the same. In preparation for prefixed instructions, remove this assumption. Insert the trap instruction at the same time the first instruction is inserted. 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-20-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/xmon/xmon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d8b29f6925be..00b24f357c2b 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -878,7 +878,6 @@ static struct bpt *new_breakpoint(unsigned long a)
if (!bp->enabled && atomic_read(&bp->ref_count) == 0) {
bp->address = a;
bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS));
- patch_instruction(bp->instr + 1, ppc_inst(bpinstr));
return bp;
}
}
@@ -910,6 +909,8 @@ static void insert_bpts(void)
continue;
}
patch_instruction(bp->instr, instr);
+ patch_instruction((void *)bp->instr + ppc_inst_len(instr),
+ ppc_inst(bpinstr));
if (bp->enabled & BP_CIABR)
continue;
if (patch_instruction((struct ppc_inst *)bp->address,