-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powerpc/ftrace: Reserve instructions from function entry for ftrace #2579
Conversation
Master branch: 9b6eb04 |
Master branch: 1b8c924 |
16665a3
to
6f69aee
Compare
Master branch: 9e98ace |
6f69aee
to
9284b88
Compare
9e98ace
to
1b8c924
Compare
Master branch: 1b8c924 |
9284b88
to
c5fb325
Compare
Master branch: b38101c |
c5fb325
to
ca6a386
Compare
Master branch: b75daca |
ca6a386
to
cf82ac7
Compare
Master branch: d24d2a2 |
cf82ac7
to
8f1aab8
Compare
Master branch: 086d490 |
8f1aab8
to
8c6f391
Compare
Master branch: 9087c6f |
8c6f391
to
a483706
Compare
Master branch: a33c0c7 |
a483706
to
b0d1b52
Compare
Master branch: d0b3822 |
b0d1b52
to
5c0d559
Compare
Master branch: b03e194 |
5c0d559
to
5703155
Compare
Master branch: 13c6a37 |
5703155
to
ee9a8ef
Compare
Master branch: 6966d4c |
ee9a8ef
to
cf4cb72
Compare
Master branch: b4f7278 |
cf4cb72
to
72073c4
Compare
Master branch: a19df71 |
72073c4
to
14e44cb
Compare
Master branch: 08894d9 |
14e44cb
to
ce8349e
Compare
Master branch: c561d11 |
ce8349e
to
e0bb7b1
Compare
Master branch: 08d4dba |
e0bb7b1
to
7fcb560
Compare
Master branch: 80bebeb |
7fcb560
to
21665eb
Compare
Master branch: dda7596 |
21665eb
to
1409309
Compare
Master branch: 5e214f2 |
1409309
to
58485a9
Compare
Master branch: c62dd8a |
On some architectures, enabling function tracing results in multiple instructions being emitted at function entry. As an example, on powerpc64 with -mprofile-kernel, two instructions are emitted at function entry: mflr r0 bl _mcount It is desirable to nop out both these instructions when ftrace is not active. For that purpose, it is essential to mark both these instructions as belonging to ftrace so that other kernel subsystems (such as kprobes) do not modify these instructions. Add support for this by allowing architectures to override ftrace_cmp_recs() and to match against address ranges over and above a single MCOUNT_INSN_SIZE. For powerpc32, we mark the two instructions preceding the call to _mcount() as belonging to ftrace. For powerpc64, an additional aspect to consider is that functions can have a global entry point for setting up the TOC when invoked from other modules. If present, global entry point always involves two instructions (addis/lis and addi). To handle this, we provide a custom ftrace_init_nop() for powerpc64 where we identify functions having a global entry point and record this information in the LSB of dyn_ftrace->arch.mod. This information is used in ftrace_cmp_recs() to reserve instructions from the global entry point. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reported-by: kernel test robot <lkp@intel.com>
…h address On some architectures, ftrace location can include multiple instructions, and does not necessarily match the function entry address returned by kallsyms_lookup(). Drop the check in is_ftrace_location() to accommodate the same. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
On certain architectures, ftrace can reserve multiple instructions at function entry. Rather than rejecting kprobe on addresses other than the exact ftrace call instruction, use the address returned by ftrace to probe at the correct address when CONFIG_KPROBES_ON_FTRACE is enabled. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
58485a9
to
76889a6
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=615367 irrelevant now. Closing PR. |
Pull request for series with
subject: powerpc/ftrace: Reserve instructions from function entry for ftrace
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=615367