Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5078211pxj; Wed, 26 May 2021 02:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/lZLAMpedXtfOd58bo3SBAkeO3TiVNbNfYmL/tNQPr7QMtUa1s1aEiMU+en54Zical0Cl X-Received: by 2002:a17:906:c211:: with SMTP id d17mr32928945ejz.247.1622020466082; Wed, 26 May 2021 02:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622020466; cv=none; d=google.com; s=arc-20160816; b=zaxaSci/txLyil2Dz5etoLENj4qTQDFRuqpxlR9n9HEtsVW2Xy95kGkXh+VXfxLu0s F2G+L4b3dlHiK3A8nA+QrYcAiP9Suvuny2BVfacDaBSDdbAoJvEBpjT733HCVwtrFr9T 9/dmH5RfXHSCurBp89/gIw5YxO+3L+XnlFezB4omIz387UB8Qhyr42RLEMdwyA++pxOF lpkHz3ZJG4qD3bbIu8S4esiQnc3gPeYurtn1HZAE7OsiyIBnO6Yl9+FTbBJiCaIyKeFh TCcqr2dn7ElD4wQlrKPWkcHq2W3Yzw+6B7jgq+e9I7cu4vpyUMdYMcc/ms/psNdrQKlp HQyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=R3B4sGRkC4gaxOmhkCu+yku6E12xNDpKB6NHoEMRfrU=; b=B5FK1Oll3Ffn79wfj4w69G9XW9c999Y1SSNTIO1QwD2uoveibfA9DY+AJBzGyZbaHP WdGX7k8lYm8YpFZyUNCpv54XJC6HCeoYhw/30I81OY7e0ZmngLW/R/+XC0NoTYsWGVjm k7PSa0uYn+2jhx/KSZf+xHJPfX/IeE+GQbJ5WRlR82wjxUdDZsBFHpRcAiUB3/atO1ar h91HPjqxwK4NQxtk+FkbexNRNImGGSjsU/NwcfPJwEYyhZcIJXoA+ZGPhfIaA1XJAQHR 3Htjp/PepdUH4qAcqMCptspD7+zjCd5tmAIdk5SXVdcQs9boU0KhhU6mRzigzbH/t1xQ bHgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmno4fJA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si20651848ejp.119.2021.05.26.02.13.46; Wed, 26 May 2021 02:14:26 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmno4fJA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233629AbhEZJON (ORCPT + 99 others); Wed, 26 May 2021 05:14:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:48012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233283AbhEZJOJ (ORCPT ); Wed, 26 May 2021 05:14:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E080561437 for ; Wed, 26 May 2021 09:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622020358; bh=S55ODqqujtzXgLmsiAgw1ByZLYfqR9g87VvzDp7c4G0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pmno4fJAawdTFJND6vDyf9+1mO23CLBAuZbmHIGlZ86jZeWKsCNbvrWBNDiowEBjL vNU1V72Rq5aLVysw3/mnuHUgwGNyU6qPeOtr8CtCfYLUm3JJ8UrsEhuVHpGqCQy5T8 b59zIpC2qqVdPf14Av9cR2r2vsqMVKjb0dut6QXHFdXlW48sX3Aj9ekdZRafkm6anf zU9wWTbc03c3isRR5I9bDWwN/N1vBReeigs2Yb9GNu23wisP2/Qq+X/78PZyEeoHvV /r5lGhyCwYy0FsQwAkaaBCpPql7qOoGhutvjapnew6lMMsqLlQXdi7felrTX/NZT9m SGLTtpbPPC09A== Received: by mail-oi1-f180.google.com with SMTP id v22so848557oic.2 for ; Wed, 26 May 2021 02:12:38 -0700 (PDT) X-Gm-Message-State: AOAM532QX7TrrpVzw6/DLrB7aTLL+HLQE6c0/JcwLDskjfz06PN4Fx7e WAJjkocRUrMqeI3Otoo0pPItUPszxmrakmIt04c= X-Received: by 2002:aca:1b14:: with SMTP id b20mr1137966oib.174.1622020358246; Wed, 26 May 2021 02:12:38 -0700 (PDT) MIME-Version: 1.0 References: <20210521102053.66609-1-ardb@kernel.org> <20210521102053.66609-5-ardb@kernel.org> In-Reply-To: From: Ard Biesheuvel Date: Wed, 26 May 2021 11:12:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/5] crypto: arm64/aes-ccm - remove non-SIMD fallback path To: Eric Biggers Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au, will@kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, 24 May 2021 at 23:51, Eric Biggers wrote: > > On Fri, May 21, 2021 at 12:20:52PM +0200, Ard Biesheuvel wrote: > > AES/CCM on arm64 is implemented as a synchronous AEAD, and so it is > > guaranteed by the API that it is only invoked in task or softirq > > context. Since softirqs are now only handled when the SIMD is not > > being used in the task context that was interrupted to service the > > softirq, we no longer need a fallback path. Let's remove it. > > > > Signed-off-by: Ard Biesheuvel > > --- > > arch/arm64/crypto/aes-ce-ccm-core.S | 1 + > > arch/arm64/crypto/aes-ce-ccm-glue.c | 181 ++++++-------------- > > 2 files changed, 53 insertions(+), 129 deletions(-) > > This doesn't just remove the no-SIMD fallback, but it also does some > refactoring. Notably, it starts to process all the authenticated data in one > kernel_neon_begin() / kernel_neon_end() pair rather than many. Can you explain > why that is okay now when previously it wasn't, and also split this into two > separate commits? > OK. For the record, the reason is that, even though kernel_neon_begin/end are reasonably cheap these days, the common case for CCM (given its use in networking context) is for the auth/encrypt/finalize routines to each be called a single time, without any potentially sleeping calls into the skcipher walk layer in between. Now that we are doing more work in there (disable softirq processing as well as preemption), it was a suitable occasion to do some refactoring that I have had on my list for a while now.