Skip to contentSkip to conversation

Resend: [PATCH] x86-64: fix unwind annotations in syscall stubs

PATCH Jan Beulich 2 participants 3 messages Sep 2, 2010 – Sep 3, 2010 x86

lore
Share & tools
lore
#0 lore raw

With the return address removed from the stack, these should really refer to their caller's register state.

---
 arch/x86/kernel/entry_64.S |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/x86/kernel/entry_64.S +3 -4
@@ -714,9 +714,8 @@ END(ptregscall_common)
 
 ENTRY(stub_execve)
 	CFI_STARTPROC
-	popq %r11
-	CFI_ADJUST_CFA_OFFSET -8
-	CFI_REGISTER rip, r11
+	addq $8, %rsp
+	PARTIAL_FRAME 0
 	SAVE_REST
 	FIXUP_TOP_OF_STACK %r11
 	movq %rsp, %rcx
@@ -735,7 +734,7 @@ END(stub_execve)
 ENTRY(stub_rt_sigreturn)
 	CFI_STARTPROC
 	addq $8, %rsp
-	CFI_ADJUST_CFA_OFFSET	-8
+	PARTIAL_FRAME 0
 	SAVE_REST
 	movq %rsp,%rdi
 	FIXUP_TOP_OF_STACK %r11
#1 lore raw
Quoted 25 lines · Jan Beulich

With the return address removed from the stack, these should really refer to their caller's register state.

---
 arch/x86/kernel/entry_64.S |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/x86/kernel/entry_64.S +2 -3
@@ -714,9 +714,8 @@ END(ptregscall_common)
 
 ENTRY(stub_execve)
 	CFI_STARTPROC
-       popq %r11
-       CFI_ADJUST_CFA_OFFSET -8
-       CFI_REGISTER rip, r11
+       addq $8, %rsp
+       PARTIAL_FRAME 0
 	SAVE_REST
 	FIXUP_TOP_OF_STACK %r11
 	movq %rsp, %rcx

arch/x86/kernel/entry_64.S END(stub_execve) · line 740

Quoted 8 lines
arch/x86/kernel/entry_64.S +1 -1
@@ -735,7 +734,7 @@ END(stub_execve)
 ENTRY(stub_rt_sigreturn)
 	CFI_STARTPROC
 	addq $8, %rsp
-       CFI_ADJUST_CFA_OFFSET   -8
+       PARTIAL_FRAME 0
 	SAVE_REST
 	movq %rsp,%rdi
 	FIXUP_TOP_OF_STACK %r11

Thanks for creating these...

#2 lore raw

[tip:x86/debug] x86-64: Fix unwind annotations in syscall stubs

In reply to Jan Beulich
Commit-ID:  e6b04b6b5a3182ae36cf9a69f1aaaee432edc8ad
Gitweb:     http://git.kernel.org/tip/e6b04b6b5a3182ae36cf9a69f1aaaee432edc8ad
Author:     Jan Beulich <[email protected]>
AuthorDate: Thu, 2 Sep 2010 13:52:45 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 3 Sep 2010 08:14:09 +0200

x86-64: Fix unwind annotations in syscall stubs

With the return address removed from the stack, these should really refer to their caller's register state.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/entry_64.S |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/kernel/entry_64.S +4 -5
index 17be5ec..16aeff0 100644
@@ -714,9 +714,8 @@ END(ptregscall_common)
 
 ENTRY(stub_execve)
 	CFI_STARTPROC
-	popq %r11
-	CFI_ADJUST_CFA_OFFSET -8
-	CFI_REGISTER rip, r11
+	addq $8, %rsp
+	PARTIAL_FRAME 0
 	SAVE_REST
 	FIXUP_TOP_OF_STACK %r11
 	movq %rsp, %rcx
@@ -735,7 +734,7 @@ END(stub_execve)
 ENTRY(stub_rt_sigreturn)
 	CFI_STARTPROC
 	addq $8, %rsp
-	CFI_ADJUST_CFA_OFFSET	-8
+	PARTIAL_FRAME 0
 	SAVE_REST
 	movq %rsp,%rdi
 	FIXUP_TOP_OF_STACK %r11
@@ -1445,7 +1444,6 @@ error_swapgs:
 error_sti:
 	TRACE_IRQS_OFF
 	ret
-	CFI_ENDPROC
 
 /*
  * There are two places in the kernel that can potentially fault with
@@ -1470,6 +1468,7 @@ bstep_iret:
 	/* Fix truncated RIP */
 	movq %rcx,RIP+8(%rsp)
 	jmp error_swapgs
+	CFI_ENDPROC
 END(error_entry)