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 1E620C433EF for ; Fri, 15 Apr 2022 10:12:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E0666B0071; Fri, 15 Apr 2022 06:12:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 990526B0073; Fri, 15 Apr 2022 06:12:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87EB16B0074; Fri, 15 Apr 2022 06:12:37 -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 79C4C6B0071 for ; Fri, 15 Apr 2022 06:12:37 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 47BD180DE6 for ; Fri, 15 Apr 2022 10:12:37 +0000 (UTC) X-FDA: 79358699154.10.58DB324 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf21.hostedemail.com (Postfix) with ESMTP id 1FF661C0002 for ; Fri, 15 Apr 2022 10:12:35 +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 1nfIvz-003FtZ-Db; Fri, 15 Apr 2022 20:12:12 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 15 Apr 2022 18:12:11 +0800 Date: Fri, 15 Apr 2022 18:12:11 +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: 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: rspam12 X-Rspamd-Queue-Id: 1FF661C0002 X-Stat-Signature: egikaeospy3fudpd676kouapig7uu6da X-HE-Tag: 1650017555-529648 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 11:51:49AM +0200, Ard Biesheuvel wrote: > > That is the whole point, really: ARCH_DMA_MINALIGN==128 does not mean > __ctx needs to be aligned to 128 bytes, it only means that it should > not share a 128 byte cacheline with the preceding fields. So if > kmalloc() returns buffers that are aligned to whatever alignment the > platform requires (which will be 64 in most cases), the above > arrangement ensures that, without requiring that CRYPTO_MINALIGN == > ARCH_DMA_MINALIGN. What if they started sharing a cacheline with the subsequent object? I guess you could add some more padding at the end though. I could accept this as a temporary solution, if you volunteer to modify all the affected drivers so we can get rid of this bandaid. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt