Thread (18 messages) flat view 18 messages, 3 authors, 2017-06-26

Re: [PATCH v3 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

From: Balbir Singh <bsingharora@gmail.com>
Date: 2017-06-07 05:47:15

On Wed, 2017-06-07 at 00:35 +0530, Naveen N. Rao wrote:
Hi Balbir,

On 2017/06/06 02:29PM, Balbir Singh wrote:
quoted
arch_arm/disarm_probe use direct assignment for copying
instructions, replace them with patch_instruction

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/kernel/kprobes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index fc43435..b49f8f0 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -158,7 +158,7 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe);

 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));
Do we still need flush_icache_range() after patch_instruction()?
Good catch! No, we don't

Balbir Singh. 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help