Received: by 2002:a05:7412:4082:b0:f3:10fb:27e3 with SMTP id c2csp1038670rda; Wed, 22 Nov 2023 07:54:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEapncoOO2Zs6ujIwCOybUywNZRVBj/T1Z34XPZ9BNVbYOlf0ta5R1o48aQ+N3023ntPl2p X-Received: by 2002:a05:6a21:3a93:b0:15b:c800:48af with SMTP id zv19-20020a056a213a9300b0015bc80048afmr2762922pzb.23.1700668463814; Wed, 22 Nov 2023 07:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700668463; cv=none; d=google.com; s=arc-20160816; b=BgoJe4CCDDThC91nX7RYsyUlpQOSJuDio5PORcsgjYaGTyw4nshjAaiX4RLV/+/3u+ geMvwHmJM9LWfrYDtxCIkkfaXqaEuzhWlTp/FFWr/UeM24T9Ea3G6GzbpLQYKSgqUBS9 JpnlSOSN/pr3CGcSBJOn8BFx8FjsdUhTYZuPZYun/t7MC7NHA8+ZG9Ts7wEd/tYUu9O9 CGVGh01PBBDT1lqqhUG38b09OmWFSIpHfWXCEcGXdDVHTrcyGRKAfoc8tHG+ytavYIXs ZHf6wKVnUSZeiS+6m6WqNypGzbOWEEFTGppD4ENKKqP+z0NFjkfB6HTF/yA2Awk1c2Qe pGwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=88zGKO0u2d1EqGTMiuipUFLdoa0y0OnWP5heo1AegpM=; fh=+9Stn7xfNperbAtn+la0aCPGtwBgH87ryLKTD5b3jMo=; b=LtHyXP2vp0Cvfcx21sXowuCtmwNRDiPXeQV72BIuJT1jldqRPGBhrGQqwiNh+HNopg WI7e7wFDnzPXE+jA7FRhOVDNL8a3m42lHZXMRbccnFf31yz0zJF+VaibzGWKl8EXoMaK l/ZRh37L2utUyrxkG3+igLSOjU3faABhUS+REwCX7HVWU+gm1jFI2S3bvQrv4EtAT733 BEzQOpdy2Zfg2Tozy4C9f00I//3Gx9oP6k9bWZc4GFY8y/zP0Iadm2v30M8Z997XWeCn l9eshRxCOEylBMutl3y/INmQoCfBP/Dk+IxhJQespLgpZeB9M9zeM6WCOwvI4FzrdqnY nCkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d15-20020a056a00244f00b0068fcf194dacsi13262846pfj.92.2023.11.22.07.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:54:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3347E819FC7D; Wed, 22 Nov 2023 07:54:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344418AbjKVPyW (ORCPT + 99 others); Wed, 22 Nov 2023 10:54:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjKVPyV (ORCPT ); Wed, 22 Nov 2023 10:54:21 -0500 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3283F9A for ; Wed, 22 Nov 2023 07:54:16 -0800 (PST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a02d91ab195so250190066b.3 for ; Wed, 22 Nov 2023 07:54:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700668454; x=1701273254; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=88zGKO0u2d1EqGTMiuipUFLdoa0y0OnWP5heo1AegpM=; b=G8N+p07f/3XGUC7+C6ikArOhn4djOJjPk/mKaXzr2vF7i8T0wW5ZxQwTbu/75x4bY/ MisrlfhaaJVB5L4t+rM5E0fflB79i1rhklJjwWgKc5hGKvG6xe34TEJJ/QG9y1CfhfIN 2aeknUj7P8yRdhqSFmchnjaLvCJMlY5yBFeqS3v6q1sblf16pvOnBNsjGN+4rZrNQkWr h4wFyMuEvrBEQYUnX5uXJ+xdngAj1gm8yRFopeHbdOWnQL+9BX1++M1jGenzRZ61+4vW e+4HOL1ROy7piAgmORfObEye2Ghdpd8rOw21O4kRaOp/kNCa1d+vBE2kO7UnYQhrT7cs cvxA== X-Gm-Message-State: AOJu0YwuCXs1WNaByiRKk25ZFNVcmI0jHg0TUKaAapfNmULwmrhgn9Rq I0z2LOWmeDtfvQJHkhqZJbs= X-Received: by 2002:a17:906:60c:b0:9fd:1e2c:bd8a with SMTP id s12-20020a170906060c00b009fd1e2cbd8amr1794436ejb.50.1700668454416; Wed, 22 Nov 2023 07:54:14 -0800 (PST) Received: from gmail.com (fwdproxy-cln-117.fbsv.net. [2a03:2880:31ff:75::face:b00c]) by smtp.gmail.com with ESMTPSA id i22-20020a1709063c5600b009e6b6681da7sm6860125ejg.94.2023.11.22.07.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:54:13 -0800 (PST) Date: Wed, 22 Nov 2023 07:54:11 -0800 From: Breno Leitao To: Andrew Cooper Cc: jpoimboe@kernel.org, mingo@redhat.com, tglx@linutronix.de, bp@alien8.de, Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Pawan Gupta , Jason Baron , Steven Rostedt , Ard Biesheuvel , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , leit@meta.com, linux-kernel@vger.kernel.org, Ingo Molnar , Lukas Bulwahn , Sven Joachim , Ian Kent , Yu-cheng Yu , Kees Cook , Rick Edgecombe , Kim Phillips , Juergen Gross , "Kirill A. Shutemov" , Randy Dunlap , Jinghao Jia , Vincent Whitchurch , Arnaldo Carvalho de Melo Subject: Re: [PATCH v6 10/13] x86/bugs: Rename RETHUNK to MITIGATION_RETHUNK Message-ID: References: <20231121160740.1249350-1-leitao@debian.org> <20231121160740.1249350-11-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 07:54:22 -0800 (PST) Hello Andrew, On Tue, Nov 21, 2023 at 09:39:47PM +0000, Andrew Cooper wrote: > On 21/11/2023 4:07 pm, Breno Leitao wrote: > > CPU mitigations config entries are inconsistent, and names are hard to > > related. There are concrete benefits for both users and developers of > > having all the mitigation config options living in the same config > > namespace. > > > > The mitigation options should have consistency and start with > > MITIGATION. > > > > Rename the Kconfig entry from RETHUNK to MITIGATION_RETHUNK. > > > > Suggested-by: Josh Poimboeuf > > Signed-off-by: Breno Leitao > > (I'm CC'd on only this single patch so I can't see what's going on, but) > > Really?? Rethunk[sic] isn't a mitigation.? It's just a compiler > transformation for return instructions upon which various mitigations > depend. The MITIGATION namespace is not only for mitigation, but, for "features" that are available with the only purpose of mitigating speculative hardware vulnerability. The original suggested namespace was "MITIGATE", and then it would make no sense for RETHUNK, since, we are not mitigating RETHUNK per se. Please check the discussion here: https://lore.kernel.org/all/20231011044252.42bplzjsam3qsasz@treble/ That said, the way the x86 Kconfig is organized today, CONFIG_RETHUNK is very focused in solving a mitigations problem, thus, the MITIGATION_ namespace has been added to it. For instance, CONFIG_RETHUNK is inside the SPECULATION_MITIGATIONS, thus, it is only enabled if SPECULATION_MITIGATIONS is set. menuconfig SPECULATION_MITIGATIONS bool "Mitigations for speculative execution vulnerabilities" config RETHUNK bool "Enable return-thunks" depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK help Compile the kernel with the return-thunks compiler option to guard against kernel-to-user data leaks by avoiding return speculation. Requires a compiler with -mfunction-return=thunk-extern support for full protection. The kernel may run slower. endif Thanks for the feedback.