[PATCH 3/5] powerpc: ftrace, added missing icache flush

From: Steven Rostedt
Date: Wed Nov 26 2008 - 17:05:15 EST


From: Steven Rostedt <srostedt@xxxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
---
arch/powerpc/kernel/ftrace.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index ea454a0..a4640e4 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -271,6 +271,9 @@ __ftrace_make_nop(struct module *mod,
if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
return -EPERM;

+
+ flush_icache_range(ip, ip + 8);
+
return 0;
}

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

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

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

+ flush_icache_range(ip, ip + 8);
+
return 0;
}
#endif /* CONFIG_PPC64 */
--
1.5.6.5

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/