aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r--arch/x86/kernel/ftrace.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 7ef914e6a2f6..58832478b94e 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -467,8 +467,13 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
467 * ignore such a protection. 467 * ignore such a protection.
468 */ 468 */
469 asm volatile( 469 asm volatile(
470#ifdef CONFIG_X86_64
471 "1: movq (%[parent_old]), %[old]\n"
472 "2: movq %[return_hooker], (%[parent_replaced])\n"
473#else
470 "1: movl (%[parent_old]), %[old]\n" 474 "1: movl (%[parent_old]), %[old]\n"
471 "2: movl %[return_hooker], (%[parent_replaced])\n" 475 "2: movl %[return_hooker], (%[parent_replaced])\n"
476#endif
472 " movl $0, %[faulted]\n" 477 " movl $0, %[faulted]\n"
473 478
474 ".section .fixup, \"ax\"\n" 479 ".section .fixup, \"ax\"\n"
@@ -476,8 +481,13 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
476 ".previous\n" 481 ".previous\n"
477 482
478 ".section __ex_table, \"a\"\n" 483 ".section __ex_table, \"a\"\n"
484#ifdef CONFIG_X86_64
485 " .quad 1b, 3b\n"
486 " .quad 2b, 3b\n"
487#else
479 " .long 1b, 3b\n" 488 " .long 1b, 3b\n"
480 " .long 2b, 3b\n" 489 " .long 2b, 3b\n"
490#endif
481 ".previous\n" 491 ".previous\n"
482 492
483 : [parent_replaced] "=r" (parent), [old] "=r" (old), 493 : [parent_replaced] "=r" (parent), [old] "=r" (old),
@@ -509,5 +519,4 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
509 ftrace_graph_entry(&trace); 519 ftrace_graph_entry(&trace);
510 520
511} 521}
512
513#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 522#endif /* CONFIG_FUNCTION_GRAPH_TRACER */