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 D2EE4C6379F for ; Tue, 14 Feb 2023 07:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbjBNHRC convert rfc822-to-8bit (ORCPT ); Tue, 14 Feb 2023 02:17:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231774AbjBNHQs (ORCPT ); Tue, 14 Feb 2023 02:16:48 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27429234E5; Mon, 13 Feb 2023 23:14:06 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 411AD24E39A; Tue, 14 Feb 2023 15:11:03 +0800 (CST) Received: from EXMBX164.cuchost.com (172.16.7.74) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 14 Feb 2023 15:11:03 +0800 Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX164.cuchost.com (172.16.6.74) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 14 Feb 2023 15:11:02 +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; Tue, 14 Feb 2023 15:11:02 +0800 From: JiaJie Ho To: Christoph Hellwig , 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/YAIAHoM+AgACWCMA= Date: Tue, 14 Feb 2023 07:11:02 +0000 Message-ID: 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: Christoph Hellwig > Sent: 14 February, 2023 2:13 PM > To: Herbert Xu > Cc: JiaJie Ho ; 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 05:43:34PM +0800, Herbert Xu wrote: > > 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). > > All of that is done by the DMA API, or more specifically swiotlb and does not > need to be duplicated in individual drivers. I'll update the driver accordingly. Thanks Christoph and Herbert for the pointers. Regards Jia Jie