Files
android_kernel_xiaomi_sm8450/arch/powerpc/kernel
Michael Ellerman 9d63610951 powerpc/ftrace: Separate the heuristics for checking call sites
In __ftrace_make_nop() (the 64-bit version), we have code to deal with
two ftrace ABIs. There is the original ABI, which looks mostly like a
function call, and then the mprofile-kernel ABI which is just a branch.

The code tries to handle both cases, by looking for the presence of a
load to restore the TOC pointer (PPC_INST_LD_TOC). If we detect the TOC
load, we assume the call site is for an mcount() call using the old ABI.
That means we patch the mcount() call with a b +8, to branch over the
TOC load.

However if the kernel was built with mprofile-kernel, then there will
never be a call site using the original ftrace ABI. If for some reason
we do see a TOC load, then it's there for a good reason, and we should
not jump over it.

So split the code, using the existing CC_USING_MPROFILE_KERNEL. Kernels
built with mprofile-kernel will only look for, and expect, the new ABI,
and similarly for the original ABI.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-07-21 20:10:37 +10:00
..
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-06-14 13:58:26 +10:00
2016-06-21 15:30:56 +10:00
2014-11-27 09:32:58 +11:00
2016-06-14 13:58:26 +10:00
2015-08-06 15:10:20 +10:00
2016-07-19 20:17:07 +10:00
2015-03-24 13:15:52 +11:00
2016-07-15 14:57:47 +10:00
2016-07-15 14:57:47 +10:00
2016-06-14 13:58:26 +10:00
2016-06-21 15:30:51 +10:00
2016-06-21 15:30:50 +10:00
2015-04-07 17:15:13 +10:00
2016-04-12 21:05:18 +10:00