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 543F0C4321E for ; Mon, 28 Nov 2022 04:05:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9D2A6B0072; Sun, 27 Nov 2022 23:05:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C481B6B0073; Sun, 27 Nov 2022 23:05:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B35496B0074; Sun, 27 Nov 2022 23:05:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A71636B0072 for ; Sun, 27 Nov 2022 23:05:54 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 63D59160B3F for ; Mon, 28 Nov 2022 04:05:54 +0000 (UTC) X-FDA: 80181512628.06.227635E Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by imf30.hostedemail.com (Postfix) with ESMTP id 8BC6980011 for ; Mon, 28 Nov 2022 04:05:53 +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 1ozVOm-001Oie-L9; Mon, 28 Nov 2022 12:05:41 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Mon, 28 Nov 2022 12:05:40 +0800 Date: Mon, 28 Nov 2022 12:05:40 +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" , Linux Crypto Mailing List Subject: Re: [v2 PATCH 0/9] crypto: Add helpers for allocating with DMA alignment Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669608354; 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=L7EcwS4H9tow+BBEKkgart48dpBCxyKE2MkzkIanvCo=; b=HTdusrJ5NxZuD3F2BCe1Y4rxwG0c1VEQBDkIZvL0B+mWzVyMrLUmDxWF4aSVTdQATZJ0Ua ntkKRc02xmivDXEL29oYA/KJz5xlCs40bF2L8bx2HSRTiv59XVZYqUsoItihkfIJAU1+9f Izd8ElDP5ikETYgJQXKNh8ULzN0LAps= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.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=1669608354; a=rsa-sha256; cv=none; b=sLaRLkGsaRZ/n+alJ6JDRO00i1MVBttqDo+VYDz/LNOsivhL8ynykJmwRWwrVhZFl8ZkXZ RVS0RYrO+hMl/9nrUM3Pkb4AJUHxYn8Sz0/y37omO4M7hFEZ/jw9ll7oeKzbboiO1OvzwW 1I9NByOHzsqyTEH4Bh7EaIo4594r+cg= X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.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-Stat-Signature: 9eazjwxq757q9x7xqx78ajnbpbdujoar X-Rspamd-Queue-Id: 8BC6980011 X-Rspamd-Server: rspam08 X-HE-Tag: 1669608353-773551 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, Nov 25, 2022 at 01:17:55PM +0100, Ard Biesheuvel wrote: > > We'd still need changes in the generic crypto layer to distinguish the > two cases, but we wouldn't need any changes to the drivers, which > seems like a huge benefit to me I think we should go through the drivers anyway. Because it isn't just allocations from the Crypto API that'll bite us. When I'm working through the drivers, I'm actually looking at what they're mapping for DMA and where it's coming from. Only when the driver stores DMA-mapped data in the ctx structures am I changing the drivers to add the extra padding. Some of the drviers are doing small allocations for things like the IV or keys with the GFP_DMA flag and hoping that it gives the correct alignment. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt