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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD9EC433F5 for ; Mon, 18 Apr 2022 08:37:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A9668D000A; Mon, 18 Apr 2022 04:37:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15AFE8D0007; Mon, 18 Apr 2022 04:37:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 022258D000A; Mon, 18 Apr 2022 04:37:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id E6BD68D0007 for ; Mon, 18 Apr 2022 04:37:43 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BB4831EAB for ; Mon, 18 Apr 2022 08:37:43 +0000 (UTC) X-FDA: 79369346406.21.227B22E Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf21.hostedemail.com (Postfix) with ESMTP id ADC6E1C0006 for ; Mon, 18 Apr 2022 08:37:42 +0000 (UTC) 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: Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of herbert@gondor.apana.org.au designates 216.24.177.18 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: ADC6E1C0006 X-Stat-Signature: 989n3zmunjgcb7nt8xcqgjxrcisyb6gu X-HE-Tag: 1650271062-96482 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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