Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec682cef authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar
Browse files

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: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent d9af12b7
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -271,6 +271,9 @@ __ftrace_make_nop(struct module *mod,
	if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
	if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
		return -EPERM;
		return -EPERM;



	flush_icache_range(ip, ip + 8);

	return 0;
	return 0;
}
}


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


	flush_icache_range(ip, ip + 8);

	return 0;
	return 0;
}
}
#endif /* PPC64 */
#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))
	if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2))
		return -EPERM;
		return -EPERM;


	flush_icache_range(ip, ip + 8);

	return 0;
	return 0;
}
}
#else
#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))
	if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE))
		return -EPERM;
		return -EPERM;


	flush_icache_range(ip, ip + 8);

	return 0;
	return 0;
}
}
#endif /* CONFIG_PPC64 */
#endif /* CONFIG_PPC64 */