Skip to content

Commit d07df82

Browse files
bsingharorampe
authored andcommitted
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: Balbir Singh <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 7f6d498 commit d07df82

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/powerpc/kernel/kprobes.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,13 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe);
164164

165165
void arch_arm_kprobe(struct kprobe *p)
166166
{
167-
*p->addr = BREAKPOINT_INSTRUCTION;
168-
flush_icache_range((unsigned long) p->addr,
169-
(unsigned long) p->addr + sizeof(kprobe_opcode_t));
167+
patch_instruction(p->addr, BREAKPOINT_INSTRUCTION);
170168
}
171169
NOKPROBE_SYMBOL(arch_arm_kprobe);
172170

173171
void arch_disarm_kprobe(struct kprobe *p)
174172
{
175-
*p->addr = p->opcode;
176-
flush_icache_range((unsigned long) p->addr,
177-
(unsigned long) p->addr + sizeof(kprobe_opcode_t));
173+
patch_instruction(p->addr, p->opcode);
178174
}
179175
NOKPROBE_SYMBOL(arch_disarm_kprobe);
180176

0 commit comments

Comments
 (0)