From patchwork Thu Jan 24 16:33:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 156501 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2165035jaa; Thu, 24 Jan 2019 08:33:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN6QUhLJ+vPn25rdMAfpKHaZfh0nOp9STbwz0OOLmFyPL/z33TDvsqxlVogozGpmh1kwfdJ5 X-Received: by 2002:a63:a35c:: with SMTP id v28mr6463067pgn.205.1548347638535; Thu, 24 Jan 2019 08:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548347638; cv=none; d=google.com; s=arc-20160816; b=tWf7azrxgVtlMwVdxEhz7m+o1RVfPTAUX6Uye8pjy3Ejq/838WGEmcF0BtqT95OzXl +hVqYgTKu4XYijY1DL8D8HjO7QTAaUGfrUVaFmEWMytDhXz3j+vm7zIC0Bml1UqZlh5d y/e84KHVX8G3CjaiUKM8+vgRPFHYnEU+VwpgnK0RMVhOUhno2Mw0yKHTxpJrVnklrwSg OlfKEu44L1HZ+6YfRndcM/5vw6NLIEGeFy0w6qrvBGZl5/mRsMKFM2dHUlAi+Dz95LK4 plP/OMpv5RqqyYvWRLtkBPrqSGWG/6BkUZyVJY4ZFiMrkaQBg/+kIhPxojEVDvOAPc87 F/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RPyzbyLlh3W2c/h1LkXMkKRinYA35oe3Ivdo9s+NBuM=; b=hHc7Acce4aPBZ+KluiNmaMP0q/PUdDFo/0Zh2XG3sD3AKV+aNwXxAyZjR32kK6Rgwu DcWTBlWMMEhlkVPHCUqCcbhtEsYbHcsBWq1m/oGZsf0c350nYePZck1l1tlkCFgLMGoC WCLh2cvwNOGc7XpfHDy8oiEozSvrtK6jEFuOlZWJn3LDv115sOuRSQDbwZ7VAaM9w4Yg sTcaBrHw3J6VdTGV4uUjw/5/Ybp/MMTZRBVYEBmXK8JyZIaUf77VDw/uuaiS1SmQ6eVX QDzrMrHqPlUntiwINUa4elNRJp4j880QPyEQ+Ts4cjsOqKXaxndOKqasIoP2/r8wvEng q3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UyjWTiTn; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si20261952pgq.434.2019.01.24.08.33.58; Thu, 24 Jan 2019 08:33:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UyjWTiTn; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbfAXQd5 (ORCPT + 3 others); Thu, 24 Jan 2019 11:33:57 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35108 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbfAXQd5 (ORCPT ); Thu, 24 Jan 2019 11:33:57 -0500 Received: by mail-wm1-f65.google.com with SMTP id t200so3789901wmt.0 for ; Thu, 24 Jan 2019 08:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RPyzbyLlh3W2c/h1LkXMkKRinYA35oe3Ivdo9s+NBuM=; b=UyjWTiTnHAfLcBttuKjyCyxxh4Aa8zetJMxMInnaRfr1zO2W4PYmohLJUgHs2XjRYt m7nZWUTZoxtpGje/ovujA90qpv32Ks1ViRUam9BPzWF3ib7NlMXjJDfg2nmcz89V9arh C9j8sZlv94rFmsX8+eE17hc0RYJWlCIEmC38w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RPyzbyLlh3W2c/h1LkXMkKRinYA35oe3Ivdo9s+NBuM=; b=o2XMWrVJpnBUXxLW1AaAHI93+BimTsWsAzmnmvsEHgvrfVYGbeTFZJR8OEi/duni27 Tx65B4LEdChTQAn73BoMyjP16Dyzcyw0Nx9itgbM00S8cvpuhvXtxdKUz/H3tWrHYfZ2 0C5XFMtXH0aknnmMs/Y47tHp25r/ISEexlzOtfouZedg1pqByLZ5sfQ2Dad9wZijODiP hPu6l4Godrm6FUKJ0XzoEEwMf81YGP8pf+r68FNocv2HaYmf7setweSuY3gzEXhI4clG CjwixWzjr9KaAfQXx4jkZ2IDA24/ZYo25u3dwSS7qulrLszPd+1RvTcKaqLQxHPIZQDT b2dQ== X-Gm-Message-State: AJcUukfuqgztDdynOzySWVodvkimloiaC2sHMvulDQA6ZVEjei+OwHcw rKVFqr5qoQ6rUVo01R7fE3HjNqzftCfMIw== X-Received: by 2002:a1c:be11:: with SMTP id o17mr3282887wmf.111.1548347635155; Thu, 24 Jan 2019 08:33:55 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id t12sm99629069wrr.65.2019.01.24.08.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 08:33:54 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, Ard Biesheuvel Subject: [PATCH 3/3] crypto: arm64/aes-ccm - don't use an atomic walk needlessly Date: Thu, 24 Jan 2019 17:33:47 +0100 Message-Id: <20190124163347.12653-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124163347.12653-1-ard.biesheuvel@linaro.org> References: <20190124163347.12653-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org When the AES-CCM code was first added, the NEON register were saved and restored eagerly, and so the code avoided doing so, and executed the scatterwalk in atomic context inside the kernel_neon_begin/end section. This has been changed in the meantime, so switch to non-atomic scatterwalks. Fixes: bd2ad885e30d ("crypto: arm64/aes-ce-ccm - move kernel mode neon ...") Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/aes-ce-ccm-glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm64/crypto/aes-ce-ccm-glue.c b/arch/arm64/crypto/aes-ce-ccm-glue.c index 986191e8c058..5fc6f51908fd 100644 --- a/arch/arm64/crypto/aes-ce-ccm-glue.c +++ b/arch/arm64/crypto/aes-ce-ccm-glue.c @@ -253,7 +253,7 @@ static int ccm_encrypt(struct aead_request *req) /* preserve the original iv for the final round */ memcpy(buf, req->iv, AES_BLOCK_SIZE); - err = skcipher_walk_aead_encrypt(&walk, req, true); + err = skcipher_walk_aead_encrypt(&walk, req, false); if (may_use_simd()) { while (walk.nbytes) { @@ -311,7 +311,7 @@ static int ccm_decrypt(struct aead_request *req) /* preserve the original iv for the final round */ memcpy(buf, req->iv, AES_BLOCK_SIZE); - err = skcipher_walk_aead_decrypt(&walk, req, true); + err = skcipher_walk_aead_decrypt(&walk, req, false); if (may_use_simd()) { while (walk.nbytes) {