Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1111511ybi; Fri, 31 May 2019 14:07:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1Xo6NjkE70b18jtQ8H+Md8ODtJ7nePgKPVZajy304GrVLiByzB8H13RK0cjnZvFKlb5Em X-Received: by 2002:a62:ac0c:: with SMTP id v12mr12894307pfe.59.1559336862166; Fri, 31 May 2019 14:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559336862; cv=none; d=google.com; s=arc-20160816; b=NtkVLkjhTiVxcJW2rdsLuQdreg/eRYjE5VtQF9FUnlI4sybRLb7HKQ6HPvlMRBDoB9 5if1Uw+WpReNRxJFIaXB3L1eR4ZRPVo1UUs2NRKLklv1o1siGxVl6eGflUhbaxIpcg8U Z3jovLogpAFWb5aMIHZc+T3AuhR924BjndwpKWXGKhz7ZSUmi63q5L7S0OaDsNkAZcXk syFtlR6H8ZrwjCXlL945J98DnW/18NKuhpC2ALjsk+Yqyu8H4mVILxY/NxM0J7br3Nct NCIhWHC3TPjAFP2t4wNy8Q4KZrb96Zmy38jyjxDvP5uDo4iJ895G3ebR2x5AU7JXd+91 +ueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=/DA/3+Tay1z+/+Lltsx56osiP6FVp6gFu5et+qHQKzE=; b=Q8yaTHadd10/2ppfy99dEzib3UoiUEv1BN2qwvM5txsB5FjJVGkIlbwfcqGBgIlTkx k/GQiTKBF61gvkjYb09+Swk/QAvzw3o2b1BJnRwcus2d61EEBKexrMDsByG4dE3gF3rY 8siazkcq7ARh0/wsUwfjniwmbRLuELYQ5bfHYWXQXbE+yVnxHgmmCuSipB1RgUSLcobD PaoxY/up/9FYzGOSS+xKIfg2f7hfmYnq1yAvUPqBRfE5KDwKrRY6lBkdCsl1tdk2tW5R N5PJJfrbTprtRbnjfX/cuzgNYy7KupJuzLMIFyMo5em/1hr7mhC39cXbOCZzx6c7L8pj mUTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uy0cmpr3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si7403909plq.297.2019.05.31.14.07.26; Fri, 31 May 2019 14:07:42 -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=pass header.i=@kernel.org header.s=default header.b=uy0cmpr3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727608AbfEaVFU (ORCPT + 99 others); Fri, 31 May 2019 17:05:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:49856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfEaVFU (ORCPT ); Fri, 31 May 2019 17:05:20 -0400 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 789C626F19; Fri, 31 May 2019 21:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559336719; bh=OyWxQmoLlrjhQfe/SkU8EcjxzVmOe+TJQ64dkJFwohQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=uy0cmpr3YnluHIkHBo3T/eYDLuvYIPVSKhiS0TBXkG0koQ5q9dk+z1M7besKyVPUC U6//gQMMXscBrTrlCsf5NIf/pPb0Q0zxX8dxKs5mWpeR/lUC1bjWM6AM5fgGxvaKKc elmm/Jdub7AY3qwyP8u3HGkTgS/QVbC97xLtxJus= Date: Fri, 31 May 2019 23:05:15 +0200 (CEST) From: Jiri Kosina To: Andy Lutomirski cc: "Rafael J. Wysocki" , Josh Poimboeuf , "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 In-Reply-To: Message-ID: References: <20190531051456.fzkvn62qlkf6wqra@treble> <5564116.e9OFvgDRbB@kreacher> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 May 2019, Andy Lutomirski wrote: > The Intel SDM Vol 3 34.10 says: > > If the HLT instruction is restarted, the processor will generate a > memory access to fetch the HLT instruction (if it is > not in the internal cache), and execute a HLT bus transaction. This > behavior results in multiple HLT bus transactions > for the same HLT instruction. Which basically means that both hibernation and kexec have been broken in this respect for gazillions of years, and seems like noone noticed. Makes one wonder what the reason for that might be. Either SDM is not precise and the refetch actually never happens for real (or is always in these cases satisfied from I$ perhaps?), or ... ? So my patch basically puts things back where they have been for ages (while mwait is obviously much worse, as that gets woken up by the write to the monitored address, which inevitably does happen during resume), but seems like SDM is suggesting that we've been in a grey zone wrt RSM at least for all those ages. So perhaps we really should ditch resume_play_dead() altogether eventually, and replace it with sending INIT IPI around instead (and then waking the CPUs properly via INIT INIT START). I'd still like to do that for 5.3 though, as that'd be slightly bigger surgery, and conservatively put things basically back to state they have been up to now for 5.2. Thanks, -- Jiri Kosina SUSE Labs