Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp599977ybi; Thu, 30 May 2019 03:50:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh82/9F1GNsTR9yrevv84BcD8wuuS2kGGXbi5fbB+mrGb3RnyDAO8dHkWGb7jCn7XXagKQ X-Received: by 2002:a62:ac0c:: with SMTP id v12mr3146543pfe.59.1559213420160; Thu, 30 May 2019 03:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559213420; cv=none; d=google.com; s=arc-20160816; b=azEMRP72rENeMhiL9EBBYMCbg4TEFX2CdLVm6bIl7HWxC0j4kxc4vV6SUSd6K6huQh 3mKhVhTxu28zXfM2Y6Aq1+mymUdp83vNlGFCQG9EelDYRatk7l0v1orXu5wYsnEvNUzq 8jP5neQVcCsLB/zx27NMSRtsH+p+5VE3Gq6WUlZnt7nys4ELEgZ4R6BmjQmzJZ8kUeyI kmUA/HTUBJzgeZGoSPbx6fH8fmdRfmTYE5ocpU5P1C+iMWfqZm9+yybVQsmmUVnXK6JZ qcjVHY/qKtywqua34/d3friYDOliRggf1ps0UNd9NS2Cr14L8zxw2Q37URdGiH2S/iS2 eR1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Q08fgs4GFj6nfm5yVm6KC3sTXYPHuAwQ0ZxJdKn+KS0=; b=CFljy6cgM4AwthkvZ/vkVGTH7ZVAJ5JNO/cWeRNeR8Zu+ENHc2Uo61AuNbleZj9T65 jo1nDQepkzccEqHuFTdLAHOden4kMcad1IqEyvRJn9JXdbOnCC0zC7aCTVTuuQ6DHiSW XqFz2myVqZr2fC1TpiqqD86iKzJS7Z3hiNJKiU4KPtDj7orFe+yRonfMbLnyHhf5y7VF BwbaFqJ4GhLmS4neHdCeQlG16xnh6bErXUpvNJ7g3PixRumZKLwWC0/s9gZ9eoZ3UUbi uu+UaUOllfwGa3ispf/V2n6ub1IyV1LPHiTiPkEv5yC16HZgiMp6a6GzktMT7aaBuSxJ KgrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si3005560pfh.28.2019.05.30.03.50.03; Thu, 30 May 2019 03:50:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbfE3Krp (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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--