Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp674427pxb; Thu, 5 Nov 2020 09:57:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0UmYbmZPQqm7F2+KTavFDEuOU+SUPVLlaLRj8JiNRBigcFPmbh8F/7SGUHsOXzdqku9Qd X-Received: by 2002:a05:6402:143a:: with SMTP id c26mr4024967edx.150.1604599049676; Thu, 05 Nov 2020 09:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599049; cv=none; d=google.com; s=arc-20160816; b=FHh6JrZGVktOxLt7L2rZhNc2q4aPpPSYeq0GKNhVHDCiOm8JfOlXFOO76ZGGCFj+l3 45QWH0dywY6Pdx6PKpVxGAk1vVVgLzdmd71KsdpsELMuQBlGm2WTrWqYxNBqi93o7vWa gtcOgdRTO2WIJVcPcBDiEzLPrudAjSWF/BvYND1qO/J1Ix2yEv+rAp1dspdRpXTpttsD Clk8itviQrzqD5le2J+fJjspH/msZePokK+n60NUNnsJ2gNpeptOBSoTZ3UblKsTxNkl 0SnHT+cuo4abWqSi/OReAdIit2N4OFJkPF1Ly81dmEL08UHn71pDCa1YIP7VtfM0Bmv/ JrLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=t9kVTVGJsXMgEX1EKgxRYrBSpAOh+796hxAaXXnKV6c=; b=bINjOCAEEk7Li+p8Sw+mEWZCAbTKhPNBf4SCmgeMsPCSAWQbD8hqz5UPayeg5o+DN+ 35wbYdbuKgjPdY+CqwGy24ldU/dWlQF5mWl2h85yYVT9mTMnCusRyKP3MmTEWoJ7foQR ppUfHe2vYfVOg77nt02zHzStq8xalwbNvwzETxS8XETEnT8KLUtSHCT3FXdiKUo+CPRC CrBPzeKBsdSvkhOmPTBUARs5Nx3AwA5h0VXO1wbNglFpafei3zEeQiz/nhdBhM90+B4x +AvRrFRwO583N/23uyGElYs3lGpVHjEi8f39O4wtGmmS8EJ8sfthnxuv+TjF2c+ZkpFY 3gpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si1698314eds.29.2020.11.05.09.56.56; Thu, 05 Nov 2020 09:57:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726996AbgKER4y (ORCPT + 99 others); Thu, 5 Nov 2020 12:56:54 -0500 Received: from foss.arm.com ([217.140.110.172]:38944 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726214AbgKER4y (ORCPT ); Thu, 5 Nov 2020 12:56:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2F7DC14BF; Thu, 5 Nov 2020 09:56:53 -0800 (PST) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B88293F719; Thu, 5 Nov 2020 09:56:51 -0800 (PST) Date: Thu, 5 Nov 2020 17:56:48 +0000 From: Dave Martin To: Mark Brown Cc: Alexandre Torgue , Catalin Marinas , Ard Biesheuvel , l00374334 , Linux Crypto Mailing List , Maxime Coquelin , Will Deacon , "David S. Miller" , Linux ARM , Herbert Xu Subject: Re: [PATCH 1/1] arm64: Accelerate Adler32 using arm64 SVE instructions. Message-ID: <20201105175647.GI6882@arm.com> References: <20201103121506.1533-1-liqiang64@huawei.com> <20201103121506.1533-2-liqiang64@huawei.com> <20201103180031.GO6882@arm.com> <20201104175032.GA15020@sirena.org.uk> <20201104181256.GG6882@arm.com> <20201104184905.GB4812@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104184905.GB4812@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Nov 04, 2020 at 06:49:05PM +0000, Mark Brown wrote: > On Wed, Nov 04, 2020 at 06:13:06PM +0000, Dave Martin wrote: > > On Wed, Nov 04, 2020 at 05:50:33PM +0000, Mark Brown wrote: > > > > I think at a minimum we'd want to handle the vector length explicitly > > > for kernel mode SVE, vector length independent code will work most of > > > the time but at the very least it feels like a landmine waiting to cause > > > trouble. If nothing else there's probably going to be cases where it > > > makes a difference for performance. Other than that I'm not currently > > ... > > > The main reasons for constraining the vector length are a) to hide > > mismatches between CPUs in heterogeneous systems, b) to ensure that > > validated software doesn't run with a vector length it wasn't validated > > for, and c) testing. > > > For kernel code, it's reasonable to say that all code should be vector- > > length agnostic unless there's a really good reason not to be. So we > > may not care too much about (b). > > > In that case, just setting ZCR_EL1.LEN to max in kernel_sve_begin() (or > > whatever) probably makes sense. > > I agree, that's most likely a good default. > > > For (c), it might be useful to have a command-line parameter or debugfs > > widget to constrain the vector length for kernel code; perhaps globally > > or perhaps per driver or algo. > > I think a global control would be good for testing, it seems simpler and > easier all round. The per thing tuning seems more useful for cases > where we run into something like a performance reason to use a limited > set of vector lengths but I think we should only add that when we have > at least one user for it, some examples of actual restrictions we want > would probably be helpful for designing the interface. Ack; note that an algo that wants to use a particular vector length can do so by means of the special predicate patterns VLnnn, POW2, MUL3 etc. So setting an explicit limit in ZCR_EL1.LEN should hopefully be an uncommon requirement. > > > Nonetheless, working up a candidate algorithm to help us see whether > > there is a good use case seems like a worthwhile project, so I don't > > want to discourage that too much. > > Definitely worth exploring. Cheers ---Dave