aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-11-25 13:22:48 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-28 08:07:56 -0500
commitec682cef2d2c1a25a198d32a87fe2649da671d1e (patch)
tree7713005f3f7819afc013358a4bfe938031d20628 /arch/powerpc
parentd9af12b72bfe2a4efc1d347e0ac1c669b85dcea9 (diff)
powerpc: ftrace, added missing icache flush
Impact: fix to PowerPC code modification After modifying code it is essential to flush the icache. This patch adds the missing flush. Reported-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/ftrace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index ea454a004406..a4640e4f1172 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -271,6 +271,9 @@ __ftrace_make_nop(struct module *mod,
271 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 271 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
272 return -EPERM; 272 return -EPERM;
273 273
274
275 flush_icache_range(ip, ip + 8);
276
274 return 0; 277 return 0;
275} 278}
276 279
@@ -342,6 +345,8 @@ __ftrace_make_nop(struct module *mod,
342 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 345 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
343 return -EPERM; 346 return -EPERM;
344 347
348 flush_icache_range(ip, ip + 8);
349
345 return 0; 350 return 0;
346} 351}
347#endif /* PPC64 */ 352#endif /* PPC64 */
@@ -438,6 +443,8 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
438 if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2)) 443 if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2))
439 return -EPERM; 444 return -EPERM;
440 445
446 flush_icache_range(ip, ip + 8);
447
441 return 0; 448 return 0;
442} 449}
443#else 450#else
@@ -481,6 +488,8 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
481 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 488 if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
482 return -EPERM; 489 return -EPERM;
483 490
491 flush_icache_range(ip, ip + 8);
492
484 return 0; 493 return 0;
485} 494}
486#endif /* CONFIG_PPC64 */ 495#endif /* CONFIG_PPC64 */