Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A54ADC05027 for ; Fri, 10 Feb 2023 01:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230266AbjBJBFu convert rfc822-to-8bit (ORCPT ); Thu, 9 Feb 2023 20:05:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbjBJBFt (ORCPT ); Thu, 9 Feb 2023 20:05:49 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 813AD5CBF0; Thu, 9 Feb 2023 17:05:47 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id DA45C24E214; Fri, 10 Feb 2023 09:05:37 +0800 (CST) Received: from EXMBX065.cuchost.com (172.16.6.65) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 10 Feb 2023 09:05:35 +0800 Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX065.cuchost.com (172.16.6.65) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 10 Feb 2023 09:05:35 +0800 Received: from EXMBX168.cuchost.com ([fe80::3c2d:dee5:4938:3fc4]) by EXMBX168.cuchost.com ([fe80::3c2d:dee5:4938:3fc4%16]) with mapi id 15.00.1497.044; Fri, 10 Feb 2023 09:05:35 +0800 From: JiaJie Ho To: Herbert Xu CC: "David S . Miller" , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Conor Dooley , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" Subject: RE: [PATCH v2 4/4] crypto: starfive - Add hash and HMAC support Thread-Topic: [PATCH v2 4/4] crypto: starfive - Add hash and HMAC support Thread-Index: AQHZNMIM/vLXVq3JgUiER7vBRC/T367F3jsAgACIQGD//3/YAIABh3JA Date: Fri, 10 Feb 2023 01:05:35 +0000 Message-ID: <40ea0c9789b840e6a51ea799fa8da9e6@EXMBX168.cuchost.com> References: <20230130154242.112613-1-jiajie.ho@starfivetech.com> <20230130154242.112613-5-jiajie.ho@starfivetech.com> <88a62a7a11814d629e2198583a0349b6@EXMBX168.cuchost.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [202.190.105.77] x-yovoleruleagent: yovoleflag Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > -----Original Message----- > From: Herbert Xu > Sent: 9 February, 2023 5:44 PM > To: JiaJie Ho > Cc: David S . Miller ; Rob Herring > ; Krzysztof Kozlowski > ; Emil Renner Berthing > ; Conor Dooley ; linux- > crypto@vger.kernel.org; devicetree@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-riscv@lists.infradead.org > Subject: Re: [PATCH v2 4/4] crypto: starfive - Add hash and HMAC support > > On Thu, Feb 09, 2023 at 09:33:06AM +0000, JiaJie Ho wrote: > > > > The DMA can only support 32-bit addressing. > > So, I am copying everything in case kernel allocated memory region >32-bit > for a user app. > > Does your hardware support scatter-and-gather? If so you should at least > allocate individual pages rather than one contiguous buffer. > > Then you can allocate them on-demand rather than before-hand. > > It would also be nice to not do the copy if the input you were given was in > low memory (and contiguous if your hardware doesn't do SG). > I'll try this then. Thanks, Jia Jie