Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14217173rwb; Sun, 27 Nov 2022 20:08:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zPA99OmMd+rKnzudz0Uw+Grhj0IwHZES/5vHe+BoEBcsq0dKtZf1IrJT18gZdiIpRf4li X-Received: by 2002:a05:6402:321e:b0:469:ebc0:2247 with SMTP id g30-20020a056402321e00b00469ebc02247mr26280989eda.217.1669608481181; Sun, 27 Nov 2022 20:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669608481; cv=none; d=google.com; s=arc-20160816; b=hKrUEOgoBeT1rjJN0Lw0d5v5aB1moD2VRd4jQAMHP2IAcsMutPZVDaVEN5PVLf07gs Z1iZL8Ru0IylypYPp0AQWmEiURDxZBGJ9JoXiBqp37wGprliYEGj27eVYoQGYTH4f4QR THnC62A7pw2DiTCvWzSYDVpvqF48+bt797cf72iO+7jggKkahYvD3fyzjJHB4QbIJrJ7 fwXTNt1+0StVMv+Zv10BN11bPqKmi7r88zIZw77WvyDETdZeL5u2/KmCiLiZn+3d2GUZ BAjGlxAekdWlIzoTIKznu5KU/AYzdKSgBLem5RG2fgodUmMWWSZgMzkpl/J66ICMQT3c Eqag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=L7EcwS4H9tow+BBEKkgart48dpBCxyKE2MkzkIanvCo=; b=tV3ua7k9WlS9HMjYzhDf3g0TEVWWGieu8Oo9T+mbTQQrIRZKEyTR2MqVkeeYDnhJBC e0ANuUS/cZtvo/TE2ZZmseQN/WZXmhiITZ+wvka3pEPPJjVz/6kn5nrL3DsbePFGTteE KYxsT5DOzLg+IIoXcO0Yg2q/ZGtrOD7UhiqCKEvX3nyopu/sC2s6vEAJw55+lTm1tZBl /jwlXK3Yr1AIs1hqtbVIDdO061r/X4rVY/Aj8KfhhvSpqeUkxIjhpTtE232V3KdkaT+o 05NvMV0DM+GBqG9UKhyeVITSjYPHVIr/7IbGOg8H90urW1Aa5q3ESAn8yxrmMew5BZha 68wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga19-20020a1709070c1300b007c0553fad58si669288ejc.422.2022.11.27.20.07.37; Sun, 27 Nov 2022 20:08:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiK1EGK (ORCPT + 99 others); Sun, 27 Nov 2022 23:06:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbiK1EF7 (ORCPT ); Sun, 27 Nov 2022 23:05:59 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B836421; Sun, 27 Nov 2022 20:05:58 -0800 (PST) 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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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