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 B1E8DC433F5 for ; Thu, 7 Apr 2022 11:41:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 246346B0073; Thu, 7 Apr 2022 07:41:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F6186B0074; Thu, 7 Apr 2022 07:41:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BE9F6B0075; Thu, 7 Apr 2022 07:41:31 -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 EE7B96B0073 for ; Thu, 7 Apr 2022 07:41:30 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id AA7848272C for ; Thu, 7 Apr 2022 11:41:20 +0000 (UTC) X-FDA: 79329892320.04.10DF41F Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf28.hostedemail.com (Postfix) with ESMTP id 38569C000A for ; Thu, 7 Apr 2022 11:41:19 +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 1ncQVX-0006Sw-Mv; Thu, 07 Apr 2022 21:41:01 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 07 Apr 2022 19:41:00 +0800 Date: Thu, 7 Apr 2022 19:40:59 +0800 From: Herbert Xu To: Catalin Marinas Cc: Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "David S. Miller" Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: <20220405135758.774016-1-catalin.marinas@arm.com> <20220405135758.774016-8-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Stat-Signature: 53dtnyjwoa8tf17owosnz9u3uccf8wzj Authentication-Results: imf28.hostedemail.com; dkim=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; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 38569C000A X-HE-Tag: 1649331679-103586 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 Thu, Apr 07, 2022 at 12:01:02PM +0100, Catalin Marinas wrote: > > The only issue is whether the compiler gets confused by a pointer to a > structure with a smaller alignment than alignof(struct ...). I don't see > a performance or correctness issue on arm64 here. It would be a problem > if instead of 16 we went down to 8 or 4 due to unaligned accesses but > from 128 to 64 (or even 16), I don't think it matters. The issue is that there's code in the Crypto API which assumes that all pointers returned by kmalloc are aligned to CRYPTO_MINALIGN, if you break that then all that code would need to be modified. However, I think it's better to change the code that assumes CRYPTO_MINALIGN guarantees DMA alignment. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt