Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2576557pxb; Mon, 18 Apr 2022 03:56:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxLA0mgq5d/2FKQZJ24k+HBn6yu3GTuO3hYMQmzTe9rU9hCeTaxbNnWu2tewtbph11QEQ/ X-Received: by 2002:a17:90b:4d81:b0:1d2:8525:5f1c with SMTP id oj1-20020a17090b4d8100b001d285255f1cmr6833489pjb.27.1650279364652; Mon, 18 Apr 2022 03:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650279364; cv=none; d=google.com; s=arc-20160816; b=FYW+iZBF7zTc/4zN/O6UysMmLEoQzPcVgmYlR/kzlJgJgTY4XGl0QtoYrn0esdX+4p 8IWQ5gF8fXmpiy/lJWa0D7l2IKSsREPkXmkr0Z07auzN+JKSPKR1lCL/3vZdv/iRu/n/ UNWpO/x6yZ+B1+dObCs8XoDEz0UUTt1rfX7z7tOC6ppC3fk+cDkL4R4UiHDp1j+2GQRR dTqq3/MMIu4QTt+OP96pw+Blsnl50D3mpHePOqK9xudtwZEpBXjTWlyzEYVd/Yone9FX fIpy4iBnpOOLfHEz0Xf0t2DWPeiT1tCcxsqX0w/TbgrrY4DUcK8689LeekTkCuneIKIy QeCw== 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=3fu1A2Lha2zNRbC0q1NDUprRWGriIlHCqymqpbgfwVA=; b=lNfZ2H2xYCjwxCXyk63G5LRK9cYlOaRNVgXGJbUCWlddPGHPQiI0MHZ/keo/rIjvML Ztu2daftDSN0fq4Dsb2mkEWyff8O30tHD8HfZfj6z1gM7cJD6o82Jndhj7+7V56A0PX6 ccPe+Lt2pD0HcZwxNxsNsBJ1PJaOGCFVgrWSt97NpNF1OaegV/vR1jd/ibHia+jscIU8 HqjleOQ65tqPIsXJ2n3D1l3iNxyJAFWiaWSatHrszOO32zKFst97tJESMRK/mehJ24+Y zxwk4hNRbIBRnOzzOKOMUX+fI7upIBE8CZnhvdpCAYVo2h+r3JRrW34qgjoPOK4BDvBS Ey8A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a63a70a000000b0039800914255si9120910pgf.623.2022.04.18.03.55.49; Mon, 18 Apr 2022 03:56:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237443AbiDRJWI (ORCPT + 99 others); Mon, 18 Apr 2022 05:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230488AbiDRJWH (ORCPT ); Mon, 18 Apr 2022 05:22:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18241028 for ; Mon, 18 Apr 2022 02:19:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8F3AB80B4F for ; Mon, 18 Apr 2022 09:19:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56CBCC385A1; Mon, 18 Apr 2022 09:19:24 +0000 (UTC) Date: Mon, 18 Apr 2022 10:19:20 +0100 From: Catalin Marinas To: Herbert Xu 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=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 Mon, Apr 18, 2022 at 04:37:17PM +0800, Herbert Xu wrote: > 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 Herbert, that's great. Whenever you have time, I'll be busy this week with collecting arm64 patches for the upcoming merging window anyway. -- Catalin