From: Pavel Machek <pavel@ucw.cz>
To: Chen Yu <yu.c.chen@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>, joeyli <jlee@suse.com>,
Borislav Petkov <bp@alien8.de>,
linux-pm@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org, Lee@nazgul.tnic
Subject: Re: [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value
Date: Fri, 9 Sep 2016 09:33:50 +0200 [thread overview]
Message-ID: <20160909073349.GA16066@amd> (raw)
In-Reply-To: <20160909073642.GA1558@sharon>
On Fri 2016-09-09 15:36:42, Chen Yu wrote:
> Hi Pavel,
> On Thu, Sep 08, 2016 at 11:15:52PM +0200, Pavel Machek wrote:
> > On Tue 2016-08-30 13:54:44, Rafael J. Wysocki wrote:
> > > On Tuesday, August 30, 2016 04:35:05 PM joeyli wrote:
> > > > On Mon, Aug 29, 2016 at 03:41:23PM +0200, Borislav Petkov wrote:
> > > > > On Mon, Aug 29, 2016 at 09:15:00AM +0200, Pavel Machek wrote:
> > > > > > Sounds about as easy as hot unplugging arbitrary memory address. IOW
> > > > > > "not easy".
> > > > >
> > > > > Regardless, forcibly panicking the system more is still the wrong
> > > > > approach IMO.
> > > > >
> > > > > Instead, I'd try to issue a big fat warning that BIOS corrupts E820 and
> > > > > that the user should disable hibernation on that box and never ever
> > > > > enable it again.
> > > > >
> > > > > After that, the kernel should *disable* hibernation for the current boot
> > > > > so any further hibernation runs don't even happen. Maybe even taint
> > > > > itself.
> > > > >
> > > >
> > > > I support this idea to disable hibernation when kernel detected e820 layout
> > > > was changed by BIOS. If system resume luckily then kernel should warn to user
> > > > and refuse to hibernate again. User must to know that's better to reboot
> > > > system when he saw the warning message after lucky resume.
> > > >
> > > > Not just BIOS doesn't fix e820 layout. There have some machines doesn't provide
> > > > _S4_ function, so the hibernation fallbacks to "shutdown" mode because "platform"
> > > > mode unavailable. In this situation, user is just lucky to run the hibernation.
> > > > Kernel should warn to user and disable hibernation when detected e820 layout
> > > > changed.
> > >
> > > Well, please see my reply to Boris.
> > >
> > > Pavel is right that running after detecting an e820 mismatch is generally risky,
> > > so why don't we shut down the system (but try to do that cleanly instead of
> > > causing it to panic right away) on an e820 mismatch?
> >
> > I don't think that's good idea.
> >
> > Anything involving userspace is risky at that point, and clean
> > shutdown means a _lot_ of userspace.
> >
> > We know the filesystems are reasonably clean as we sync-ed
> > them; I believe right solution is to panic -- on-disk state is pretty
> > good and we don't want to do anything risky.
> >
> OK, we tried a milder solution that doesn't shutdown the system in the
> latest version, which terminates the restore process if a mismatch is found
> (hope people would be happy with that one :)
Actually, terminating the restore process is fine. Restoring into the
old state with different memory map and then attempting to shut down
would not be.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2016-09-09 7:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-28 16:35 [PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value Chen Yu
2016-08-28 16:36 ` Pavel Machek
2016-08-29 4:59 ` Borislav Petkov
2016-08-29 7:15 ` Pavel Machek
2016-08-29 13:41 ` Borislav Petkov
2016-08-30 8:35 ` joeyli
2016-08-30 11:54 ` Rafael J. Wysocki
2016-09-08 21:15 ` Pavel Machek
2016-09-09 7:36 ` Chen Yu
2016-09-09 7:33 ` Pavel Machek [this message]
2016-08-30 11:51 ` Rafael J. Wysocki
2016-08-29 13:41 ` Rafael J. Wysocki
2016-08-29 15:13 ` Pavel Machek
2016-08-30 12:04 ` Rafael J. Wysocki
2016-08-30 19:53 ` Pavel Machek
2016-08-30 21:50 ` Rafael J. Wysocki
2016-08-31 11:03 ` Pavel Machek
2016-08-31 0:27 ` Rafael J. Wysocki
2016-08-31 11:07 ` Pavel Machek
2016-08-31 11:43 ` Pavel Machek
2016-08-31 11:54 ` Rafael J. Wysocki
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=20160909073349.GA16066@amd \
--to=pavel@ucw.cz \
--cc=Lee@nazgul.tnic \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jlee@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--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).