diff options
author | jia zhang <jia.zhang2008@gmail.com> | 2008-11-23 09:47:10 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 14:03:36 -0500 |
commit | 5f5db591326779a80cfe490c5d6b6ce9fac08b31 (patch) | |
tree | 4d599ae5e0439050c13023a47b2ee71443efd5e9 | |
parent | f377fa123d0ec621e8e361ecc3f2a8ee70e81a2e (diff) |
x86, debug: remove the confusing entry in call trace
Impact: improve backtrace quality
avoid the confusion in call trace because of the lack of padding at the
tail of function.
When do_exit gets called, the return address behind call instruction is
pushed into stack. If something get wrong in do_exit, for x86_64, the
entry "kernel_execve +0x00/0xXX" rather than "child_rip +0xYY/0xZZ" is
in the call trace.
That looks confusing, so add a u2d to make the return address still part
of the original call site. (This also catches any instances of us returning
from that function somehow.)
Signed-off-by: jia zhang <jia.zhang2008@gmail.com>
Acked-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/entry_32.S | 1 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 28b597ef9ca1..f6402c4ba10d 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1051,6 +1051,7 @@ ENTRY(kernel_thread_helper) | |||
1051 | push %eax | 1051 | push %eax |
1052 | CFI_ADJUST_CFA_OFFSET 4 | 1052 | CFI_ADJUST_CFA_OFFSET 4 |
1053 | call do_exit | 1053 | call do_exit |
1054 | ud2 # padding for call trace | ||
1054 | CFI_ENDPROC | 1055 | CFI_ENDPROC |
1055 | ENDPROC(kernel_thread_helper) | 1056 | ENDPROC(kernel_thread_helper) |
1056 | 1057 | ||
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index ddeeb1052583..4a16bf31c783 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1172,6 +1172,7 @@ child_rip: | |||
1172 | # exit | 1172 | # exit |
1173 | mov %eax, %edi | 1173 | mov %eax, %edi |
1174 | call do_exit | 1174 | call do_exit |
1175 | ud2 # padding for call trace | ||
1175 | CFI_ENDPROC | 1176 | CFI_ENDPROC |
1176 | ENDPROC(child_rip) | 1177 | ENDPROC(child_rip) |
1177 | 1178 | ||