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

From
Christophe LEROY <hidden>
Date
2017-06-27 08:34:15
Reply to
Balbir Singh, 2017-06-27

Le 27/06/2017 à 09:48, Balbir Singh a écrit :
arch_arm/disarm_probe use direct assignment for copying
instructions, replace them with patch_instruction

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Didn't Michael picked it up already ?

Christophe
quoted hunk ↗ jump to hunk
---
  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 01addfb..a52bae8 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -164,7 +164,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));
  }
@@ -172,7 +172,7 @@ NOKPROBE_SYMBOL(arch_arm_kprobe);
  
  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));
  }
Thread (15 messages) 15 messages, 2 authors, last reply 2017-06-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help