Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6236634ybi; Wed, 29 May 2019 05:05:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwS/gKINjZ+WZ9arWx1qzUg29nRtzP8tbsU90A8U7l3cGUZrB4cNZxWzIxhvThn1rCkzVxB X-Received: by 2002:a65:4907:: with SMTP id p7mr136107845pgs.288.1559131504172; Wed, 29 May 2019 05:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559131504; cv=none; d=google.com; s=arc-20160816; b=hm3hqiMLTfonzA7VQG7zw9zWj8cdWVB1M6fN0MtEOjWRU06qJk6/4iJitxxWyKnrBu TMDCEmE8KEUhdmGBNx6ysARXqtX5tI7PwLehnYtZAHJbXpXhuvN75KrRyU/h0Y79y7WB 6pJS10n64e+qU98kYO/AGujz8gly+IogX6vxlU4M3LGeNYHnrq+YXSrulG8h9wKNUkc9 PdSSuTAFW0zpMNBc0KaO/4AgRm2z0prb7Wy9hPvQymrtG6OLcrdCSrcgXH8u1GqQ9pq5 8YQsZd8bI1fKmnDIY+ACRp0bhTOp2DnEWopAZYlhMJmdZooJAijUOwKkyZnweyB6CgGC Z2vQ== 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:dkim-signature; bh=8F19KGAZnZsYq954iIK5bGPIBzMRDalxLayfTO4ouik=; b=tnTe/up1O2kNdtU0G3swfEikXVT3lRd64fZNz8J0pb5jaeCZoXLMu8WMtVaRT0Hnmc nxoLQyz3DOTD/L5GsEoh4emEGBuqqqCDs1/Jabd9ABfLHq+CaKXm67kfgLPk1BZ+v1ab LD7oqv5ykCRQTwavKyHMYRQAuujOYM3xl8LRfVJ0Zl+424eX4ifAdjeBb4PW88/TIZTe 0VerSaxlkh6vSNZ+gM+e7Urv15lOaESJFKMEjIXPEdWmuPHHqC8UJqEq1xFFJxLYvZQ/ jum8JDejeqNA4ggf9CPLirguk+hYKtZFUNOhRadG3jYJ12xoFU9agB2irdrPNJCC8qDT PqjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cLIGY6k6; 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 n4si25520696pff.62.2019.05.29.05.04.45; Wed, 29 May 2019 05:05:04 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cLIGY6k6; 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 S1726901AbfE2MCd (ORCPT + 99 others); Wed, 29 May 2019 08:02:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58894 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfE2MCd (ORCPT ); Wed, 29 May 2019 08:02:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8F19KGAZnZsYq954iIK5bGPIBzMRDalxLayfTO4ouik=; b=cLIGY6k6tiRv6LJ7woNdIZOmj z+VpD4wgAYSX3G/TuI6kMVam8b7tVY/c7h86sYGWVViMx6L8TzJ9cQFouIiFjJyVznSvCWzSAlnTj v4gBkGyUmqikF/ulWNpmLorECffy7rmfFuBEoEc5SWnVGH8X+XZEIwOIXzk23rTPdik8m00rbCFKi oCRZGKuiQmih82YkVMd43UWFd4KcFeOOL3ex+OziGqIljL0yA24BrPHmf+YJXzqy/uq4heoRX3KTt 0+1ABZ2Q/jSAQ21kUBGBsi0qtWuDyZJDNrjFRADyGNNJZvXUTG91xTwLOQdqCD8cZbzHODRqxQmQk HL1dd1IFA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVxHh-0003nt-7y; Wed, 29 May 2019 12:02:21 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C3730201DA657; Wed, 29 May 2019 14:02:19 +0200 (CEST) Date: Wed, 29 May 2019 14:02:19 +0200 From: Peter Zijlstra To: Jiri Kosina Cc: "Rafael J. Wysocki" , Pavel Machek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Josh Poimboeuf , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume Message-ID: <20190529120219.GS2623@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 12:32:02PM +0200, Jiri Kosina wrote: > arch/x86/power/cpu.c | 10 ++++++++++ > include/linux/cpu.h | 2 ++ > kernel/cpu.c | 2 +- > 3 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c > index a7d966964c6f..513ce09e9950 100644 > --- a/arch/x86/power/cpu.c > +++ b/arch/x86/power/cpu.c > @@ -299,7 +299,17 @@ int hibernate_resume_nonboot_cpu_disable(void) > * address in its instruction pointer may not be possible to resolve > * any more at that point (the page tables used by it previously may > * have been overwritten by hibernate image data). > + * > + * First, make sure that we wake up all the potentially disabled SMT > + * threads which have been initially brought up and then put into > + * mwait/cpuidle sleep. > + * Those will be put to proper (not interfering with hibernation > + * resume) sleep afterwards, and the resumed kernel will decide itself > + * what to do with them. > */ > + ret = cpuhp_smt_enable(); > + if (ret) > + return ret; > smp_ops.play_dead = resume_play_dead; > ret = disable_nonboot_cpus(); > smp_ops.play_dead = play_dead; Acked-by: Peter Zijlstra (Intel)