From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org,
Michal Marek <mmarek@suse.cz>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andi Kleen <andi@firstfloor.org>, Pedro Alves <palves@redhat.com>,
Namhyung Kim <namhyung@gmail.com>,
Bernd Petrovitsch <bernd@petrovitsch.priv.at>,
"Chris J Arges" <chris.j.arges@canonical.com>,
Andrew Morton <akpm@linux-foundation.org>,
Pavel Machek <pavel@ucw.cz>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: [PATCH v12 21/21] x86/asm/power: Create stack frames in hibernate_asm_64.S
Date: Wed, 9 Sep 2015 08:22:00 -0500 [thread overview]
Message-ID: <c0736739c1dccdce3ead1dcf0552cb07fa0e2d4b.1441749989.git.jpoimboe@redhat.com> (raw)
In-Reply-To: <cover.1441749989.git.jpoimboe@redhat.com>
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>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
---
arch/x86/power/hibernate_asm_64.S | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S
index e2386cb..4400a43 100644
--- a/arch/x86/power/hibernate_asm_64.S
+++ b/arch/x86/power/hibernate_asm_64.S
@@ -21,8 +21,10 @@
#include <asm/page_types.h>
#include <asm/asm-offsets.h>
#include <asm/processor-flags.h>
+#include <asm/frame.h>
ENTRY(swsusp_arch_suspend)
+ FRAME_BEGIN
movq $saved_context, %rax
movq %rsp, pt_regs_sp(%rax)
movq %rbp, pt_regs_bp(%rax)
@@ -50,7 +52,9 @@ ENTRY(swsusp_arch_suspend)
movq %rax, restore_cr3(%rip)
call swsusp_save
+ FRAME_END
ret
+ENDPROC(swsusp_arch_suspend)
ENTRY(restore_image)
/* switch to temporary page tables */
@@ -107,6 +111,7 @@ ENTRY(core_restore_code)
*/
ENTRY(restore_registers)
+ FRAME_BEGIN
/* go back to the original page tables */
movq %rbx, %cr3
@@ -147,4 +152,6 @@ ENTRY(restore_registers)
/* tell the hibernation core that we've just restored the memory */
movq %rax, in_suspend(%rip)
+ FRAME_END
ret
+ENDPROC(restore_registers)
--
2.4.3
next prev parent reply other threads:[~2015-09-09 13:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 13:21 [PATCH v12 00/21] Compile-time stack metadata validation Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 01/21] tools: Fix formatting of the "make -C tools" help message Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 02/21] x86/asm: Frame pointer macro cleanup Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 03/21] x86/asm: Add C versions of frame pointer macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 04/21] x86/stacktool: Compile-time stack metadata validation Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 05/21] x86/stacktool: Add file and directory ignores Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 06/21] x86/stacktool: Add ignore macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 07/21] x86/xen: Add stack frame dependency to hypercall inline asm calls Josh Poimboeuf
2015-09-09 13:30 ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 08/21] x86/paravirt: Add stack frame dependency to PVOP " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 09/21] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 10/21] x86/amd: Set ELF function type for vide() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 11/21] x86/reboot: Add ljmp instructions to stacktool whitelist Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 12/21] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stacktool whitelists Josh Poimboeuf
2015-09-09 13:31 ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 13/21] x86/asm/crypto: Create stack frames in aesni-intel_asm.S Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 14/21] x86/asm/crypto: Move .Lbswap_mask data to .rodata section Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 15/21] x86/asm/crypto: Move jump_table " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 16/21] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 17/21] x86/asm/entry: Create stack frames in thunk functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 18/21] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 19/21] x86/asm: Create stack frames in rwsem functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 20/21] x86/asm/efi: Create a stack frame in efi_call() Josh Poimboeuf
2015-09-09 13:22 ` Josh Poimboeuf [this message]
2015-09-15 16:57 ` [PATCH v12 00/21] Compile-time stack metadata validation Chris J Arges
2015-09-15 18:11 ` Josh Poimboeuf
2015-09-17 22:14 ` [PATCH 0/3] A few stacktool warning fixes Chris J Arges
2015-09-17 22:14 ` [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm Chris J Arges
2015-09-18 13:57 ` Josh Poimboeuf
2015-09-17 22:14 ` [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files Chris J Arges
2015-09-18 13:57 ` Josh Poimboeuf
2015-09-17 22:14 ` [PATCH 3/3] kprobes/x86: stacktool: ignore kretprobe_trampoline_holder Chris J Arges
2015-09-18 14:04 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c0736739c1dccdce3ead1dcf0552cb07fa0e2d4b.1441749989.git.jpoimboe@redhat.com \
--to=jpoimboe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=bernd@petrovitsch.priv.at \
--cc=bp@alien8.de \
--cc=chris.j.arges@canonical.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=mmarek@suse.cz \
--cc=namhyung@gmail.com \
--cc=palves@redhat.com \
--cc=pavel@ucw.cz \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®