Commit d07df82c authored by Balbir Singh's avatar Balbir Singh Committed by Michael Ellerman

powerpc/kprobes: Move kprobes over to patch_instruction()

arch_arm/disarm_probe() use direct assignment for copying
instructions, replace them with patch_instruction(). We don't need to
call flush_icache_range() because patch_instruction() does it for us.
Signed-off-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7f6d498e
...@@ -164,17 +164,13 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe); ...@@ -164,17 +164,13 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe);
void arch_arm_kprobe(struct kprobe *p) void arch_arm_kprobe(struct kprobe *p)
{ {
*p->addr = BREAKPOINT_INSTRUCTION; patch_instruction(p->addr, BREAKPOINT_INSTRUCTION);
flush_icache_range((unsigned long) p->addr,
(unsigned long) p->addr + sizeof(kprobe_opcode_t));
} }
NOKPROBE_SYMBOL(arch_arm_kprobe); NOKPROBE_SYMBOL(arch_arm_kprobe);
void arch_disarm_kprobe(struct kprobe *p) void arch_disarm_kprobe(struct kprobe *p)
{ {
*p->addr = p->opcode; patch_instruction(p->addr, p->opcode);
flush_icache_range((unsigned long) p->addr,
(unsigned long) p->addr + sizeof(kprobe_opcode_t));
} }
NOKPROBE_SYMBOL(arch_disarm_kprobe); NOKPROBE_SYMBOL(arch_disarm_kprobe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment