Skip to content

Fixes hibernation bugs on x86-32 system

Gu Zhimin linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86, hibernate: Fix nosave_regions setup for hibernationarch/x86/kernel/setup.c+1 -13 replies
2/3x86, hibernate: Extract the common code of 64/32 bit systemarch/x86/power/hibernate.c arch/x86/power/hibernate_32.c arch/x86/power/hibernate_64.c +1 more+259 -2613 replies
3/3x86, hibernate: Backport several fixes from 64bits to 32bits hibernationarch/x86/Kconfig arch/x86/include/asm/suspend_32.h arch/x86/power/hibernate.c +2 more+95 -160 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchChen YuPavel Machek
1/3A-b A-b
2/3A-b A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Fixes hibernation bugs on x86-32 system

From: Zhimin Gu <[email protected]>

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

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        | 253 ++++++++++++++++++++++++++++++++++++++
 arch/x86/power/hibernate_32.c     |  76 ++++++++----
 arch/x86/power/hibernate_64.c     | 241 +-----------------------------------
 arch/x86/power/hibernate_asm_32.S |  49 ++++++--
 arch/x86/power/hibernate_asm_64.S |   2 +-
 8 files changed, 353 insertions(+), 276 deletions(-)
 create mode 100644 arch/x86/power/hibernate.c
Signature · 1 line
2.7.4