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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF7F2C4321E for ; Mon, 28 Nov 2022 04:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiK1EGK (ORCPT ); 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: 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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC91EC4321E for ; Mon, 28 Nov 2022 04:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/1GGDXE71zTvyRjdWvGMSnL1KlHJicq32ypfiSk6xeQ=; b=UkoNVp7EsSYa70 1mORhPxMRlAiEJlaIThiMC4lSU9cX+tw8GXJalLB7l4kblLBdya1feCOt6OVnXCbEvtXv9QY/eAfs fMsa4mkdymCoROnYWhEcw+CMy4FhaxD3wTOawraIsEWu2h3qKdFBCXnuJw6b4FjZGyiRbUPLIziKD hEDKuOQkXATqFjtY4nqxHkZ5gnf5et9HdzJrfAr0vFRZOGJsuAh4eQ2QNVCjOg1IgvgUXpWuryvtS v5u8lw6UzQdHj+q6njZyPd+sL2xFfucPQt9BzRNEBkOBIOBOFs/1FnEEhi7jwgqAlqWyyY13JWFYg AfwvPf5/3sAdYcCB2dYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozVP4-00Flpo-Pa; Mon, 28 Nov 2022 04:05:58 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=formenos.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozVP0-00FlmN-9Z for linux-arm-kernel@lists.infradead.org; Mon, 28 Nov 2022 04:05:56 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221127_200554_371113_D691DD67 X-CRM114-Status: GOOD ( 11.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel