public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/6] reliable stack trace support (x86-64 IRQ stack adjustment)
@ 2006-05-22 13:17 Jan Beulich
  2006-05-22 14:10 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2006-05-22 13:17 UTC (permalink / raw)
  To: Andreas Kleen; +Cc: Ingo Molnar, linux-kernel, discuss

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)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-22 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-22 13:17 [PATCH 3/6] reliable stack trace support (x86-64 IRQ stack adjustment) Jan Beulich
2006-05-22 14:10 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox