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 09EA0C433F5 for ; Fri, 15 Apr 2022 08:12:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D36C6B0071; Fri, 15 Apr 2022 04:12:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 582D76B0073; Fri, 15 Apr 2022 04:12:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 470C36B0074; Fri, 15 Apr 2022 04:12:23 -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 39DC56B0071 for ; Fri, 15 Apr 2022 04:12:23 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 002FE62A2F for ; Fri, 15 Apr 2022 08:12:22 +0000 (UTC) X-FDA: 79358396124.04.7E55D14 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf28.hostedemail.com (Postfix) with ESMTP id 5463CC0005 for ; Fri, 15 Apr 2022 08:12:22 +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 1nfH3j-003EAz-G7; Fri, 15 Apr 2022 18:12:04 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 15 Apr 2022 16:12:03 +0800 Date: Fri, 15 Apr 2022 16:12:03 +0800 From: Herbert Xu To: Ard Biesheuvel Cc: Catalin Marinas , 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: 5463CC0005 X-Stat-Signature: qnqo3t389ajmkybgeurdueubhc7h1tyh Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.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-HE-Tag: 1650010342-634990 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 Fri, Apr 15, 2022 at 10:05:21AM +0200, Ard Biesheuvel wrote: > > I guess that should be fixable. GIven that this is about padding > rather than alignment, we could do something like > > struct crypto_request { > union { > struct { > ... fields ... > }; > u8 __padding[ARCH_DMA_MINALIGN]; > }; > void __ctx[] __align(CRYPTO_MINALIGN); > }; > > And then hopefully, we can get rid of the padding once we fix drivers > doing non-cache coherent inbound DMA into those structures. Sorry, I don't think this works. kmalloc can still return something that's not ARCH_DMA_MINALIGN-aligned, and therefore __ctx won't be aligned correctly. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt