Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp93794lqp; Fri, 12 Apr 2024 11:22:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+Nc7rfKQKUsSBB7XzH1QkbSEjES/6ZgP6J3756m1OjBDf68dF6OvVV8O225t//i1YZdfdgFQJTP71ile2HQhAkQNXQUfkQ+WvXkU+rA== X-Google-Smtp-Source: AGHT+IEyrq00kKxLo8lRqO3MIr9AOrKbhsFXci2xzBeoPG4z02Cx2RSGkSq2MRl9vApLjRPyyY9y X-Received: by 2002:a05:6e02:3704:b0:36a:3855:c7ca with SMTP id ck4-20020a056e02370400b0036a3855c7camr4544326ilb.21.1712946138921; Fri, 12 Apr 2024 11:22:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712946138; cv=pass; d=google.com; s=arc-20160816; b=Om/o9tEyqbtKIm3Vd5iMoWl59OActlL1R/bI7AO6ZJjfz4Kcd4po8PAaJ5o4YSwUPh t24H9rziAYWfNOdL36PuLFYp9WitbPdI1ErZ0oLcRJ/vYLhiy0OvbrHLIDwRSTX1/1lA DCYxukxurfwbvDlWBo4lcEwvfmgmHV3EKdxtuxIGYvVlWR8250mn+A9aJv0JiMo3smjx /J4cTPsaAHJG3gVfk2Do4k2zNzczqQQ8YdGzvItv4HKLNiYWUzmUdF9Y9z2oNkIebBsJ jJJny5VKlOfyPaslCjTmaw8uDn++5EvcGoPZR5dIe1auIq7bN+qDYE7gtQ9k5nHhjIm1 03Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FSFDF9IAzDBa21z+Q1WVHIHnXyMuE3GF/wiqSSN4e4k=; fh=D1drUkjhd6cQ461FGcgjExl1O+jZ7EhaGJAtOyxVAPQ=; b=iY+wdrs+B0CYIkg49Y300cfB7q8XVf8v0h798uTPDndxAjn825s1O1nOmhZ+m5WVu2 5KyhaJ/ra3kaks9nZc3kbMgmD+QwqFcdJwTxLrYXBg6zG1rfPKxgZ7vf/MEIBEZrBgPr /NfgeCGwhRHPK3k1wyriSGQM34Mg1fa+bbHs7jsEfG5Gz8vu3P2iECLlmNvSHF7jBtdz 2xX9OYdCesu7ZaeQswAFeKmftsvZCjnhur/CyIehIpJqSp8wr5Lo5ncvskij3jupOWbK C2Wn00OUvClmhhZLc+FBsVsoevZBH97VkiGPYoIGXNO35gTgrWGpeJZBLiqijvp+zS8r O0tA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RhSYSO1A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s191-20020a632cc8000000b005e46e6ba6cdsi3672944pgs.391.2024.04.12.11.22.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 11:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RhSYSO1A; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143190-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6CBDBB20D34 for ; Fri, 12 Apr 2024 18:21:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBEEC14EC52; Fri, 12 Apr 2024 18:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RhSYSO1A" 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 07E5614D44F for ; Fri, 12 Apr 2024 18:20:52 +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=1712946053; cv=none; b=ECjQWT1NqSAxqCzHpWVREIrybKUje2JwDVNff/WPdI1GhVMSAFmDzWhn+LRDx5AO73lR+PQAJqv8kQhYXcAPUutPNqXxqq4hAly78zfQxVyT6VUj2N47uT0w4hK0433FlmBhNT+OGNL7hWVXIYtJqSsEWttQn6CgAlbq39QfUmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712946053; c=relaxed/simple; bh=KXiutQ9tdS1FwQ0AOqobuUPzDrGZYlvSr0VuMrqsuvk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NZxTfSIRsnjM+7AhXqeFKZZEEkgzRLHlYZNNi1SsdP5r3ccchykU6tVOOMZ4HggHeHoaVc3HAGM6jBtDk2T4m8G8nf9M+FhlYuD8mIS3Dw3TmesAghER7awKWezZeZK8koTxtOi2yzQotdKEnxSqBNlIRohFSF5lQ/0BZNJL0cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RhSYSO1A; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B0D3C113CC; Fri, 12 Apr 2024 18:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712946052; bh=KXiutQ9tdS1FwQ0AOqobuUPzDrGZYlvSr0VuMrqsuvk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RhSYSO1AG1UigulrfSRJZIRU1pzkErgBymY6vGWXGR7RqBINWesrsgbTvOwe1M7Yp pz4tEuHjyW8FewJ0ydkXCnrvAmiAqiLQrxqrUwNyDIUBcYFHGbUdlVQ8eZhU9qrtE9 7PfDQwr7xuO56C96IQKxBG5+mhglX7f7JN7pqAvAR+UZgqKSkVtrFB9RO11WnH2N7Z K4A+aMa19MerhQ/yEUUgZmwwDxmN0us2IfK1eybznxNOJYuyatBus3scIBluOYAmaQ kLeUqv4bDyBQK+9CEDPvyFIA2lIP0pQGItgwvjSsIGrZ6URxiCRZEMtVb63ur8a4eY b8TqfMYgqPuLg== Date: Fri, 12 Apr 2024 11:20:49 -0700 From: Josh Poimboeuf To: x86@kernel.org Cc: 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 , Andrew Cooper , 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: <20240412182049.r234qj2h2nuzqfxy@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 In-Reply-To: On Fri, Apr 12, 2024 at 11:10:34AM -0700, Josh Poimboeuf wrote: > --- > arch/x86/Makefile | 1 - > arch/x86/include/asm/cpufeatures.h | 1 - > arch/x86/include/asm/disabled-features.h | 3 +- > arch/x86/include/asm/nospec-branch.h | 18 ++--- > arch/x86/kernel/alternative.c | 17 +---- > arch/x86/kernel/cpu/bugs.c | 66 +------------------ > arch/x86/kernel/cpu/cpu.h | 3 +- > arch/x86/lib/retpoline.S | 5 +- > arch/x86/net/bpf_jit_comp.c | 5 +- > tools/arch/x86/include/asm/cpufeatures.h | 1 - > .../arch/x86/include/asm/disabled-features.h | 3 +- Forgot the documentation updates: diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/admin-guide/hw-vuln/spectre.rst index 25a04cda4c2c..de780db82cd8 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -380,10 +380,8 @@ The possible values in this file are: 'Not affected' The processor is not vulnerable 'Mitigation: None' Vulnerable, no mitigation 'Mitigation: Retpolines' Use Retpoline thunks - 'Mitigation: LFENCE' Use LFENCE instructions 'Mitigation: Enhanced IBRS' Hardware-focused mitigation 'Mitigation: Enhanced IBRS + Retpolines' Hardware-focused + Retpolines - 'Mitigation: Enhanced IBRS + LFENCE' Hardware-focused + LFENCE ======================================== ================================= - Firmware status: Show if Indirect Branch Restricted Speculation (IBRS) is @@ -640,13 +638,10 @@ kernel command line. Specific mitigations can also be selected manually: - retpoline auto pick between generic,lfence + retpoline Retpolines retpoline,generic Retpolines - retpoline,lfence LFENCE; indirect branch - retpoline,amd alias for retpoline,lfence eibrs Enhanced/Auto IBRS eibrs,retpoline Enhanced/Auto IBRS + Retpolines - eibrs,lfence Enhanced/Auto IBRS + LFENCE ibrs use IBRS to protect kernel Not specifying this option is equivalent to diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 902ecd92a29f..edbfba7299e7 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6099,13 +6099,10 @@ Specific mitigations can also be selected manually: - retpoline - replace indirect branches + retpoline - Retpolines retpoline,generic - Retpolines - retpoline,lfence - LFENCE; indirect branch - retpoline,amd - alias for retpoline,lfence eibrs - Enhanced/Auto IBRS eibrs,retpoline - Enhanced/Auto IBRS + Retpolines - eibrs,lfence - Enhanced/Auto IBRS + LFENCE ibrs - use IBRS to protect kernel Not specifying this option is equivalent to