mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
arm64: ftrace: eliminate literal pool entries
Replace ldr xN, =<symbol> with adrp/add or adrp/ldr [as appropriate] in the implementation of _mcount(), which may be called very often. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
80708677fa
commit
f1ba46ee78
1 changed files with 10 additions and 9 deletions
|
@ -98,8 +98,8 @@
|
||||||
ENTRY(_mcount)
|
ENTRY(_mcount)
|
||||||
mcount_enter
|
mcount_enter
|
||||||
|
|
||||||
ldr x0, =ftrace_trace_function
|
adrp x0, ftrace_trace_function
|
||||||
ldr x2, [x0]
|
ldr x2, [x0, #:lo12:ftrace_trace_function]
|
||||||
adr x0, ftrace_stub
|
adr x0, ftrace_stub
|
||||||
cmp x0, x2 // if (ftrace_trace_function
|
cmp x0, x2 // if (ftrace_trace_function
|
||||||
b.eq skip_ftrace_call // != ftrace_stub) {
|
b.eq skip_ftrace_call // != ftrace_stub) {
|
||||||
|
@ -115,14 +115,15 @@ skip_ftrace_call: // return;
|
||||||
mcount_exit // return;
|
mcount_exit // return;
|
||||||
// }
|
// }
|
||||||
skip_ftrace_call:
|
skip_ftrace_call:
|
||||||
ldr x1, =ftrace_graph_return
|
adrp x1, ftrace_graph_return
|
||||||
ldr x2, [x1] // if ((ftrace_graph_return
|
ldr x2, [x1, #:lo12:ftrace_graph_return]
|
||||||
cmp x0, x2 // != ftrace_stub)
|
cmp x0, x2 // if ((ftrace_graph_return
|
||||||
b.ne ftrace_graph_caller
|
b.ne ftrace_graph_caller // != ftrace_stub)
|
||||||
|
|
||||||
ldr x1, =ftrace_graph_entry // || (ftrace_graph_entry
|
adrp x1, ftrace_graph_entry // || (ftrace_graph_entry
|
||||||
ldr x2, [x1] // != ftrace_graph_entry_stub))
|
adrp x0, ftrace_graph_entry_stub // != ftrace_graph_entry_stub))
|
||||||
ldr x0, =ftrace_graph_entry_stub
|
ldr x2, [x1, #:lo12:ftrace_graph_entry]
|
||||||
|
add x0, x0, #:lo12:ftrace_graph_entry_stub
|
||||||
cmp x0, x2
|
cmp x0, x2
|
||||||
b.ne ftrace_graph_caller // ftrace_graph_caller();
|
b.ne ftrace_graph_caller // ftrace_graph_caller();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue