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 B602EC433FE for ; Mon, 7 Nov 2022 02:22:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF8A78E0002; Sun, 6 Nov 2022 21:22:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EA8218E0001; Sun, 6 Nov 2022 21:22:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D96EC8E0002; Sun, 6 Nov 2022 21:22:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CBBBD8E0001 for ; Sun, 6 Nov 2022 21:22:51 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 41E9F1C64F7 for ; Mon, 7 Nov 2022 02:22:51 +0000 (UTC) X-FDA: 80105048142.28.484B477 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf27.hostedemail.com (Postfix) with ESMTP id 2F3A040004 for ; Mon, 7 Nov 2022 02:22:49 +0000 (UTC) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1orrld-00AtFK-MB; Mon, 07 Nov 2022 10:22:19 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Mon, 07 Nov 2022 10:22:18 +0800 Date: Mon, 7 Nov 2022 10:22:18 +0800 From: Herbert Xu To: Catalin Marinas Cc: Linus Torvalds , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 11/13] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: <20221106220143.2129263-1-catalin.marinas@arm.com> <20221106220143.2129263-12-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221106220143.2129263-12-catalin.marinas@arm.com> ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of herbert@gondor.apana.org.au designates 216.24.177.18 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667787771; a=rsa-sha256; cv=none; b=nbgc613NKnFx/OJKFR+S6X7Y2ehOum7QupPB1OKRaEgZbnbzyJGrssm/0mUBL3k4M3h0LR Y609qWYvq7/da2+DHCeQOjWRZLVhP25B185gFeV+yhY1CH3LXDzlykF3U6U+1TM451oIGa pzlePsWw+ki1Cd9uqxu1JycLyEMFnrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667787771; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D0WKoACh0GoBMsETx+Y4xmkKT+SobxmDzFrska9dTiE=; b=fVxgzzAHLPfxFKbqzZUS6g9GFr4vSiek5KIb58PyWj12SuwqUE6GNXPY/FXRf6dy0Z/xSx /qLuj7n+RKdCl7d9DoCduYu+GYCY1KIR5/TRJrEeS3GPMV7xlM+hVp96Wr3e9zEa1OcE6E eSfhrwAcsk0bBqYzWqXLf0RHlSGcU0Y= X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.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-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2F3A040004 X-Stat-Signature: wjj91gkts9gnnoqkmn1bqm8tk1wc6t1n X-HE-Tag: 1667787769-746557 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 Sun, Nov 06, 2022 at 10:01:41PM +0000, Catalin Marinas wrote: > ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA > operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() > alignment. This will ensure that the static alignment of various > structures or members of those structures( e.g. __ctx[] in struct > aead_request) is safe for DMA. Note that sizeof such structures becomes > aligned to ARCH_DMA_MINALIGN and kmalloc() will honour such alignment, > so there is no confusion for the compiler. > > Signed-off-by: Catalin Marinas > Cc: Herbert Xu > Cc: Ard Biesheuvel > --- > > I know Herbert NAK'ed this patch but I'm still keeping it here > temporarily, until we agree on some refactoring at the crypto code. FTR, > I don't think there's anything wrong with this patch since kmalloc() > will return ARCH_DMA_MINALIGN-aligned objects if the sizeof such objects > is a multiple of ARCH_DMA_MINALIGN (side-effect of > CRYPTO_MINALIGN_ATTR). As I said before changing CRYPTO_MINALIGN doesn't do anything and that's why this patch is broken. To get what you want the drivers have to be modified. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt