public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i386: add unwind directives to syscall ptregs stubs
@ 2010-09-02 13:04 Jan Beulich
  2010-09-02 23:09 ` Alexander van Heukelum
  2010-09-03  7:12 ` [tip:x86/debug] i386: Add " tip-bot for Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2010-09-02 13:04 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

When these stubs are actual functions (i.e. having a return
instruction) and have stack manipulation instructions in them, they
should also be annotated to allow unwinding through them.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/x86/kernel/entry_32.S    |  16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- linux-2.6.36-rc3/arch/x86/kernel/entry_32.S
+++ 2.6.36-rc3-x86-push-pop-cfi/arch/x86/kernel/entry_32.S
@@ -750,14 +710,18 @@ ptregs_##name: \
 #define PTREGSCALL3(name) \
 	ALIGN; \
 ptregs_##name: \
+	CFI_STARTPROC; \
 	leal 4(%esp),%eax; \
-	pushl %eax; \
+	pushl_cfi %eax; \
 	movl PT_EDX(%eax),%ecx; \
 	movl PT_ECX(%eax),%edx; \
 	movl PT_EBX(%eax),%eax; \
 	call sys_##name; \
 	addl $4,%esp; \
-	ret
+	CFI_ADJUST_CFA_OFFSET -4; \
+	ret; \
+	CFI_ENDPROC; \
+ENDPROC(ptregs_##name)
 
 PTREGSCALL1(iopl)
 PTREGSCALL0(fork)
@@ -772,15 +736,19 @@ PTREGSCALL1(vm86old)
 /* Clone is an oddball.  The 4th arg is in %edi */
 	ALIGN;
 ptregs_clone:
+	CFI_STARTPROC
 	leal 4(%esp),%eax
-	pushl %eax
-	pushl PT_EDI(%eax)
+	pushl_cfi %eax
+	pushl_cfi PT_EDI(%eax)
 	movl PT_EDX(%eax),%ecx
 	movl PT_ECX(%eax),%edx
 	movl PT_EBX(%eax),%eax
 	call sys_clone
 	addl $8,%esp
+	CFI_ADJUST_CFA_OFFSET -8
 	ret
+	CFI_ENDPROC
+ENDPROC(ptregs_clone)
 
 .macro FIXUP_ESPFIX_STACK
 /*




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

* Re: [PATCH] i386: add unwind directives to syscall ptregs stubs
  2010-09-02 13:04 [PATCH] i386: add unwind directives to syscall ptregs stubs Jan Beulich
@ 2010-09-02 23:09 ` Alexander van Heukelum
  2010-09-03  7:12 ` [tip:x86/debug] i386: Add " tip-bot for Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander van Heukelum @ 2010-09-02 23:09 UTC (permalink / raw)
  To: Jan Beulich, Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

On Thu, 02 Sep 2010 14:04 +0100, "Jan Beulich" <JBeulich@novell.com> wrote:
> When these stubs are actual functions (i.e. having a return
> instruction) and have stack manipulation instructions in them, they
> should also be annotated to allow unwinding through them.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>

Compiles to exactly the same machine code.

Acked-by: Alexander van Heukelum <heukelum@fastmail.fm>

> ---
>  arch/x86/kernel/entry_32.S    |  16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> --- linux-2.6.36-rc3/arch/x86/kernel/entry_32.S
> +++ 2.6.36-rc3-x86-push-pop-cfi/arch/x86/kernel/entry_32.S
> @@ -750,14 +710,18 @@ ptregs_##name: \
>  #define PTREGSCALL3(name) \
>  	ALIGN; \
>  ptregs_##name: \
> +       CFI_STARTPROC; \
>  	leal 4(%esp),%eax; \
> -       pushl %eax; \
> +       pushl_cfi %eax; \
>  	movl PT_EDX(%eax),%ecx; \
>  	movl PT_ECX(%eax),%edx; \
>  	movl PT_EBX(%eax),%eax; \
>  	call sys_##name; \
>  	addl $4,%esp; \
> -       ret
> +       CFI_ADJUST_CFA_OFFSET -4; \
> +       ret; \
> +       CFI_ENDPROC; \
> +ENDPROC(ptregs_##name)
>  
>  PTREGSCALL1(iopl)
>  PTREGSCALL0(fork)
> @@ -772,15 +736,19 @@ PTREGSCALL1(vm86old)
>  /* Clone is an oddball.  The 4th arg is in %edi */
>  	ALIGN;
>  ptregs_clone:
> +       CFI_STARTPROC
>  	leal 4(%esp),%eax
> -       pushl %eax
> -       pushl PT_EDI(%eax)
> +       pushl_cfi %eax
> +       pushl_cfi PT_EDI(%eax)
>  	movl PT_EDX(%eax),%ecx
>  	movl PT_ECX(%eax),%edx
>  	movl PT_EBX(%eax),%eax
>  	call sys_clone
>  	addl $8,%esp
> +       CFI_ADJUST_CFA_OFFSET -8
>  	ret
> +       CFI_ENDPROC
> +ENDPROC(ptregs_clone)
>  
>  .macro FIXUP_ESPFIX_STACK
>  /*
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
> 

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

* [tip:x86/debug] i386: Add unwind directives to syscall ptregs stubs
  2010-09-02 13:04 [PATCH] i386: add unwind directives to syscall ptregs stubs Jan Beulich
  2010-09-02 23:09 ` Alexander van Heukelum
@ 2010-09-03  7:12 ` tip-bot for Jan Beulich
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jan Beulich @ 2010-09-03  7:12 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jbeulich, heukelum, JBeulich, tglx,
	mingo

Commit-ID:  a34107b5577968dc53cf9c2195c7c2d4a2caf9ce
Gitweb:     http://git.kernel.org/tip/a34107b5577968dc53cf9c2195c7c2d4a2caf9ce
Author:     Jan Beulich <JBeulich@novell.com>
AuthorDate: Thu, 2 Sep 2010 14:04:16 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Sep 2010 08:14:10 +0200

i386: Add unwind directives to syscall ptregs stubs

When these stubs are actual functions (i.e. having a return
instruction) and have stack manipulation instructions in them,
they should also be annotated to allow unwinding through them.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Alexander van Heukelum <heukelum@fastmail.fm>
LKML-Reference: <4C7FBCF00200007800013F99@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/entry_32.S |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 227d009..d9b950e 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -750,14 +750,18 @@ ptregs_##name: \
 #define PTREGSCALL3(name) \
 	ALIGN; \
 ptregs_##name: \
+	CFI_STARTPROC; \
 	leal 4(%esp),%eax; \
-	pushl %eax; \
+	pushl_cfi %eax; \
 	movl PT_EDX(%eax),%ecx; \
 	movl PT_ECX(%eax),%edx; \
 	movl PT_EBX(%eax),%eax; \
 	call sys_##name; \
 	addl $4,%esp; \
-	ret
+	CFI_ADJUST_CFA_OFFSET -4; \
+	ret; \
+	CFI_ENDPROC; \
+ENDPROC(ptregs_##name)
 
 PTREGSCALL1(iopl)
 PTREGSCALL0(fork)
@@ -772,15 +776,19 @@ PTREGSCALL1(vm86old)
 /* Clone is an oddball.  The 4th arg is in %edi */
 	ALIGN;
 ptregs_clone:
+	CFI_STARTPROC
 	leal 4(%esp),%eax
-	pushl %eax
-	pushl PT_EDI(%eax)
+	pushl_cfi %eax
+	pushl_cfi PT_EDI(%eax)
 	movl PT_EDX(%eax),%ecx
 	movl PT_ECX(%eax),%edx
 	movl PT_EBX(%eax),%eax
 	call sys_clone
 	addl $8,%esp
+	CFI_ADJUST_CFA_OFFSET -8
 	ret
+	CFI_ENDPROC
+ENDPROC(ptregs_clone)
 
 .macro FIXUP_ESPFIX_STACK
 /*

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

end of thread, other threads:[~2010-09-03  7:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02 13:04 [PATCH] i386: add unwind directives to syscall ptregs stubs Jan Beulich
2010-09-02 23:09 ` Alexander van Heukelum
2010-09-03  7:12 ` [tip:x86/debug] i386: Add " tip-bot for Jan Beulich

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