aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/power
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-01-21 17:49:24 -0500
committerIngo Molnar <mingo@kernel.org>2016-02-24 02:35:43 -0500
commitef0f3ed5a4acfb24740480bf2e50b178724f094d (patch)
tree8e32b744cc3145a4f31ddd9d7bfd0f750077060c /arch/x86/power
parent779c433b8ea5c9fdfb892265b2ca6213d1f12ff8 (diff)
x86/asm/power: Create stack frames in hibernate_asm_64.S
swsusp_arch_suspend() and restore_registers() are callable non-leaf functions which don't honor CONFIG_FRAME_POINTER, which can result in bad stack traces. Also they aren't annotated as ELF callable functions which can confuse tooling. Create a stack frame for them when CONFIG_FRAME_POINTER is enabled and give them proper ELF function annotations. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Reviewed-by: Borislav Petkov <bp@suse.de> Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Chris J Arges <chris.j.arges@canonical.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/bdad00205897dc707aebe9e9e39757085e2bf999.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/power')
-rw-r--r--arch/x86/power/hibernate_asm_64.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S
index e2386cb4e0c3..4400a43b9e28 100644
--- a/arch/x86/power/hibernate_asm_64.S
+++ b/arch/x86/power/hibernate_asm_64.S
@@ -21,8 +21,10 @@
21#include <asm/page_types.h> 21#include <asm/page_types.h>
22#include <asm/asm-offsets.h> 22#include <asm/asm-offsets.h>
23#include <asm/processor-flags.h> 23#include <asm/processor-flags.h>
24#include <asm/frame.h>
24 25
25ENTRY(swsusp_arch_suspend) 26ENTRY(swsusp_arch_suspend)
27 FRAME_BEGIN
26 movq $saved_context, %rax 28 movq $saved_context, %rax
27 movq %rsp, pt_regs_sp(%rax) 29 movq %rsp, pt_regs_sp(%rax)
28 movq %rbp, pt_regs_bp(%rax) 30 movq %rbp, pt_regs_bp(%rax)
@@ -50,7 +52,9 @@ ENTRY(swsusp_arch_suspend)
50 movq %rax, restore_cr3(%rip) 52 movq %rax, restore_cr3(%rip)
51 53
52 call swsusp_save 54 call swsusp_save
55 FRAME_END
53 ret 56 ret
57ENDPROC(swsusp_arch_suspend)
54 58
55ENTRY(restore_image) 59ENTRY(restore_image)
56 /* switch to temporary page tables */ 60 /* switch to temporary page tables */
@@ -107,6 +111,7 @@ ENTRY(core_restore_code)
107 */ 111 */
108 112
109ENTRY(restore_registers) 113ENTRY(restore_registers)
114 FRAME_BEGIN
110 /* go back to the original page tables */ 115 /* go back to the original page tables */
111 movq %rbx, %cr3 116 movq %rbx, %cr3
112 117
@@ -147,4 +152,6 @@ ENTRY(restore_registers)
147 /* tell the hibernation core that we've just restored the memory */ 152 /* tell the hibernation core that we've just restored the memory */
148 movq %rax, in_suspend(%rip) 153 movq %rax, in_suspend(%rip)
149 154
155 FRAME_END
150 ret 156 ret
157ENDPROC(restore_registers)