From mboxrd@z Thu Jan 1 00:00:00 1970 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 5EBECC433EF for ; Mon, 18 Apr 2022 08:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237151AbiDRIk1 (ORCPT ); Mon, 18 Apr 2022 04:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbiDRIk0 (ORCPT ); Mon, 18 Apr 2022 04:40:26 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0796A1903C for ; Mon, 18 Apr 2022 01:37:47 -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 1ngMsn-003w82-F8; Mon, 18 Apr 2022 18:37:18 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Mon, 18 Apr 2022 16:37:17 +0800 Date: Mon, 18 Apr 2022 16:37:17 +0800 From: Herbert Xu To: Catalin Marinas Cc: Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 17, 2022 at 05:30:27PM +0100, Catalin Marinas wrote: > > Do you mean as per Ard's proposal here: > > https://lore.kernel.org/r/CAMj1kXH0x5Va7Wgs+mU1ONDwwsazOBuN4z4ihVzO2uG-n41Kbg@mail.gmail.com > > struct crypto_request { > union { > struct { > ... fields ... > }; > u8 __padding[ARCH_DMA_MINALIGN]; > }; > void __ctx[] __aligned(CRYPTO_MINALIGN); > }; > > If CRYPTO_MINALIGN is lowered to, say, 8 (to be the same as lowest > ARCH_KMALLOC_MINALIGN), the __alignof__(req->__ctx) would be 8. > Functions like crypto_tfm_ctx_alignment() will return 8 when what you > need is 128. We can change those functions to return ARCH_DMA_MINALIGN > instead or always bump cra_alignmask to ARCH_DMA_MINALIGN-1. OK, at this point I think we need to let the code do the talking :) I've seen Ard's patches already and I think I understand what your needs are. So let me whip up some code to show you guys what I think needs to be done. Please bear with me for a few days. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 678C8C433F5 for ; Mon, 18 Apr 2022 08:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bXpd85VfwSlfPTGXtgDUPaZ8IH4MZrotIP3ux9xoC3I=; b=t7WMbDve1D3G6O zvOG65uZEsg8u7BL5czd0piN7nPk7zjY6RnXbM/h0cwxmYx9oEurjpoNCIEP5obnESu7fmhYnXRjL +lHsmGg/IwzFXwMMxBC+GDrZ5nR7kFJOcmpyAi9d8RFv7I0QXrQre0iz6x9hmjwXu747HlBDw2wWG mvOBKnga7uxwJAnsW9VZtbrluIsnla7Ga07HMyX4+Aq/eE3KCOTga5NQkBoOJLqmox/TXFa7JyLG+ hO3ashXkHcOhUoX1d39lVUMP+4NeejMnqlZFmhBqOQRxhH6bY5+K6drGyhd1h1nmIgef2UahIiS3t /jEFkpNRR6pVqnNImEbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngMtU-00G52x-2A; Mon, 18 Apr 2022 08:38:00 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=fornost.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngMtM-00G4ur-Fs for linux-arm-kernel@lists.infradead.org; Mon, 18 Apr 2022 08:37:58 +0000 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 1ngMsn-003w82-F8; Mon, 18 Apr 2022 18:37:18 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Mon, 18 Apr 2022 16:37:17 +0800 Date: Mon, 18 Apr 2022 16:37:17 +0800 From: Herbert Xu To: Catalin Marinas Cc: Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Linux Memory Management List , Linux ARM , Linux Kernel Mailing List , "David S. Miller" Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_013752_564877_8655D504 X-CRM114-Status: GOOD ( 14.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Apr 17, 2022 at 05:30:27PM +0100, Catalin Marinas wrote: > > Do you mean as per Ard's proposal here: > > https://lore.kernel.org/r/CAMj1kXH0x5Va7Wgs+mU1ONDwwsazOBuN4z4ihVzO2uG-n41Kbg@mail.gmail.com > > struct crypto_request { > union { > struct { > ... fields ... > }; > u8 __padding[ARCH_DMA_MINALIGN]; > }; > void __ctx[] __aligned(CRYPTO_MINALIGN); > }; > > If CRYPTO_MINALIGN is lowered to, say, 8 (to be the same as lowest > ARCH_KMALLOC_MINALIGN), the __alignof__(req->__ctx) would be 8. > Functions like crypto_tfm_ctx_alignment() will return 8 when what you > need is 128. We can change those functions to return ARCH_DMA_MINALIGN > instead or always bump cra_alignmask to ARCH_DMA_MINALIGN-1. OK, at this point I think we need to let the code do the talking :) I've seen Ard's patches already and I think I understand what your needs are. So let me whip up some code to show you guys what I think needs to be done. Please bear with me for a few days. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel