linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86-64: fix unwind info for incomplete frames
@ 2015-05-28  8:20 Jan Beulich
  2015-05-28  9:01 ` Ingo Molnar
  0 siblings, 1 reply; 17+ messages in thread
From: Jan Beulich @ 2015-05-28  8:20 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: Andy Lutomirski, Denys Vlasenko, linux-kernel

Commit 76f5df43ca ('x86/asm/entry/64: Always allocate a complete
"struct pt_regs" on the kernel stack') deleted PARTIAL_FRAME without
considering that while a full frame is now being allocated, not all
registers get always saved into it. Instead of restoring that macro,
simply make DEFAULT_FRAME capable of expressing both.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
---
 arch/x86/kernel/entry_64.S |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- 4.1-rc5/arch/x86/kernel/entry_64.S
+++ 4.1-rc5-x86_64-unwind-info/arch/x86/kernel/entry_64.S
@@ -148,7 +148,7 @@ ENDPROC(native_usergs_sysret64)
 /*
  * frame that enables passing a complete pt_regs to a C function.
  */
-	.macro DEFAULT_FRAME start=1 offset=0
+	.macro DEFAULT_FRAME start=1 offset=0 extra=1
 	XCPT_FRAME \start, ORIG_RAX+\offset
 	CFI_REL_OFFSET rdi, RDI+\offset
 	CFI_REL_OFFSET rsi, RSI+\offset
@@ -159,12 +159,14 @@ ENDPROC(native_usergs_sysret64)
 	CFI_REL_OFFSET r9, R9+\offset
 	CFI_REL_OFFSET r10, R10+\offset
 	CFI_REL_OFFSET r11, R11+\offset
+	.if \extra
 	CFI_REL_OFFSET rbx, RBX+\offset
 	CFI_REL_OFFSET rbp, RBP+\offset
 	CFI_REL_OFFSET r12, R12+\offset
 	CFI_REL_OFFSET r13, R13+\offset
 	CFI_REL_OFFSET r14, R14+\offset
 	CFI_REL_OFFSET r15, R15+\offset
+	.endif
 	.endm
 
 /*
@@ -491,7 +493,7 @@ END(system_call)
 	.macro FORK_LIKE func
 ENTRY(stub_\func)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8		/* offset 8: return address */
+	DEFAULT_FRAME 0, 8, 0		/* offset 8: return address */
 	SAVE_EXTRA_REGS 8
 	jmp sys_\func
 	CFI_ENDPROC
@@ -504,7 +506,7 @@ END(stub_\func)
 
 ENTRY(stub_execve)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	call	sys_execve
 return_from_execve:
 	testl	%eax, %eax
@@ -527,7 +529,7 @@ END(stub_execve)
 	.align	8
 GLOBAL(stub_execveat)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	call	sys_execveat
 	jmp	return_from_execve
 	CFI_ENDPROC
@@ -537,7 +539,7 @@ END(stub_execveat)
 	.align	8
 GLOBAL(stub_x32_execve)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	call	compat_sys_execve
 	jmp	return_from_execve
 	CFI_ENDPROC
@@ -545,7 +547,7 @@ END(stub_x32_execve)
 	.align	8
 GLOBAL(stub_x32_execveat)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	call	compat_sys_execveat
 	jmp	return_from_execve
 	CFI_ENDPROC
@@ -575,7 +577,7 @@ END(stub32_execveat)
  */
 ENTRY(stub_rt_sigreturn)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	/*
 	 * SAVE_EXTRA_REGS result is not normally needed:
 	 * sigreturn overwrites all pt_regs->GPREGS.
@@ -597,7 +599,7 @@ END(stub_rt_sigreturn)
 #ifdef CONFIG_X86_X32_ABI
 ENTRY(stub_x32_rt_sigreturn)
 	CFI_STARTPROC
-	DEFAULT_FRAME 0, 8
+	DEFAULT_FRAME 0, 8, 0
 	SAVE_EXTRA_REGS 8
 	call sys32_x32_rt_sigreturn
 	jmp  return_from_stub




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

end of thread, other threads:[~2015-06-05 17:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28  8:20 [PATCH] x86-64: fix unwind info for incomplete frames Jan Beulich
2015-05-28  9:01 ` Ingo Molnar
2015-05-28  9:45   ` Jan Beulich
2015-05-28 11:20     ` [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations Ingo Molnar
2015-05-28 11:39       ` [PATCH v2] " Ingo Molnar
2015-05-28 11:51       ` [PATCH] " Jan Beulich
2015-05-28 13:17         ` Ingo Molnar
2015-05-29 17:47           ` Andy Lutomirski
2015-05-29 20:27             ` Josh Poimboeuf
2015-05-29 21:39               ` Frank Ch. Eigler
2015-06-01 19:45             ` Josh Poimboeuf
2015-06-01 19:53               ` Andy Lutomirski
2015-06-01 20:19                 ` Josh Poimboeuf
2015-06-02  5:57                 ` Ingo Molnar
2015-06-02 14:46                   ` Josh Poimboeuf
2015-06-02 17:00                     ` Andy Lutomirski
2015-06-05 17:11             ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).