From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C86BBC28CC0 for ; Thu, 30 May 2019 10:47:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A470525799 for ; Thu, 30 May 2019 10:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfE3Krp (ORCPT ); Thu, 30 May 2019 06:47:45 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:48105 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbfE3Krp (ORCPT ); Thu, 30 May 2019 06:47:45 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 7E3A7802E3; Thu, 30 May 2019 12:47:32 +0200 (CEST) Date: Thu, 30 May 2019 12:47:42 +0200 From: Pavel Machek To: Jiri Kosina Cc: "Rafael J. Wysocki" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Josh Poimboeuf , Peter Zijlstra , 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 Message-ID: <20190530104741.GA12800@amd> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2019-05-30 00:09:39, Jiri Kosina wrote: > From: Jiri Kosina >=20 > As explained in >=20 > 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") >=20 > 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. >=20 > 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. >=20 > 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. >=20 > That results in triple fault shortly after cr3 is switched, and machine > reboots. >=20 > 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. >=20 > Cc: stable@vger.kernel.org # v4.19+ > Debugged-by: Thomas Gleixner > Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") > Signed-off-by: Jiri Kosina Acked-by: Pavel Machek --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzvtM0ACgkQMOfwapXb+vK9VQCeMCaAPxQHm2kR8tQhJTkYBmOm ZAcAoJtFwZcYrRfwjRiTD09ViNtMcVd2 =LKEq -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--