diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-29 17:34:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-29 17:34:55 -0400 |
commit | 601f887d6105ddd28dc569a1504595bdf8df8a5b (patch) | |
tree | 1b32014100ab43daf743f3b43916f4e050b49a6a | |
parent | 574c7e233344b58c6b14b305c93de361d3e7d35d (diff) | |
parent | e148d0f85cc3e9f2802c7fcf451098c6d19b535b (diff) |
Merge tag 'pm-urgent-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki:
"Fix a nasty (and really hard to debug) memory corruption during resume
from hibernation on x86-64 (that leads to a kernel panic most of the
time) due to the use of a stale stack pointer value in FRAME_BEGIN
(Josh Poimboeuf)"
* tag 'pm-urgent-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
x86/power/64: Fix hibernation return address corruption
-rw-r--r-- | arch/x86/power/hibernate_asm_64.S | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S index 3177c2bc26f6..8eee0e9c93f0 100644 --- a/arch/x86/power/hibernate_asm_64.S +++ b/arch/x86/power/hibernate_asm_64.S | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <asm/frame.h> | 24 | #include <asm/frame.h> |
25 | 25 | ||
26 | ENTRY(swsusp_arch_suspend) | 26 | ENTRY(swsusp_arch_suspend) |
27 | FRAME_BEGIN | ||
28 | movq $saved_context, %rax | 27 | movq $saved_context, %rax |
29 | movq %rsp, pt_regs_sp(%rax) | 28 | movq %rsp, pt_regs_sp(%rax) |
30 | movq %rbp, pt_regs_bp(%rax) | 29 | movq %rbp, pt_regs_bp(%rax) |
@@ -48,6 +47,7 @@ ENTRY(swsusp_arch_suspend) | |||
48 | movq %cr3, %rax | 47 | movq %cr3, %rax |
49 | movq %rax, restore_cr3(%rip) | 48 | movq %rax, restore_cr3(%rip) |
50 | 49 | ||
50 | FRAME_BEGIN | ||
51 | call swsusp_save | 51 | call swsusp_save |
52 | FRAME_END | 52 | FRAME_END |
53 | ret | 53 | ret |
@@ -104,7 +104,6 @@ ENTRY(core_restore_code) | |||
104 | /* code below belongs to the image kernel */ | 104 | /* code below belongs to the image kernel */ |
105 | .align PAGE_SIZE | 105 | .align PAGE_SIZE |
106 | ENTRY(restore_registers) | 106 | ENTRY(restore_registers) |
107 | FRAME_BEGIN | ||
108 | /* go back to the original page tables */ | 107 | /* go back to the original page tables */ |
109 | movq %r9, %cr3 | 108 | movq %r9, %cr3 |
110 | 109 | ||
@@ -145,6 +144,5 @@ ENTRY(restore_registers) | |||
145 | /* tell the hibernation core that we've just restored the memory */ | 144 | /* tell the hibernation core that we've just restored the memory */ |
146 | movq %rax, in_suspend(%rip) | 145 | movq %rax, in_suspend(%rip) |
147 | 146 | ||
148 | FRAME_END | ||
149 | ret | 147 | ret |
150 | ENDPROC(restore_registers) | 148 | ENDPROC(restore_registers) |