summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace_64.S
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-04-01 16:51:11 +0200
committerIngo Molnar <mingo@kernel.org>2020-04-22 10:53:50 +0200
commit9f2dfd61dd022d4559d42a832fb03e76aad36c5f (patch)
tree911e5d0f266368063710de91316e4fef732d84c5 /arch/x86/kernel/ftrace_64.S
parentx86,ftrace: Use SIZEOF_PTREGS (diff)
downloadlinux-9f2dfd61dd022d4559d42a832fb03e76aad36c5f.tar.xz
linux-9f2dfd61dd022d4559d42a832fb03e76aad36c5f.zip
x86,ftrace: Shrink ftrace_regs_caller() by one byte
'Optimize' ftrace_regs_caller. Instead of comparing against an immediate, the more natural way to test for zero on x86 is: 'test %r,%r'. 48 83 f8 00 cmp $0x0,%rax 74 49 je 226 <ftrace_regs_call+0xa3> 48 85 c0 test %rax,%rax 74 49 je 225 <ftrace_regs_call+0xa2> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20200416115118.867411350@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/ftrace_64.S')
-rw-r--r--arch/x86/kernel/ftrace_64.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index be9aff20dd5f..9738ed23964e 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -240,8 +240,8 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
* See arch_ftrace_set_direct_caller().
*/
movq ORIG_RAX(%rsp), %rax
- cmpq $0, %rax
- je 1f
+ testq %rax, %rax
+ jz 1f
/* Swap the flags with orig_rax */
movq MCOUNT_REG_SIZE(%rsp), %rdi