Skip to content

Commit 7fccfcf

Browse files
iamjpnmpe
authored andcommitted
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
1 parent 6c7a4f0 commit 7fccfcf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/powerpc/xmon/xmon.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,6 @@ static struct bpt *new_breakpoint(unsigned long a)
878878
if (!bp->enabled && atomic_read(&bp->ref_count) == 0) {
879879
bp->address = a;
880880
bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS));
881-
patch_instruction(bp->instr + 1, ppc_inst(bpinstr));
882881
return bp;
883882
}
884883
}
@@ -910,6 +909,8 @@ static void insert_bpts(void)
910909
continue;
911910
}
912911
patch_instruction(bp->instr, instr);
912+
patch_instruction((void *)bp->instr + ppc_inst_len(instr),
913+
ppc_inst(bpinstr));
913914
if (bp->enabled & BP_CIABR)
914915
continue;
915916
if (patch_instruction((struct ppc_inst *)bp->address,

0 commit comments

Comments
 (0)