Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3164090pxb; Mon, 18 Apr 2022 17:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtPj7EMjO83CPI4C89nCO7FRSSwG+qoRVyRRxjh8DaFudpiUlyQ2Kteo9y/Zn6frGzmLed X-Received: by 2002:a05:6a00:10cc:b0:506:e0:d6c3 with SMTP id d12-20020a056a0010cc00b0050600e0d6c3mr14970526pfu.33.1650329239245; Mon, 18 Apr 2022 17:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650329239; cv=none; d=google.com; s=arc-20160816; b=d3VAueHRIGxYF7hsObVlnJVZW868DWcwLZSyTreuP3BftlG9XzIH2V52/uIMZ+4gMZ BQN3QmizDD1pTGVWU7IC108xoqxPXIHAE+IMVrmfsEgE8OXiNWwV4YxMoCRXNhy0bOv0 D19FaoZWcO0WWLVrwbWlgvgY0qDvY90M2p3rqdGGiFaLiy1YcIbrWsXLwYdIPc9jvxer HAOysio7WJB/TdW4qT5jRF/k7tECjcExhtHwBBq05JlqLYEb/7BTkdHoDoqJbAKHeYt/ d1HLBTdTMmp0NUoUkkPGAMfXb/KU/4nvgTic+u0w1GX9QqQDlq5QraWg3TkeTPQ6Hg2m 17mg== 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=St4iCS8Ftl0P9VN3yKcskCmmqBaX5urewo56yCvCMHo=; b=P2gEfuBbgD9UlI88cYIF6W7l02GqD3qF6QplvG/i+Ta1CbtAWl0TmlwO63WNSFpNta Wdkfx3bvce99qdCMBFIw671LTOgr0W7HRG9U0CSWZD3rS99oqC9IJl2PI9QYwTdkRY1J b8TPnCoSWq/STRrMhIxURymA9j5ufTuNGm9uIXF6QDDGz7SqpGHrcNEaEVa8l1lAPlpv ZWB3wBkrm/F81caNx33pQD+kULN9L5oc/WuHVcfMduIQ7CKVMCkcQgTZPWq/8LNJMOs5 WWDIaMtqZUSgb49rLBz3LvNM1IKBmC27YqAiWfO3JT1UkHQsq5ux6pPQ0JltBJ3ABIPI VQiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 g11-20020a63fa4b000000b003983fed820asi10286095pgk.242.2022.04.18.17.47.03; Mon, 18 Apr 2022 17:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236300AbiDRIk1 (ORCPT + 99 others); Mon, 18 Apr 2022 04:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbiDRIk0 (ORCPT ); Mon, 18 Apr 2022 04:40:26 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0796A1903C for ; Mon, 18 Apr 2022 01:37:47 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1ngMsn-003w82-F8; Mon, 18 Apr 2022 18:37:18 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Mon, 18 Apr 2022 16:37:17 +0800 Date: Mon, 18 Apr 2022 16:37:17 +0800 From: Herbert Xu To: Catalin Marinas Cc: Ard Biesheuvel , 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" 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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Sun, Apr 17, 2022 at 05:30:27PM +0100, Catalin Marinas wrote: > > Do you mean as per Ard's proposal here: > > https://lore.kernel.org/r/CAMj1kXH0x5Va7Wgs+mU1ONDwwsazOBuN4z4ihVzO2uG-n41Kbg@mail.gmail.com > > struct crypto_request { > union { > struct { > ... fields ... > }; > u8 __padding[ARCH_DMA_MINALIGN]; > }; > void __ctx[] __aligned(CRYPTO_MINALIGN); > }; > > If CRYPTO_MINALIGN is lowered to, say, 8 (to be the same as lowest > ARCH_KMALLOC_MINALIGN), the __alignof__(req->__ctx) would be 8. > Functions like crypto_tfm_ctx_alignment() will return 8 when what you > need is 128. We can change those functions to return ARCH_DMA_MINALIGN > instead or always bump cra_alignmask to ARCH_DMA_MINALIGN-1. OK, at this point I think we need to let the code do the talking :) I've seen Ard's patches already and I think I understand what your needs are. So let me whip up some code to show you guys what I think needs to be done. Please bear with me for a few days. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt