Skip to content

Commit ec682ce

Browse files
Steven RostedtIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent d9af12b commit ec682ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/powerpc/kernel/ftrace.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ __ftrace_make_nop(struct module *mod,
271271
if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
272272
return -EPERM;
273273

274+
275+
flush_icache_range(ip, ip + 8);
276+
274277
return 0;
275278
}
276279

@@ -342,6 +345,8 @@ __ftrace_make_nop(struct module *mod,
342345
if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
343346
return -EPERM;
344347

348+
flush_icache_range(ip, ip + 8);
349+
345350
return 0;
346351
}
347352
#endif /* PPC64 */
@@ -438,6 +443,8 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
438443
if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2))
439444
return -EPERM;
440445

446+
flush_icache_range(ip, ip + 8);
447+
441448
return 0;
442449
}
443450
#else
@@ -481,6 +488,8 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
481488
if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
482489
return -EPERM;
483490

491+
flush_icache_range(ip, ip + 8);
492+
484493
return 0;
485494
}
486495
#endif /* CONFIG_PPC64 */

0 commit comments

Comments
 (0)