Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6970C54EAA for ; Thu, 26 Jan 2023 19:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbjAZTMl (ORCPT ); Thu, 26 Jan 2023 14:12:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232315AbjAZTMk (ORCPT ); Thu, 26 Jan 2023 14:12:40 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BAAF558C; Thu, 26 Jan 2023 11:12:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674760359; x=1706296359; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Trd6VrHdwLqP3BKT7sgNfrHrXj7Zj8mqjVHKY0jO6r4=; b=IrNEGle95rQdcDETi1c+1OPA4Cc0fH1cAGrASetx3BLZRQjP0WAjWUHD /5llyqrlxj+FvztZgsTEdAw86L1GSv6B9+rmquoXocbYmnpCOHmjSZxKi R6CKC3PC4DjhmiV6M/4XQDXZhtywfV4s5MmORm+mDxwTlhj5GEuIax4AG jAdEwaRq/7hv3TphBhuGHIhUuTIYZPmdHkwFf5yj+no4xqdzqL3az8E8z 0Nk9SZqwwwcXroxvpJnP/x/0SUUAkbzz2MqdIlB8NWMWQhCh3q+1ZNVuA hkyeRs+DgbZlgMk2+1n/B/pZaEzDY5vLwem7Sz05jP8kBO+ol7vkWfkgw Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="389268106" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="389268106" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 11:12:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="662976851" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="662976851" Received: from ernestom-mobl.amr.corp.intel.com (HELO [10.212.255.13]) ([10.212.255.13]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 11:12:36 -0800 Message-ID: Date: Thu, 26 Jan 2023 11:12:36 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] x86: enable Data Operand Independent Timing Mode Content-Language: en-US To: Jann Horn Cc: Eric Biggers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , x86@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Peter Zijlstra , Roxana Bradescu , Adam Langley , Ard Biesheuvel , "Jason A . Donenfeld" References: <20230125012801.362496-1-ebiggers@kernel.org> <14506678-918f-81e1-2c26-2b347ff50701@intel.com> <394c92e2-a9aa-37e1-7a34-d7569ac844fd@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 1/26/23 09:52, Jann Horn wrote: >> Maybe I'm totally missing something, but I thought the scope here was >> the "non-data operand independent timing behavior for the listed >> instructions" referenced here: >> >>> https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/data-operand-independent-timing-isa-guidance.html >> where the "listed instructions" is this list: >> >>> https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/resources/data-operand-independent-timing-instructions.html >> For example, that includes XOR with the 0x31 and 0x81 opcodes which >> there are plenty of in the kernel. > That list says at the top: "The table below lists instructions that > have data-independent timing." So, first of all, apologies for the documentation. It needs some work, and I see where the confusion is coming from. But, I did just confirm with the folks that wrote it. The "listed instructions" *ARE* within the scope of being affected by the DOITM=0/1 setting. Instead of saying: The table below lists instructions that have data-independent timing. I think it should probably say something like: The table below lists instructions that have data-independent timing when DOITM is enabled. (Modulo the MXCSR interactions for now) Somebody from Intel please thwack me over the head if I'm managing to get this wrong (wouldn't be the first time).