Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1046811rwb; Fri, 18 Nov 2022 11:54:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7w1+UVQcsHT+OKGlbq6PYuzAQyw583IinNdigahxcEZiDLb0nXBjBRha6mIvjY2e11EScN X-Received: by 2002:a17:906:cb95:b0:78d:4b9f:c32 with SMTP id mf21-20020a170906cb9500b0078d4b9f0c32mr6815153ejb.499.1668801285150; Fri, 18 Nov 2022 11:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668801285; cv=none; d=google.com; s=arc-20160816; b=NihQ+QGVcR7jWbm49S216Hhbe0ZoLBvYJDNcbJf80FavxEq1jgT6TSpeS0dTeIBgmj 5N/wxeW+9ewUHQahQnVGPNeUE24GvN1rlVpHmT/FcG40M2tM4OJfPnizPhzt6zOn6wa4 vrY1HL/7vuCMVPt/uqKRQ2dfOZ4gtwVxBmWq7TdEiIoKcGydbd88ercPfvUwa+gkPKow Uk8F4xcoboHMSEdMJS1sLg/HbwFaflhkbPOyUhsEwVmBluhLGYj9GWT1xM8q/o2stgT+ +O776M7uEX2yJHoNMSDkt2AFjM6FOK547iXwPw+p0s56Ie2Tw5PUWltvVidGDXbBXpIc nVpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y8O+K/N6pvkZrlyn1gY8/RIBiTTqwQtsPlYaJ0T/FyY=; b=MpTSgF3YpZzlxGXiLmOHu/B60118kIgkrJcSd9jXEcm/aQfRWM+uQm+GalxvYRJWBx /c/tZo6pTxgxY0ViPLgVovE/LNtpBuxoTe1/IyU2HZ+5OGAW6WlrMYlnSRaC9am6xVIp xR+cfp4W+PI3F8PaKrW8sAJwwvsawqrLu3jsLM1Qem/GqgjJ2cX/nFmbFjv6Ux9WVOZz qmAhY6xTTDT8VGAdekG+vS7k6Lgj7L/q5l/8/qkV83uWcN0ZsvasRsv01s6yjBGwi8OY KHkLAiUlR4oq1HT8fRBAyGe7qXDqK7RVXUS3qfALjrCwlLsXgjavriPZl6Yn5btqVqh5 LSDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rtCymIaJ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xb14-20020a170907070e00b007b28c6790edsi3899359ejb.205.2022.11.18.11.54.21; Fri, 18 Nov 2022 11:54:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rtCymIaJ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241649AbiKRTqm (ORCPT + 99 others); Fri, 18 Nov 2022 14:46:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235533AbiKRTqa (ORCPT ); Fri, 18 Nov 2022 14:46:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8522813D53 for ; Fri, 18 Nov 2022 11:46:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D94F62784 for ; Fri, 18 Nov 2022 19:46:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89731C433D6; Fri, 18 Nov 2022 19:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668800786; bh=X+7N1v7Ylhc12ODIGzGIdWud9IGuRB4PQ36hvFoPOac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rtCymIaJdlKGgicPDjzScEGeZBPbUtIgcMmx+JdSB+XgIeGV2D9NzjsYFOZBKJxbC mTmt6DKomct3OOuoZhJivhmhqsmBxhXZlaGdj6nyQ9/vOcZHlV6EybyfhnEphUV45W UzW60U0Jo4lFOKdgseR19Ex2eWkHZscbJJdsANorpstc7QhK4MzZN5bqV6KeZTNCmC 4fFMhbXOX7C4u9+jxk4WeZ+y/lJ9fDhD76a4ZhGDLUk5uRVAmKB5ngqS1dTOHcsPeN 8hG6t1IxUJsakY7i/b20aE0Q8HjbaCGCpMcAX0zH/XZxEmcE0EisvfQcxC38pCPBlZ B1Q5hcLouLkaA== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen , "Peter Zijlstra (Intel)" Subject: [PATCH v2 09/12] crypto: arm64/nhpoly1305 - eliminate unnecessary CFI wrapper Date: Fri, 18 Nov 2022 11:44:18 -0800 Message-Id: <20221118194421.160414-10-ebiggers@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118194421.160414-1-ebiggers@kernel.org> References: <20221118194421.160414-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Eric Biggers Since the CFI implementation now supports indirect calls to assembly functions, take advantage of that rather than use a wrapper function. Acked-by: Peter Zijlstra (Intel) Reviewed-by: Sami Tolvanen Signed-off-by: Eric Biggers --- arch/arm64/crypto/nh-neon-core.S | 5 +++-- arch/arm64/crypto/nhpoly1305-neon-glue.c | 11 ++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/arm64/crypto/nh-neon-core.S b/arch/arm64/crypto/nh-neon-core.S index 51c0a534ef87c..13eda08fda1e5 100644 --- a/arch/arm64/crypto/nh-neon-core.S +++ b/arch/arm64/crypto/nh-neon-core.S @@ -8,6 +8,7 @@ */ #include +#include KEY .req x0 MESSAGE .req x1 @@ -58,11 +59,11 @@ /* * void nh_neon(const u32 *key, const u8 *message, size_t message_len, - * u8 hash[NH_HASH_BYTES]) + * __le64 hash[NH_NUM_PASSES]) * * It's guaranteed that message_len % 16 == 0. */ -SYM_FUNC_START(nh_neon) +SYM_TYPED_FUNC_START(nh_neon) ld1 {K0.4s,K1.4s}, [KEY], #32 movi PASS0_SUMS.2d, #0 diff --git a/arch/arm64/crypto/nhpoly1305-neon-glue.c b/arch/arm64/crypto/nhpoly1305-neon-glue.c index c5405e6a6db76..cd882c35d9252 100644 --- a/arch/arm64/crypto/nhpoly1305-neon-glue.c +++ b/arch/arm64/crypto/nhpoly1305-neon-glue.c @@ -14,14 +14,7 @@ #include asmlinkage void nh_neon(const u32 *key, const u8 *message, size_t message_len, - u8 hash[NH_HASH_BYTES]); - -/* wrapper to avoid indirect call to assembly, which doesn't work with CFI */ -static void _nh_neon(const u32 *key, const u8 *message, size_t message_len, - __le64 hash[NH_NUM_PASSES]) -{ - nh_neon(key, message, message_len, (u8 *)hash); -} + __le64 hash[NH_NUM_PASSES]); static int nhpoly1305_neon_update(struct shash_desc *desc, const u8 *src, unsigned int srclen) @@ -33,7 +26,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc, unsigned int n = min_t(unsigned int, srclen, SZ_4K); kernel_neon_begin(); - crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon); + crypto_nhpoly1305_update_helper(desc, src, n, nh_neon); kernel_neon_end(); src += n; srclen -= n; -- 2.38.1