x86-32, hibernate: Switch to original page table after resumed
authorZhimin Gu <kookoo.gu@intel.com>
Fri, 21 Sep 2018 06:28:11 +0000 (14:28 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Oct 2018 09:56:34 +0000 (11:56 +0200)
commit32aa276437f6128df63111af13e57fe8f0272af3
tree58a65d9e86baba9db8ba38c66eea8bd0a7d8e3fd
parent0b0a6b1f76835cbaf746e7c72edd374ec0fe818b
x86-32, hibernate: Switch to original page table after resumed

After all the pages are restored to previous address, the page
table switches back to current swapper_pg_dir. However the
swapper_pg_dir currently in used might not be consistent with
previous page table, which might cause issue after resume.

Fix this issue by switching to original page table after resume,
and the address of the original page table is saved in the hibernation
image header.

Move the manipulation of restore_cr3 into common code blocks.

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.c
arch/x86/power/hibernate_asm_32.S