提交 8b27386a 编写于 作者: A Anders Kaseorg 提交者: Ingo Molnar

ftrace: make ftrace_test_p6nop disassembler-friendly

Commit 4c3dc21b136f8cb4b72afee16c3ba7e961656c0b in tip introduced the
5-byte NOP ftrace_test_p6nop:

   jmp . + 5
   .byte 0x00, 0x00, 0x00

This is not friendly to disassemblers because an odd number of 0x00s
ends in the middle of an instruction boundary.  This changes the 0x00s
to 1-byte NOPs (0x90).
Signed-off-by: NAnders Kaseorg <andersk@mit.edu>
Acked-by: NSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 bfadadfc
...@@ -132,7 +132,9 @@ int __init ftrace_dyn_arch_init(void *data) ...@@ -132,7 +132,9 @@ int __init ftrace_dyn_arch_init(void *data)
".section .text, \"ax\"\n" ".section .text, \"ax\"\n"
"ftrace_test_jmp:" "ftrace_test_jmp:"
"jmp ftrace_test_p6nop\n" "jmp ftrace_test_p6nop\n"
".byte 0x00,0x00,0x00\n" /* 2 byte jmp + 3 bytes */ "nop\n"
"nop\n"
"nop\n" /* 2 byte jmp + 3 bytes */
"ftrace_test_p6nop:" "ftrace_test_p6nop:"
P6_NOP5 P6_NOP5
"jmp 1f\n" "jmp 1f\n"
...@@ -161,7 +163,7 @@ int __init ftrace_dyn_arch_init(void *data) ...@@ -161,7 +163,7 @@ int __init ftrace_dyn_arch_init(void *data)
ftrace_nop = (unsigned long *)ftrace_test_nop5; ftrace_nop = (unsigned long *)ftrace_test_nop5;
break; break;
case 2: case 2:
pr_info("ftrace: converting mcount calls to jmp 1f\n"); pr_info("ftrace: converting mcount calls to jmp . + 5\n");
ftrace_nop = (unsigned long *)ftrace_test_jmp; ftrace_nop = (unsigned long *)ftrace_test_jmp;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册