diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2018-04-19 10:04:07 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-05-03 15:32:28 +0300 |
commit | 250122baed29d90c643be8809d75274336b98fb0 (patch) | |
tree | e0a7d2db2f5a404013780461f72414788ee5f49d /arch/powerpc/kernel/trace | |
parent | 88b1a8547f4c00e55d54e081fc15e3980debf5c1 (diff) | |
download | linux-250122baed29d90c643be8809d75274336b98fb0.tar.xz |
powerpc64/module: Tighten detection of mcount call sites with -mprofile-kernel
For R_PPC64_REL24 relocations, we suppress emitting instructions for TOC
load/restore in the relocation stub if the relocation is for _mcount()
call when using -mprofile-kernel ABI.
To detect this, we check if the preceding instructions are per the
standard set of instructions emitted by gcc: either the two instruction
sequence of 'mflr r0; std r0,16(r1)', or the more optimized variant of a
single 'mflr r0'. This is not sufficient since nothing prevents users
from hand coding sequences involving a 'mflr r0' followed by a 'bl'.
For removing the toc save instruction from the stub, we additionally
check if the symbol is "_mcount". Add the same check here as well.
Also rename is_early_mcount_callsite() to is_mprofile_mcount_callsite()
since that is what is being checked. The use of "early" is misleading
since there is nothing involving this function that qualifies as early.
Fixes: 153086644fd1f ("powerpc/ftrace: Add support for -mprofile-kernel ftrace ABI")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/trace')
0 files changed, 0 insertions, 0 deletions