From: Pavel Machek <pavel@ucw.cz>
To: Jiri Kosina <jikos@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
x86@kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume
Date: Thu, 30 May 2019 12:47:42 +0200 [thread overview]
Message-ID: <20190530104741.GA12800@amd> (raw)
In-Reply-To: <nycvar.YFH.7.76.1905300007470.1962@cbobk.fhfr.pm>
[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]
On Thu 2019-05-30 00:09:39, Jiri Kosina wrote:
> From: Jiri Kosina <jkosina@suse.cz>
>
> As explained in
>
> 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")
>
> we always, no matter what, have to bring up x86 HT siblings during boot at
> least once in order to avoid first MCE bringing the system to its knees.
>
> That means that whenever 'nosmt' is supplied on the kernel command-line,
> all the HT siblings are as a result sitting in mwait or cpudile after
> going through the online-offline cycle at least once.
>
> This causes a serious issue though when a kernel, which saw 'nosmt' on its
> commandline, is going to perform resume from hibernation: if the resume
> from the hibernated image is successful, cr3 is flipped in order to point
> to the address space of the kernel that is being resumed, which in turn
> means that all the HT siblings are all of a sudden mwaiting on address
> which is no longer valid.
>
> That results in triple fault shortly after cr3 is switched, and machine
> reboots.
>
> Fix this by always waking up all the SMT siblings before initiating the
> 'restore from hibernation' process; this guarantees that all the HT
> siblings will be properly carried over to the resumed kernel waiting in
> resume_play_dead(), and acted upon accordingly afterwards, based on the
> target kernel configuration.
> Symmetricaly, the resumed kernel has to push the SMT siblings to mwait
> again in case it has SMT disabled; this means it has to online all
> the siblings when resuming (so that they come out of hlt) and offline
> them again to let them reach mwait.
>
> Cc: stable@vger.kernel.org # v4.19+
> Debugged-by: Thomas Gleixner <tglx@linutronix.de>
> Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
prev parent reply other threads:[~2019-05-30 10:47 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 21:31 [PATCH] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume Jiri Kosina
2019-05-29 8:06 ` Rafael J. Wysocki
2019-05-29 9:03 ` Peter Zijlstra
2019-05-29 10:32 ` [PATCH v2] " Jiri Kosina
2019-05-29 12:02 ` Peter Zijlstra
2019-05-29 16:10 ` Josh Poimboeuf
2019-05-29 16:26 ` Jiri Kosina
2019-05-29 17:00 ` Peter Zijlstra
2019-05-29 17:15 ` Thomas Gleixner
2019-05-29 17:17 ` Josh Poimboeuf
2019-05-29 17:29 ` Jiri Kosina
2019-05-29 18:02 ` Jiri Kosina
2019-05-29 20:26 ` [PATCH v3] " Jiri Kosina
2019-05-29 21:25 ` Pavel Machek
2019-05-29 21:27 ` Jiri Kosina
2019-05-29 21:53 ` Pavel Machek
2019-05-29 22:09 ` [PATCH v4] " Jiri Kosina
2019-05-30 8:46 ` Rafael J. Wysocki
2019-05-30 21:27 ` Thomas Gleixner
2019-05-30 21:38 ` Rafael J. Wysocki
2019-05-30 23:38 ` Josh Poimboeuf
2019-05-30 23:42 ` Jiri Kosina
2019-05-31 5:14 ` Josh Poimboeuf
2019-05-31 8:26 ` Rafael J. Wysocki
2019-05-31 8:47 ` Jiri Kosina
2019-05-31 8:57 ` Rafael J. Wysocki
2019-05-31 14:24 ` Andy Lutomirski
2019-05-31 14:31 ` Jiri Kosina
2019-05-31 14:33 ` Jiri Kosina
2019-05-31 14:46 ` Andy Lutomirski
2019-05-31 14:54 ` Jiri Kosina
2019-05-31 15:26 ` Josh Poimboeuf
2019-05-31 15:41 ` Jiri Kosina
2019-05-31 16:19 ` Josh Poimboeuf
2019-05-31 16:51 ` Andy Lutomirski
2019-05-31 18:11 ` Josh Poimboeuf
2019-06-03 10:03 ` Rafael J. Wysocki
2019-05-31 16:23 ` Andy Lutomirski
2019-05-31 21:05 ` Jiri Kosina
2019-05-31 21:22 ` Andy Lutomirski
2019-06-03 14:23 ` Sean Christopherson
2019-06-03 15:24 ` Jiri Kosina
2019-06-03 16:18 ` Sean Christopherson
2019-05-31 12:09 ` Jiri Kosina
2019-05-31 14:51 ` Jiri Kosina
2019-05-31 12:18 ` Pavel Machek
2019-05-30 10:47 ` Pavel Machek [this message]
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=20190530104741.GA12800@amd \
--to=pavel@ucw.cz \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jikos@kernel.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.