From: jia zhang <jia.zhang2008@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>, tglx@linutronix.de, hpa@zytor.com
Subject: [PATCH] x86: remove the confusing entry in call trace
Date: Sun, 23 Nov 2008 22:47:10 +0800 [thread overview]
Message-ID: <49296CEE.2070905@gmail.com> (raw)
avoid the confusion in call trace because of the lack of padding at the tail of function.
Signed-off-by: jia zhang <jia.zhang2008@gmail.com>
---
When do_exit get call, 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 remained in call trace. It looks confused.
b/arch/x86/kernel/entry_32.S | 1 +
b/arch/x86/kernel/entry_64.S | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 28b597e..3290819 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1051,6 +1051,7 @@ ENTRY(kernel_thread_helper)
push %eax
CFI_ADJUST_CFA_OFFSET 4
call do_exit
+ nop # padding for call trace
CFI_ENDPROC
ENDPROC(kernel_thread_helper)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index b86f332..6f677a6 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1170,6 +1170,7 @@ child_rip:
# exit
mov %eax, %edi
call do_exit
+ nop # padding for call trace
CFI_ENDPROC
ENDPROC(child_rip)
next reply other threads:[~2008-11-23 14:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-23 14:47 jia zhang [this message]
2008-11-23 17:30 ` Alexander van Heukelum
2008-11-23 19:04 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49296CEE.2070905@gmail.com \
--to=jia.zhang2008@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®