linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4][v2] Fixes hibernation bugs on x86-32 system
@ 2018-09-11 17:19 Chen Yu
  2018-09-11 17:20 ` [PATCH 1/4][v2] x86, hibernate: Fix nosave_regions setup for hibernation Chen Yu
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Chen Yu @ 2018-09-11 17:19 UTC (permalink / raw)
  To: Thomas Gleixner, Rafael J. Wysocki
  Cc: Pavel Machek, Rui Zhang, Chen Yu, Zhimin Gu, Len Brown,
	linux-kernel, x86, linux-pm, Chen Yu

Currently there are mainly three bugs in x86-32 system when doing
hibernation:
1. The page copy code is not running in safe page, which might
   cause hang during resume.
2. There's no text mapping for the final jump address
   of the original kernel, which might cause the system jumping
   into illegal address and causes system hang during resume.
3. The restore kernel switches to its own kernel page table(swapper_pg_dir)
   rather than the original kernel page table after all the pages
   been copied back, which might cause invalid virtual-physical
   mapping issue during resume.

To solve these problems:

1. Copy the code core_restore_code to a safe page, to avoid the instruction
   code be overwriten when image kernel pages are being copied.
2. Set up temporary text mapping for the image kernel's jump address, so that
   after all the pages have been copied back, the system could jump to this address.
3. Switch to the original kernel page table during resume.

Furthermore, MD5 hash check for e820 map is also backported from 64bits

Chen Yu (1):
  PM / hibernate: Check the success of generating md5 digest before
    hibernation

Zhimin Gu (3):
  x86, hibernate: Fix nosave_regions setup for hibernation
  x86, hibernate: Extract the common code of 64/32 bit system
  x86, hibernate: Backport several fixes from 64bits to 32bits
    hibernation

 arch/x86/Kconfig                  |   2 +-
 arch/x86/include/asm/suspend_32.h |   4 +
 arch/x86/kernel/setup.c           |   2 +-
 arch/x86/power/hibernate.c        | 263 ++++++++++++++++++++++++++++++
 arch/x86/power/hibernate_32.c     |  60 ++++---
 arch/x86/power/hibernate_64.c     | 242 +--------------------------
 arch/x86/power/hibernate_asm_32.S |  49 +++++-
 arch/x86/power/hibernate_asm_64.S |   2 +-
 8 files changed, 350 insertions(+), 274 deletions(-)
 create mode 100644 arch/x86/power/hibernate.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-18 13:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 17:19 [PATCH 0/4][v2] Fixes hibernation bugs on x86-32 system Chen Yu
2018-09-11 17:20 ` [PATCH 1/4][v2] x86, hibernate: Fix nosave_regions setup for hibernation Chen Yu
2018-09-11 17:20 ` [PATCH 2/4][v2] PM / hibernate: Check the success of generating md5 digest before hibernation Chen Yu
2018-09-13  8:26   ` Thomas Gleixner
2018-09-13 14:00     ` Yu Chen
2018-09-11 17:20 ` [PATCH 3/4][v2] x86, hibernate: Extract the common code of 64/32 bit system Chen Yu
2018-09-14  9:21   ` Rafael J. Wysocki
2018-09-18 13:36     ` Yu Chen
2018-09-11 17:21 ` [PATCH 4/4][v2] x86, hibernate: Backport several fixes from 64bits to 32bits hibernation Chen Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).