Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp374867lqp; Thu, 4 Apr 2024 16:36:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYHeMySXhMi6Exzt5ZV+Z2d3A2b4uewi0BymWuLDt6msiad/7Ed9xg4xzrYwB/DMu08xeIm3qKX/+1z0xhuSLaZuOwxOu82YEMFFzP9w== X-Google-Smtp-Source: AGHT+IGyJobkKh97ar/VmiBsy7fydvTasPkFVlclcdGng9Qs7gjKXe2F2mCmRv4K/kWsQoJjAi7k X-Received: by 2002:a17:90a:f998:b0:29f:f1f0:88c2 with SMTP id cq24-20020a17090af99800b0029ff1f088c2mr3683991pjb.4.1712273768819; Thu, 04 Apr 2024 16:36:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712273768; cv=pass; d=google.com; s=arc-20160816; b=sK1sIYLsyhlEPeMfrqYfR7RYr4sbAm6ZIYmDZ3fBOpNaIfLoVVp3VpAFSuAhswbVFH zd/aTJhLORIAwvZoCFD6V9TesAh/PsENo+RvZ1jkS/hHtgnL37nUANEjwUPb4KX0GCyr 1Nny3Q1YT5s/bJ28Aji+WrsFDVoxlTPFLVtuAkRJ63lvSEzHE4gWrtdrzZGkKimdhbjZ EGAmRZrbLZxvZLNxQQOqA7lWIdF64TC4puMoYUp944v2Hb7cb2QS1GSUKcyHrH04QBVS Im8DoSqjthTLJRDrw/6MN9/pPiYQ803OQBUNaB2NbWzxFL8aAHY7+LNm1WxFHTFjLAqw brQA== 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=8lLuEBJsfLMIqE90Dtc9plVCOrXkRx2DCccL7wU1UbM=; fh=cT6+H6OEK5xJAqgPNu7GD7e5wpQA3+OP1ZYa5XbMpG4=; b=p+OKO5fTOSHI26EIUBSWe1irNgyQYEHBe+C7hZsaynncSXAe6nhYO9sZVSgxmumCt0 VJMUjS04fXLhNQFbq6g6H6SpKrA9k3YHsVwHpLU3yiXjXYIgTJZjfNpC9lDl6dsJQo9W HwotWIhmM7QNmZa2mhmTxm2x5YPR10GIahC46lrM+acHvTVdbmcMK19VV0keg4L1blGR T1x6vz/I4VIJ2GcG6mYOPKQd5BRV9HjffORSOsFL+IWoiJ34I9wUa+5xjNnU2qeOwNeJ 0wY8/SuQkWH1/6qr7P8+6vgueFpVejk3bmi9M/r46jfOnapl+e7DbVVw35Xkf1eIUwCm C46Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a0UVbGX4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3348-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3348-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 z21-20020a17090ad79500b002a306f461f9si594885pju.83.2024.04.04.16.36.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 16:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3348-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=a0UVbGX4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3348-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3348-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 802E1289F03 for ; Thu, 4 Apr 2024 23:36:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D40F313C670; Thu, 4 Apr 2024 23:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a0UVbGX4" X-Original-To: linux-crypto@vger.kernel.org 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 8EF0A130A7F; Thu, 4 Apr 2024 23:36:03 +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=1712273763; cv=none; b=S2VPRr0HiGCbioW+wBIkpoaS0xEnzl1Yr+O9M3LURRMAehZIx7bFscw/pyy8vjSVsDeQsckdHMd6VmA8vHq2JF98b6w9P/3ADqDY/rTG8sQTNpVlfsUjOVAipPBFruvpoNGFeHeNVExhE7DdJNPtCqK+VUcTX+gHmNyDlcYkadg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712273763; c=relaxed/simple; bh=c4dlqL7Ifu1XCWKPZneuO2tG29yIvg4/flcQpTb0TNk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JbqReZOQZCNPyjdZ8TCm6vMoeyG3f76Nd8qMfaqzGVXaitrojKnvB0/c6dvAu8HgHXhpf94TO5G5ODuk1SjViCgZI874PJrQY2fRmmpK3KF6fmXEIRs+SJf+1KQl5XKBemG8khTERWvvdgiUG74HWevYVDLflPe7ZLI5GF9BDAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a0UVbGX4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8912AC433C7; Thu, 4 Apr 2024 23:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712273763; bh=c4dlqL7Ifu1XCWKPZneuO2tG29yIvg4/flcQpTb0TNk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a0UVbGX4dyn+lgNOBxBq4IvZRC5S1u0CKnXM25Oh0X2vVpbFBowe338pOPoUZ5JP5 ldMIgl+qUtcymPGNKRDoRvhbBe4MitIO1as1mGQVFqBS3x69CyLKhhb1PHU7Npxfjm bGOrJqiIPlao8TDDyLu6b0CvnRMO5Uqakf9YJg1Lfa4DX49anqUd+EUMUMXUujDkdH YXeVPWLl0MbkZIHoFBtcT1Rq8R42kyUCJ8NWDVxVihNJbKskA0/qK/247vmwogOI91 niF4eFrw2ckNf9fnKBV04HrQ5HjMvolN7dx83EBu8txyRVw+QoGbVVzUOqX8CXClUI TQni90w4qoXhw== Date: Thu, 4 Apr 2024 19:36:00 -0400 From: Eric Biggers To: Dave Hansen Cc: linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Andy Lutomirski , "Chang S . Bae" Subject: Re: [PATCH v2 6/6] crypto: x86/aes-xts - wire up VAES + AVX10/512 implementation Message-ID: <20240404233600.GA746@quark.localdomain> References: <20240329080355.2871-1-ebiggers@kernel.org> <20240329080355.2871-7-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Apr 04, 2024 at 01:34:04PM -0700, Dave Hansen wrote: > On 3/29/24 01:03, Eric Biggers wrote: > > +static const struct x86_cpu_id zmm_exclusion_list[] = { > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_SKYLAKE_X }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_ICELAKE_X }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_ICELAKE_D }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_ICELAKE }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_ICELAKE_L }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_ICELAKE_NNPI }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_TIGERLAKE_L }, > > + { .vendor = X86_VENDOR_INTEL, .family = 6, .model = INTEL_FAM6_TIGERLAKE }, > > + /* Allow Rocket Lake and later, and Sapphire Rapids and later. */ > > + /* Also allow AMD CPUs (starting with Zen 4, the first with AVX-512). */ > > + {}, > > +}; > > A hard-coded model/family exclusion list is not great. > > It'll break when running in guests on newer CPUs that fake any of these > models. Some folks will also surely disagree with the kernel policy > implemented here. > > Is there no way to implement this other than a hard-coded kernel policy? Besides the hardcoded CPU exclusion list, the options are: 1. Never use zmm registers. 2. Ignore the issue and use zmm registers even on these CPU models. Systemwide performance may suffer due to downclocking. 3. Do a runtime test to detect whether using zmm registers causes downclocking. This seems impractical. 4. Keep the proposed policy as the default behavior, but allow it to be overridden on the kernel command line. This would be a bit more flexible; however, most people don't change defaults anyway. When you write "Some folks will also surely disagree with the kernel policy implemented here", are there any specific concerns that you anticipate? Note that Intel has acknowledged the zmm downclocking issues on Ice Lake and suggested that using ymm registers instead would be reasonable: https://lore.kernel.org/linux-crypto/e8ce1146-3952-6977-1d0e-a22758e58914@intel.com/ If there is really a controversy, my vote is that for now we just go with option (1), i.e. drop this patch from the series. We can reconsider the issue when a CPU is released with better 512-bit support. - Eric