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 5D160C433EF for ; Mon, 18 Apr 2022 09:19:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA7638D000B; Mon, 18 Apr 2022 05:19:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A578A8D0007; Mon, 18 Apr 2022 05:19:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91E708D000B; Mon, 18 Apr 2022 05:19:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 825958D0007 for ; Mon, 18 Apr 2022 05:19:30 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 494092432B for ; Mon, 18 Apr 2022 09:19:30 +0000 (UTC) X-FDA: 79369451700.21.BBF486A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id BBAC14000B for ; Mon, 18 Apr 2022 09:19:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8F68B80E40; Mon, 18 Apr 2022 09:19:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56CBCC385A1; Mon, 18 Apr 2022 09:19:24 +0000 (UTC) Date: Mon, 18 Apr 2022 10:19:20 +0100 From: Catalin Marinas To: Herbert Xu 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: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BBAC14000B X-Stat-Signature: rsajibfm9cuyhzsc3qfbk5pwuku83ff1 Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf04.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-Rspam-User: X-HE-Tag: 1650273569-738256 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 Mon, Apr 18, 2022 at 04:37:17PM +0800, Herbert Xu wrote: > 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 Herbert, that's great. Whenever you have time, I'll be busy this week with collecting arm64 patches for the upcoming merging window anyway. -- Catalin