Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp948452ybi; Fri, 31 May 2019 11:12:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBPu+r4bKcB5ZFY02cXQ8whLfWKgrcKDYhiAm0+RXUJQ3Drmxa3S/oxLUeZ0RPhfzQwU+Y X-Received: by 2002:a17:90a:6505:: with SMTP id i5mr9248667pjj.13.1559326377703; Fri, 31 May 2019 11:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559326377; cv=none; d=google.com; s=arc-20160816; b=pSUQnpTdQ1OcWqwpKU48kuUsACMfJ6OOIe/HuV1Lz04iAVIeNl/huTq+0BwuPo11QL C/V/Hmc5JHuf6qPxVt+ctAvMWYrDOmzVfGrQBxSoJ08UUg3jJzsHO8YA+mBDSqD48JeA MP9cxIWc6NlSwTEA90Gc4BjEth0JihOLELlGR4mG1SpOxn4PGIXnAsrGED5wnIEmIBz2 QZf9/p01ItZKYpc0kBc8U46FQQ3acbx5CU4QTyAT0zB8XosVYlNuSctQV2E8KFBZRZ6h uEF3marzX6uCHVcI4b4UeluyoAbybczrWfQXnKOn1f4JvGZNlH6SJJyCZMNWPY3nT66Q XmfA== 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=aGXNfcNXKRSPDwDHYKL+ESj4QW/Yqxe94kw/rSyPbYg=; b=X8Nx0jeoD4dGHhky8a9Yd5WZfjk/NDS+IyokQoQ+/xqHW2vprKY6xJ1iHbmgXnEDCb PWgNS5S4wKoNPUQ+EAbg/LkMliuCULk+1yIuVoA9bSSGyHVD7s/gbSF26jCAioup/KOK 78T3T3QbUgiOP5cxEEYZhekpD24sci2K7SulKfMGH3UI+ElCI+DAB02jVyRT4G5vVfpV PjHq6VNIO71gItxw/+vtDzBpBcHd1f2HqKDA+gkLCTct9hmN+G2hC37FX1SBU5I1heeR ks5xAB1THBmT08m+wXQp9OPWLLWguyHeLI5l4OblNW0vMVC2ii91Dm/eOgjajLKGsXAv 4LmA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si7786443pff.14.2019.05.31.11.12.41; Fri, 31 May 2019 11:12:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfEaSLh (ORCPT + 99 others); Fri, 31 May 2019 14:11:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbfEaSLg (ORCPT ); Fri, 31 May 2019 14:11:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7588A3086228; Fri, 31 May 2019 18:11:36 +0000 (UTC) Received: from treble (ovpn-124-142.rdu2.redhat.com [10.10.124.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7CA31017E30; Fri, 31 May 2019 18:11:32 +0000 (UTC) Date: Fri, 31 May 2019 13:11:30 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Jiri Kosina , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Thomas Gleixner , the arch/x86 maintainers , Pavel Machek , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra , Linux PM , Linux Kernel Mailing List Subject: Re: [PATCH v4] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume Message-ID: <20190531181130.afwizqcwibm5dmml@treble> References: <5564116.e9OFvgDRbB@kreacher> <20190531152626.4nmyc7lj6mjwuo2v@treble> <20190531161952.dps3grwg4ytrpuqw@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 31 May 2019 18:11:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 09:51:09AM -0700, Andy Lutomirski wrote: > Just to clarify what I was thinking, it seems like soft-offlining a > CPU and resuming a kernel have fundamentally different requirements. > To soft-offline a CPU, we want to get power consumption as low as > possible and make sure that MCE won't kill the system. It's okay for > the CPU to occasionally execute some code. For resume, what we're > really doing is trying to hand control of all CPUs from kernel A to > kernel B. There are two basic ways to hand off control of a given > CPU: we can jump (with JMP, RET, horrible self-modifying code, etc) > from one kernel to the other, or we can attempt to make a given CPU > stop executing code from either kernel at all and then forcibly wrench > control of it in kernel B. Either approach seems okay, but the latter > approach depends on getting the CPU to reliably stop executing code. > We don't care about power consumption for resume, and I'm not even > convinced that we need to be able to survive an MCE that happens while > we're resuming, although surviving MCE would be nice. I'd thought you were proposing a global improvement: we get rid of mwait_play_dead() everywhere, i.e. all the time, not just for the resume path. Instead it sounds like you were proposing a local improvement to the resume path, to continue doing what hibernate_resume_nonboot_cpu_disable() is already doing, but use an INIT IPI instead of HLT to make sure the CPU is completely dead. That may be a theoretical improvement but we'd still need to do the whole "wake and play dead" dance which Jiri's patch is doing for offline CPUs. So Jiri's patch looks ok to me. -- Josh