summaryrefslogtreecommitdiff
path: root/arch/x86/power/hibernate_asm_64.S
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-08-03 02:19:26 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-08-03 02:35:38 +0300
commitc226fab474291e3c6ac5fa30a2b0778acc311e61 (patch)
tree99ceb9f917865e4aa4559cb503bec8191cf43ac5 /arch/x86/power/hibernate_asm_64.S
parent4ce827b4cc58bec7952591b96cce2b28553e4d5b (diff)
downloadlinux-c226fab474291e3c6ac5fa30a2b0778acc311e61.tar.xz
x86/power/64: Do not refer to __PAGE_OFFSET from assembly code
When CONFIG_RANDOMIZE_MEMORY is set on x86-64, __PAGE_OFFSET becomes a variable and using it as a symbol in the image memory restoration assembly code under core_restore_code is not correct any more. To avoid that problem, modify set_up_temporary_mappings() to compute the physical address of the temporary page tables and store it in temp_level4_pgt, so that the value of that variable is ready to be written into CR3. Then, the assembly code doesn't have to worry about converting that value into a physical address and things work regardless of whether or not CONFIG_RANDOMIZE_MEMORY is set. Reported-and-tested-by: Thomas Garnier <thgarnie@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86/power/hibernate_asm_64.S')
-rw-r--r--arch/x86/power/hibernate_asm_64.S2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S
index 8eee0e9c93f0..ce8da3a0412c 100644
--- a/arch/x86/power/hibernate_asm_64.S
+++ b/arch/x86/power/hibernate_asm_64.S
@@ -72,8 +72,6 @@ ENTRY(restore_image)
/* code below has been relocated to a safe page */
ENTRY(core_restore_code)
/* switch to temporary page tables */
- movq $__PAGE_OFFSET, %rcx
- subq %rcx, %rax
movq %rax, %cr3
/* flush TLB */
movq %rbx, %rcx