Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1749620lqp; Mon, 15 Apr 2024 16:44:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUobA0nQXNjImEhTgxTb/SD8rmNA/tMR1aodlGB/PGKSjj1ZX82FHRIENioWhyTbpfopqY6XuuZTj0R5PGn6JbL3jNhV5wJ/BKhDAK+pA== X-Google-Smtp-Source: AGHT+IGqDZGbx5EKNVhxD0TvgWw09HYIcWStd9h8RUSjQaStPxQ3fHzyUShnpdyHI54o21sZvhEx X-Received: by 2002:a05:6a00:9390:b0:6ea:d740:62a4 with SMTP id ka16-20020a056a00939000b006ead74062a4mr11088563pfb.25.1713224663035; Mon, 15 Apr 2024 16:44:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713224663; cv=pass; d=google.com; s=arc-20160816; b=oUpdmF9wo8vug++na/SuR6vVRlqbnH3azR97UZtp5MHAuhT9VFSf+t7fkmj7kox0Qy avlUEMQ4Rl6KG+sKqewNmh2O8QmGfWKnQl7ExvS7aHwUvMqDhWiA29nh24P1wlYqoXmP zZ/4n+SroDMbFukhFUvacso8Ws583LO9QyY9GICycN8qC7IJ3uUJ7pUKewMufiB1IZm9 3KFoAc5P93P1DhfsPmnc2WbqY2SpZtvP/Z556fN61RUkmGyOvtrHXsTSrkVZzkERxcyu CB23BmIHvrXW9t/7zE6BolAUnGm/LcxkRevUCIjaoLOSDlM+D5oxQF7TXuc/iA+4GV/h lhNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GP/HNQEVjTq49AmCXkCiWqAcHL9p61BQUOG7HZ0yp0I=; fh=yhH+xk6nv6Mxy9BRX6mCm9HHx0mRw5kUao6HGiM7XLM=; b=QNvx9QWszNe0Glyu59WrcC5GvRqBaJSuY/RT9nYkWbIxvAqVH9/+RyrBcG3Ee7xCHd tcoJtVogdEY3PqfoydKo3k2MtRei1NQwh4oiDaIXAUjjQpt2YI17WH6BqSXSorBewZD4 x/vL0QnI087gTMYCf0xCGrl/ACOTj0q9Av/rhBe9brBHAiMs1j4BAeXZiCNIUUPD1NG+ z+w5mIJFZxfUc9LFw2IEt+6vdxgKnUd5MOMoBzRIqLproSnYtAU9m+n9T+OkoRC3yJpr hdXyRPZLNPORW0Mz5GKnjyOUuAIvYideSU8ZIbho1bNuI4pGGaZqatqweRKHfeG5/IhR fzIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hkYyBw88; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-146016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g5-20020aa78745000000b006ece5ad143bsi8651750pfo.388.2024.04.15.16.44.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 16:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hkYyBw88; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-146016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AFD88282863 for ; Mon, 15 Apr 2024 23:44:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E166415885D; Mon, 15 Apr 2024 23:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hkYyBw88" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19EBC156974 for ; Mon, 15 Apr 2024 23:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713224658; cv=none; b=ZyvkfMMLut+eIN0DRFfArMK78vcuQtE6IKDgfMgCw3UC0rE5wgsf2YmRnndllpQZ42quw4026pEB1Gb0ySDhy1hkvGrP1dqydKGo+A0PMSMjPww/R/zUYSPdQGG7hOl4Ffg9kgxKtXKS573YMFvhu8FqKT/ykVPHPuANX2oIABo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713224658; c=relaxed/simple; bh=zpKurUMgjqar+MTlzO/Wp5wCc57TdsSBvHylHxkL37g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YgYn6IEKzxiBWokQZRMikKkpAso1K/EdmvTvj3Rz1uozxqo19AQGlxXIqb4fjAREsTBwmLkc1Pzu/eLhiMak/9cUJOJdH+eJH2i4gCBBBFNPTaLcbmw3+EMrGO0paCl2AtKePje8WHOmRzDSqkHgxbYt9WsqaJlLJ3eXyn7xF78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hkYyBw88; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA7A5C113CC; Mon, 15 Apr 2024 23:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713224657; bh=zpKurUMgjqar+MTlzO/Wp5wCc57TdsSBvHylHxkL37g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hkYyBw88h2Iu1OWyvZoIBr42/7CbVhy2dbC8h5jDNK63/5HFsOkZr7KQirmtnV0FQ zamkuIpQAwq1Etr04g//xYZEvcqtjMx8ngdZH+AjR5P8brKmS7Bn98IA2FRnZNTvUT c++dzi6ywKS36oc3mIy0pj6Z5CHNBvldA8WqrTgfqy9WPdFkUe2tfciqeqmRZpOfPK VvWuTufrZtZdoQ1tOWborxmSxuvvH0jsJFNJO+1+dOIlC4E17PegyifCUqFbeFP7K/ frPpno4/OFlDnwP066wuNexlcU4aclAK/MudrPjIOHZGXMuCbRr4Pzj85inC1R1pW3 ku4hJmH0LBatQ== Date: Mon, 15 Apr 2024 16:44:15 -0700 From: Josh Poimboeuf To: Andrew Cooper Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov , Ingo Molnar Subject: Re: [PATCH 3/3] x86/bugs: Remove support for Spectre v2 LFENCE "retpolines" Message-ID: <20240415234415.6labhhhbllinzyvp@treble> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 12, 2024 at 09:49:33PM +0100, Andrew Cooper wrote: > On 12/04/2024 7:10 pm, Josh Poimboeuf wrote: > > I found several bugs where code assumes that X86_FEATURE_RETPOLINE > > actually means retpolines (imagine that!). > > Yeah :(   One could also imagine a past where that was pointed out, or > just read about it in the archives. > > > In fact that feature also > > includes the original AMD LFENCE "retpolines", which aren't in fact > > retpolines. > > > > Really, those "retpolines" should just be removed. They're already > > considered vulnerable due to the fact that the speculative window after > > the indirect branch can still be long enough to do multiple dependent > > loads. And recent tooling makes such gadgets easier to find. > > There are two Atom CPUs which are not repotline safe, and for which > Intel released a statement saying "use lfence/jmp" on these. > > I'm still trying to find it... Any luck finding it? The only thing I found [1] isn't exactly a ringing endorsement of LFENCE;JMP over retpolines. [1] https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/branch-history-injection.html -- Josh