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.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_MUTT autolearn=unavailable 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 4C285C28CC2 for ; Wed, 29 May 2019 09:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 269F720B7C for ; Wed, 29 May 2019 09:03:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ujCnVLHX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbfE2JDs (ORCPT ); Wed, 29 May 2019 05:03:48 -0400 Received: from merlin.infradead.org ([205.233.59.134]:60844 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbfE2JDs (ORCPT ); Wed, 29 May 2019 05:03:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=DQecSnjdhg6zaZt0Sm+a9voWoeWmhZYoxUEy6QCaRzg=; b=ujCnVLHXd3svo0YUlFR+yRj41 NfM8tDeaWnjSh4BH8141kURu7wQ4RIBK4RryFX7XjTYCAPKHQTTE568TKC7nKa3OwddUxxADTNb/K O1FGblx9WzUKZb+yn07+yc5QIO4BhwIubOxLXuwpdwrrqxi2YyA8bUlVfU53ZhBvqyQklYmODyFDB TsJACk7PpPhbAr7HcA4UKNXCuHt0HIgfA0TKe/SEEh0sIhzS781jKbAOOn73xcFTVBhhn1p0SsafH MkjVKuzIYtswUA0BP+KjJIyS6m3ySpsPWkZCibV/0snf5/ct28YMIH7LN0hhxggX5MCnCxMX6yQkH pJIQMWO3g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVuUd-0002lp-SK; Wed, 29 May 2019 09:03:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 56E9C201A7E42; Wed, 29 May 2019 11:03:30 +0200 (CEST) Date: Wed, 29 May 2019 11:03:30 +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] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume Message-ID: <20190529090330.GI2623@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 Tue, May 28, 2019 at 11:31:45PM +0200, Jiri Kosina wrote: > diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c > index a7d966964c6f..bde8ce1f6c6c 100644 > --- a/arch/x86/power/cpu.c > +++ b/arch/x86/power/cpu.c > @@ -299,9 +299,20 @@ 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. > */ > smp_ops.play_dead = resume_play_dead; Oooh, teh yuck!, but this explains my confusion from the other thread. > + ret = cpuhp_smt_enable(); > + if (ret) > + goto out; > ret = disable_nonboot_cpus(); > +out: > smp_ops.play_dead = play_dead; > return ret; > } I think you can avoid the goto like: 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; return ret; We don't need the play dead change to online CPUs.