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 0B709C433EF for ; Tue, 12 Apr 2022 10:20:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 924356B007B; Tue, 12 Apr 2022 06:20:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AD956B0080; Tue, 12 Apr 2022 06:20:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74FEB6B0081; Tue, 12 Apr 2022 06:20:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 66D076B007B for ; Tue, 12 Apr 2022 06:20:18 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1E4FEA8348 for ; Tue, 12 Apr 2022 10:20:18 +0000 (UTC) X-FDA: 79347832116.31.29ACACD Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf24.hostedemail.com (Postfix) with ESMTP id 8D3E0180006 for ; Tue, 12 Apr 2022 10:20:17 +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 B04E7B81C57; Tue, 12 Apr 2022 10:20:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40E7EC385A5; Tue, 12 Apr 2022 10:20:12 +0000 (UTC) Date: Tue, 12 Apr 2022 11:20:08 +0100 From: Catalin Marinas To: Herbert Xu 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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf24.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 8D3E0180006 X-Stat-Signature: m18pxrsw76h8fey7pus45m8dirhi4aea X-HE-Tag: 1649758817-700281 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 Tue, Apr 12, 2022 at 11:02:54AM +0100, Catalin Marinas wrote: > On Tue, Apr 12, 2022 at 05:40:58PM +0800, Herbert Xu wrote: > > I think if CRYPTO_MINALIGN makes those drivers work then so > > should cra_alignmask. And that would be a relatively easy > > patch to do. > > Yes, the patch would be simple, subject to figuring out which drivers > and what alignment they actually need (any help appreciated). > > There are already arm64 vendor kernels that change ARCH_DMA_MINALIGN to > 64, hence ARCH_KMALLOC_MINALIGN and CRYPTO_MINALIGN become 64. We also > discussed a Kconfig option for this in the past. Would that have broken > any crypto drivers that rely on a strict 128 byte alignment? Actually, I think with a cra_alignmask of 127 (the arm64 CRYPTO_MINALIGN-1), crypto_check_alg() will fail since MAX_ALGAPI_ALIGNMASK is 63. -- Catalin