Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp413926rwi; Wed, 12 Oct 2022 23:06:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZxJDXX7dg/m/poFEa4WNGg3M+DELpdYCrfNgS/eHHi9fMu3DtPxIYBCR+v6CXtQ8IJRR8 X-Received: by 2002:a50:ed86:0:b0:458:e1da:af2 with SMTP id h6-20020a50ed86000000b00458e1da0af2mr29967986edr.364.1665641185511; Wed, 12 Oct 2022 23:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665641185; cv=none; d=google.com; s=arc-20160816; b=a1tVpre1LoWKesONbNPue36EPn4265pkDU1Q22QDOBqMiFzv0iwp896B9OV+ndBNaF 4ZlxILYy1fTUs/nTgk/X9gxgP7aurupFoP+xYe6/Fyg7FBmBfL8cOSIv0JAY2zNj3Gvb P8nd1srUFPiPOOc9W6ocs3KjgZY6+MFZpClZCoP//aBz6yWqnJZcr/lypx3HBlYaJddq Zx2vujOGVnPebiKIlwVj8DflrO7dV4TkyjBxouq/jLzMxk6Tc3h8mP1seIn/eYOwH63S 7syG8oOFI9ca2T4wcUwnLOO7wKEi2/Q61ymY12qNyBjE+3yQKkOsyIdlgGHZzTvXMqKF amVw== 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=xCns7mdwfQYnsgCPOF4VhaoayKDHdXmO3mYdHc9qcNs=; b=NxkLJsRupQ6Jvd6/TsToyChTKbT+EdxhLYwOTsudMBbJfz4d5xCf09IOC77nL4XA2C RV0Q5A/Cv2VL/9yR593X4wJWjXlGJj/P3CpW3Rpwa47hVxmvczxdWkOlEYaMaE4pQOZz 4hu+YFIzfZ9GM4ncNP2AnJDQUQHekqHNgaI4sDWVPJ/irVr5IWrIiMOnvqxVDaNSUoYr 2fHI1LayRgA7C6gKQky+auIKR9a5XWMtRonhCmblauEUdzfamOpKv49Njfx3Vz1anDfg eie0TXXEIEDaAJQenoEUfXlMA+CEQcD8rBKf0TfhTpzIqm3uTSnpoOxa7Lh63mKyn43G XJfg== 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 z2-20020a1709063ac200b007879e9a7451si14504206ejd.816.2022.10.12.23.06.01; Wed, 12 Oct 2022 23:06:25 -0700 (PDT) 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 S229513AbiJMGFD (ORCPT + 99 others); Thu, 13 Oct 2022 02:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiJMGFB (ORCPT ); Thu, 13 Oct 2022 02:05:01 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E931E73E; Wed, 12 Oct 2022 23:04:56 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oirKl-00EDIl-KZ; Thu, 13 Oct 2022 17:04:44 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 13 Oct 2022 14:04:43 +0800 Date: Thu, 13 Oct 2022 14:04:43 +0800 From: Herbert Xu To: Eric Biggers Cc: Robert Elliott , davem@davemloft.net, tim.c.chen@linux.intel.com, ap420073@gmail.com, ardb@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 04/19] crypto: x86/sha - limit FPU preemption Message-ID: References: <20221006223151.22159-1-elliott@hpe.com> <20221012215931.3896-1-elliott@hpe.com> <20221012215931.3896-5-elliott@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Oct 12, 2022 at 10:57:04PM -0700, Eric Biggers wrote: > > 'len' can't be 0 at the beginning of this loop, so the 'if (chunk)' check isn't > needed. And it wouldn't make sense even if 'len' could be 0, since a while loop > could just be used in that case. I don't see anything preventing len from being zero if this gets called directly by a user of the Crypto API through crypto_shash_update. But yes a while loop would be a lot cleaner. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt