x86-32, hibernate: Use temp_pgt as the temporary page table
authorZhimin Gu <kookoo.gu@intel.com>
Fri, 21 Sep 2018 06:27:51 +0000 (14:27 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Oct 2018 09:56:34 +0000 (11:56 +0200)
This is to reuse the temp_pgt for both 32bit and 64bit
system.

No intentional behavior change.

Signed-off-by: Zhimin Gu <kookoo.gu@intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/x86/power/hibernate_32.c
arch/x86/power/hibernate_asm_32.S

index f82fbd2..a44bdad 100644 (file)
@@ -156,6 +156,8 @@ asmlinkage int swsusp_arch_resume(void)
        if (error)
                return error;
 
+       temp_pgt = __pa(resume_pg_dir);
+
        /* We have got enough memory and from now on we cannot recover */
        restore_image();
        return 0;
index 671d38d..f0627cf 100644 (file)
@@ -33,8 +33,7 @@ ENDPROC(swsusp_arch_suspend)
 
 ENTRY(restore_image)
        movl    mmu_cr4_features, %ecx
-       movl    resume_pg_dir, %eax
-       subl    $__PAGE_OFFSET, %eax
+       movl    temp_pgt, %eax
        movl    %eax, %cr3
 
        jecxz   1f      # cr4 Pentium and higher, skip if zero