linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gu Zhimin <kookoo.gu@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Pavel Machek <pavel@ucw.cz>, Yu Chen <yu.c.chen@intel.com>,
	x86@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Zhimin Gu <kookoo.gu@intel.com>
Subject: [PATCH 0/3] Fixes hibernation bugs on x86-32 system
Date: Mon, 27 Aug 2018 17:41:18 +0800	[thread overview]
Message-ID: <cover.1535361949.git.kookoo.gu@intel.com> (raw)

From: Zhimin Gu <kookoo.gu@intel.com>

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

-- 
2.7.4

             reply	other threads:[~2018-08-27  9:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27  9:41 Gu Zhimin [this message]
2018-08-27  9:42 ` [PATCH 1/3] x86, hibernate: Fix nosave_regions setup for hibernation Gu Zhimin
2018-08-27  9:48   ` Pavel Machek
2018-08-30 12:45   ` Thomas Gleixner
2018-09-01 15:38     ` Yu Chen
2018-08-27  9:42 ` [PATCH 2/3] x86, hibernate: Extract the common code of 64/32 bit system Gu Zhimin
2018-08-27  9:48   ` Pavel Machek
2018-08-30 12:59   ` Thomas Gleixner
2018-09-01 15:45     ` Yu Chen
2018-08-27  9:42 ` [PATCH 3/3] x86, hibernate: Backport several fixes from 64bits to 32bits hibernation Gu Zhimin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1535361949.git.kookoo.gu@intel.com \
    --to=kookoo.gu@intel.com \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).