Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6967634rwl; Fri, 30 Dec 2022 01:08:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXtlaL90MFrxNJOta6J0Y7c3OppoKV9+V2fwyIA6+c1Q+nqk8DY7x2rno3EsnJoET9/pnmoE X-Received: by 2002:a17:902:70ca:b0:192:a1e0:261d with SMTP id l10-20020a17090270ca00b00192a1e0261dmr5129914plt.56.1672391331787; Fri, 30 Dec 2022 01:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672391331; cv=none; d=google.com; s=arc-20160816; b=eJ624hCiKFtmmnanIo90jdngO5PluSzFYpPa2YUbA+sKiseUAAJFlcDzNkXUbV48Ae Wafc1KM8k0UvB4T4cHpbFJl1VFa902wCg1hGl1P+B0NNakWiIGIlXW/+ps5CnTRIRAjx AFrDCyz6B93lnGFo2gQ2y14eMILTCpOAn9RFC7itKwaAjl9Eh0ZvMEa1uymwjHyc/htV z6t7v+Ph6xllF17LExsXHzxYtRq6Wf8eSpqluKiNmotUiQztIodVOCSckP0BnM+2b/4M PrSdQ3pLy+AHYaacTgt6422fm/GbOpsevkElIhI6eM3XULyiRmEWGcShG4cmiR/TWMlC yCQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=9nJRA6B0euqJjuWsWRzkUI/5qgQIVmhPyFqZ+RZKgWc=; b=tecOKxDuhqNgvzNFKveMO7m3aUltTrLoEt4e0GSEHrUQvnEtCdw6emT0xnmyix3bct WAi8OgRphVUKZOmd4eR4Gm6GYaRn2nTUDwZC+KyGOZHrgWwUghA5WrEfhC5kIVreLpkP YpEL/Tt63SpjS4e7YJEkiFPpLNmJ72koiHpdwutwGDVp4cPAvf1/tPQ127cVBhk9jUYS thBEjnEa8iyjAYn4LAvTYeRn0v2+B4Dd1I5AhEcv8Y5k4lJfUWz/vfXSb/thm+edvTgS UCw87kUJtOCIi/DoTqPBwOHck6PA07IghMRNjnvaUXDkrTUNPbUWsXJ/kA3Awiiqh4HC yslw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a170902ee4c00b0018c91adca12si20421648plo.529.2022.12.30.01.08.38; Fri, 30 Dec 2022 01:08:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbiL3JI0 (ORCPT + 99 others); Fri, 30 Dec 2022 04:08:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbiL3JIZ (ORCPT ); Fri, 30 Dec 2022 04:08:25 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E694228D; Fri, 30 Dec 2022 01:08:24 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pBBMu-00CI8h-TN; Fri, 30 Dec 2022 17:08:01 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 30 Dec 2022 17:08:00 +0800 Date: Fri, 30 Dec 2022 17:08:00 +0800 From: Herbert Xu To: Robert Elliott Cc: davem@davemloft.net, Jason@zx2c4.com, ardb@kernel.org, ap420073@gmail.com, David.Laight@aculab.com, ebiggers@kernel.org, tim.c.chen@linux.intel.com, peter@n8pjl.ca, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/13] crypto: x86/sha - yield FPU context during long loops Message-ID: References: <20221219220223.3982176-1-elliott@hpe.com> <20221219220223.3982176-4-elliott@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221219220223.3982176-4-elliott@hpe.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 On Mon, Dec 19, 2022 at 04:02:13PM -0600, Robert Elliott wrote: > > diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S > index c3ee9334cb0f..df03fbb2c42c 100644 > --- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S > +++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S > @@ -58,9 +58,9 @@ > /* > * SHA-1 implementation with Intel(R) AVX2 instruction set extensions. > * > - *This implementation is based on the previous SSSE3 release: > - *Visit http://software.intel.com/en-us/articles/ > - *and refer to improving-the-performance-of-the-secure-hash-algorithm-1/ > + * This implementation is based on the previous SSSE3 release: > + * Visit http://software.intel.com/en-us/articles/ > + * and refer to improving-the-performance-of-the-secure-hash-algorithm-1/ Could you please leave out changes which are not related to the main purpose of this patch? Put them into a separate patch if necessary. > diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c > index 44340a1139e0..b269b455fbbe 100644 > --- a/arch/x86/crypto/sha1_ssse3_glue.c > +++ b/arch/x86/crypto/sha1_ssse3_glue.c > @@ -41,9 +41,7 @@ static int sha1_update(struct shash_desc *desc, const u8 *data, > */ > BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0); > > - kernel_fpu_begin(); > sha1_base_do_update(desc, data, len, sha1_xform); > - kernel_fpu_end(); Moving kernel_fpu_begin/kernel_fpu_end down seems to be entirely unnecessary as you could already call kernel_fpu_yield deep down the stack with the current code. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt