Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4279400rwe; Tue, 30 Aug 2022 07:33:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6gbyDee4jjT/qlR0AkfhVi4+RAl9XAy5ytz3YQVYfkoFRiqzHMF7Ykv8wVWzDq5aNdEC+L X-Received: by 2002:a63:ce17:0:b0:42a:bfb6:f218 with SMTP id y23-20020a63ce17000000b0042abfb6f218mr17817170pgf.484.1661869991141; Tue, 30 Aug 2022 07:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661869991; cv=none; d=google.com; s=arc-20160816; b=FV5SoH2iQtZZPAlgGeXao93T7LbXPQ1MfzzZ2zjqhPyO1PzYQPC5NtKGZEaPoA+w8Z jPd9YpZ/mIdICuguQ2ZSrccqxMHbiSjzSaIXwXsGKhDNn+1ek2Kgs/Rg7o227+H41RyP OoVbImzN+UsUhYBmGDR9Lteoit+/py46SKDkkyIZSeigsMTCpuxzMqyAgL/Y83vhU5yT MSdntEi3sM6EWR8K2Llr8v19fGBGlCGIcOJXayq81+pDzjIpXxrMoaGOEzf1HYvjQsPA sWxjL1ZFNpJoIU653HNFad6G9L/ZuX2FwkToToC7I3fxW08WAr5go6JExbgiSEi3+oRP xWOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=YKIUBvr7iGZqvf5Tt/HD4azuyyghudwM3Qk3cRXUdjY=; b=DOfwkj+1iQms4mEJcuVZjU4ezsfCCTQQPjAd001CDuuBkpWw6ByUgj56k8GY8l11Y6 EXMHxHei4tSXVSCHmkpq8CqfJPZBQJBwdbLs/8QXJvoKEAJweycTtjfL4TjQqn0PURg1 6DgtxKqE67Y3FAv00FZjCxPzOzyIBN83azukZFvmVA9xQCXFbykG6dW5YRuYAo0NPiV6 aTAIpMXHT4z2RAheWBe3f9qkFAD7jQmsJJ3Q7plG/Eoh4JLO+5UxNRX3f8OXaZO0emqW b3H9vcHcMQ7IH/7rgF3Agu/o0XDkmNDIWufzMSOL6gLvgVgSswzR4peBzV1Fs+xeuO/X OshA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YxGWLa9R; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a170902ef4d00b0016c9a6e0d66si10924448plx.356.2022.08.30.07.32.36; Tue, 30 Aug 2022 07:33:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YxGWLa9R; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229985AbiH3OZd (ORCPT + 99 others); Tue, 30 Aug 2022 10:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbiH3OZb (ORCPT ); Tue, 30 Aug 2022 10:25:31 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23364EE13; Tue, 30 Aug 2022 07:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661869531; x=1693405531; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ls7bUeG0qImuDU5GXNYrpLFVEHonOvKe9zvl+zk5MN4=; b=YxGWLa9RvSAgt4OYdJpDNfYy4+e79McXzuEBnJyc99wqL2xs3frNJ6Sh HTxJSz1gsm3E2ULUUrAdiYPnyUK+s5cy04GMHOJuEQP+niAHW3qZkyt+z bwzBPFH3kmlOYaejizGGZbQ7+CPJtteS4/948UqY/1MRzygzaC9D/hFJv jO9q/mgFlMYzkYaryxBYQWVRf5bpV0TYvNFMssiG3ng556gH1ZwOP/7c9 CRaXeH81KaoXNnHjhcFuUOQseScFHvSClp0kxmtinOn+nRXeTZbaAZylN X852WsolF+taLS++/XOPWNZTjQ80W8V/YcME8/33vOZechXTSjpkEE5jk w==; X-IronPort-AV: E=McAfee;i="6500,9779,10455"; a="296464229" X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="296464229" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 07:25:30 -0700 X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="680053657" Received: from agawande-mobl.amr.corp.intel.com (HELO [10.255.229.254]) ([10.255.229.254]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 07:25:30 -0700 Message-ID: <6ec9cdab-db5b-ab28-c92d-79c3812dd369@intel.com> Date: Tue, 30 Aug 2022 07:25:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Should Linux set the new constant-time mode CPU flags? Content-Language: en-US To: "Jason A. Donenfeld" , Eric Biggers Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Adam Langley , Ard Biesheuvel References: From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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-crypto@vger.kernel.org On 8/29/22 09:39, Jason A. Donenfeld wrote: > On Thu, Aug 25, 2022 at 11:15:58PM +0000, Eric Biggers wrote: >> I'm wondering if people are aware of this issue, and whether anyone has any >> thoughts on whether/where the kernel should be setting these new CPU flags. >> There don't appear to have been any prior discussions about this. (Thanks to > Maybe it should be set unconditionally now, until we figure out how to > make it more granular. Personally, I'm in this camp as well. Let's be safe and set it by default. There's also this tidbit in the Intel docs (and chopping out a bunch of the noise): (On) processors based on microarchitectures before Ice Lake ... the instructions listed here operate as if DOITM is enabled. IOW, setting DOITM=0 isn't going back to the stone age. At worst, I'd guess that you're giving up some optimization that only shows up in very recent CPUs in the first place. If folks want DOITM=1 on their snazzy new CPUs, then they came come with performance data to demonstrate the gain they'll get from adding kernel code to get DOITM=1. There are a range of ways we could handle it, all the way from adding a command-line parameter to per-task management. Anybody disagree?