From: "Jan Beulich" <jbeulich@novell.com>
To: "Andreas Kleen" <ak@suse.de>
Cc: "Ingo Molnar" <mingo@elte.hu>, <linux-kernel@vger.kernel.org>,
<discuss@x86-64.org>
Subject: [PATCH 3/6] reliable stack trace support (x86-64 IRQ stack adjustment)
Date: Mon, 22 May 2006 15:17:35 +0200 [thread overview]
Message-ID: <4471D60F.76E4.0078.0@novell.com> (raw)
Change the switching to/from the IRQ stack so that unwind annotations can
be added for it without requiring CFA expressions.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: unwind-2.6.17-rc4/arch/x86_64/kernel/entry.S
===================================================================
--- unwind-2.6.17-rc4.orig/arch/x86_64/kernel/entry.S 2006-05-22 15:01:04.000000000 +0200
+++ unwind-2.6.17-rc4/arch/x86_64/kernel/entry.S 2006-05-22 15:01:07.000000000 +0200
@@ -483,16 +483,21 @@ ENTRY(stub_rt_sigreturn)
#else
SAVE_ARGS
leaq -ARGOFFSET(%rsp),%rdi # arg1 for handler
-#endif
+#ifdef CONFIG_UNWIND_INFO
+ pushq %rbp
+ CFI_ADJUST_CFA_OFFSET 8
+ CFI_REL_OFFSET rbp, 0
+ movq %rsp,%rbp
+ CFI_DEF_CFA_REGISTER rbp
+#endif
+#endif
testl $3,CS(%rdi)
je 1f
swapgs
1: incl %gs:pda_irqcount # RED-PEN should check preempt count
- movq %gs:pda_irqstackptr,%rax
- cmoveq %rax,%rsp /*todo This needs CFI annotation! */
+ cmoveq %gs:pda_irqstackptr,%rsp
+#if !defined(CONFIG_DEBUG_INFO) && !defined(CONFIG_UNWIND_INFO)
pushq %rdi # save old stack
-#ifndef CONFIG_DEBUG_INFO
- CFI_ADJUST_CFA_OFFSET 8
#endif
call \func
.endm
@@ -502,17 +507,24 @@ ENTRY(common_interrupt)
interrupt do_IRQ
/* 0(%rsp): oldrsp-ARGOFFSET */
ret_from_intr:
+#if !defined(CONFIG_DEBUG_INFO) && !defined(CONFIG_UNWIND_INFO)
popq %rdi
-#ifndef CONFIG_DEBUG_INFO
- CFI_ADJUST_CFA_OFFSET -8
#endif
cli
decl %gs:pda_irqcount
#ifdef CONFIG_DEBUG_INFO
- movq RBP(%rdi),%rbp
+ movq %rbp, %rsp
CFI_DEF_CFA_REGISTER rsp
+ movq RBP(%rsp),%rbp
+ addq $ARG_OFFSET, %rsp
+ CFI_ADJUST_CFA_OFFSET -ARG_OFFSET
+#elif defined(CONFIG_UNWIND_INFO)
+ leaveq
+ CFI_DEF_CFA_REGISTER rsp
+ CFI_ADJUST_CFA_OFFSET -8
+#else
+ leaq ARGOFFSET(%rdi),%rsp
#endif
- leaq ARGOFFSET(%rdi),%rsp /*todo This needs CFI annotation! */
exit_intr:
GET_THREAD_INFO(%rcx)
testl $3,CS-ARGOFFSET(%rsp)
next reply other threads:[~2006-05-22 13:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-22 13:17 Jan Beulich [this message]
2006-05-22 14:10 ` [PATCH 3/6] reliable stack trace support (x86-64 IRQ stack adjustment) Andi Kleen
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=4471D60F.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=ak@suse.de \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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