Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6055768ybi; Wed, 29 May 2019 02:05:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1xPLW9krZFsVYFd2XTlzNi8fNga8vtdvtroyDeTxVcE2gGRx+ZBErIjL2O5HzXxlEtg8g X-Received: by 2002:a63:1b0e:: with SMTP id b14mr26362009pgb.365.1559120715862; Wed, 29 May 2019 02:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559120715; cv=none; d=google.com; s=arc-20160816; b=dvqmteeZMoF3RHBU7U6JCX88mksS7Dkeda9GmmGjzcZRtoSpFmjMzQ+7d0TprvM5UK //YU3i2sBTNmQ2aj+oIF7M95FSw2FpIPmhO/jO0T1ElFUC4gBQmoT9NrH+EtfjWu9fsO XG7KPKVLvDgBlz6XkMBkMTap0se3/LTSqE3AZ6ElpcVsbLd2kqRLP0wH2IKlXXekWvQK 3x6Mp6mOKZjIcnXJU2IHnfK+tiFA2ztl/Bf7Ds31gEi2yyLVS5rYaWUELxgwYXqnV1b7 NXw8JHVbR9vekp852Ve/mnuQ+cFYsZuWMJWyIp2WUpKHxT+p2xjR8nR4gHq8a9IhR8Fz Bx0A== 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=DQecSnjdhg6zaZt0Sm+a9voWoeWmhZYoxUEy6QCaRzg=; b=Y9cVxSXoLPS9EZ7nLomnU1Bw9tDGJKOr4GaDk1Bo7buPB4y2VjouUE9em+rlWP47eO UDBHQoX4ydW2SAiUcagrIdQ8+7/A54J9qcmYjk++0xDrNmHQMEIPoB2XaHYVU4XBUfqE 0ExAA9aeAeM+zkegat2IFuit9QB7gQx2a02iRFwYYud1S294PpuMerPxK/PHMncTkmGG wKoHoAXdktfki7SZHHQOnrYCEpcG+rYdzndDR17ALHqhGYy+5KREvUkbsZCMbClfN/C5 jqvAqlP00a0bct1rrsWCaLGJYWbj6WhbBSzRjZvKxJDB8TRE5SqQAtJqBeLwm5wdatq3 q2uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ujCnVLHX; 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 z5si6263645pjq.90.2019.05.29.02.04.58; Wed, 29 May 2019 02:05:15 -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=merlin.20170209 header.b=ujCnVLHX; 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 S1726069AbfE2JDs (ORCPT + 99 others); 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.