Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1033045pxb; Fri, 15 Apr 2022 19:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBX9pX1NKfp8Vm/9SBCUAu5FDEM2xKzYl0ucpd1wWrWT2jHp9JZxh/hBmMm6bcJOxmAoyz X-Received: by 2002:a17:902:70c1:b0:154:667f:e361 with SMTP id l1-20020a17090270c100b00154667fe361mr1758846plt.148.1650074554671; Fri, 15 Apr 2022 19:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074554; cv=none; d=google.com; s=arc-20160816; b=l+ewE+NApiDoUulDwVq3j3+AF87q7Oi9z0JCIJ76KHBFG8zzj6+rVBKJaUwmpVf0iN ZOcodSc2HreJ4kv7JaG8Rw1cttEkYl/vI4MwsyAUp1pICdbSmj5MXH5sR4G/h+bu7Jz4 TQ+8hZcUFMBuwJCSg7yCrc975v3BshR0Vf24JFO+mMFqWZG8nHjeqUC2Lw5sWmPyHLa4 nmlN5b11rmEkFAjzoiwaJjIrZMCuqWY8XJTgdfdzF8MPiS1fkLg8dLgh7F5CGu80qs7c r6mjYwbwFhhiQ3ptbpMmB1fBb5mlLvBdvGu/5YTrOrrjVzdcj4hMvGjDPxDnCX/w25bK yPAg== 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=StnE2yigqTexhsy4pQKonZWMBJQv0X0pkdE+MLYRYPk=; b=uNNRK17g5wUf9Nsso99TEdMSlCT/wte40/zOUexqivMoXWJzmVOOTci6/m6Ys4Y9c6 D8FKLe46cbOyXa0fT5/89eU9trtccdwxCBJu2QqhAGGPEiqyTCMRbKvxM3ZoT7kC3thL t5NeTcL0NhA+VS++cDyZXSETE2hD6585gMYZSnVDgO8903zEjp4GJBJBkoGf0T2YMHi7 SGPSz1FjfHD51LE6lU3PD+ergLGFEbma9P4aPy5KjO0CuYVbX8AJQQFv6ezopq2XVkp3 A7W8FCszmkLcKszTalFT7i8t5S90rxe8pTrzgN0sAwIB9opFOgl/6IlJEOaFVaGUVIEy AwmA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c10-20020a630d0a000000b00398b2fc793dsi2711211pgl.795.2022.04.15.19.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:02:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A88EB1C7E81; Fri, 15 Apr 2022 18:22:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352134AbiDOKPL (ORCPT + 99 others); Fri, 15 Apr 2022 06:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239572AbiDOKPJ (ORCPT ); Fri, 15 Apr 2022 06:15:09 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A21BA314 for ; Fri, 15 Apr 2022 03:12:39 -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 1nfIvz-003FtZ-Db; Fri, 15 Apr 2022 20:12:12 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 15 Apr 2022 18:12:11 +0800 Date: Fri, 15 Apr 2022 18:12:11 +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" 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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Apr 15, 2022 at 11:51:49AM +0200, Ard Biesheuvel wrote: > > That is the whole point, really: ARCH_DMA_MINALIGN==128 does not mean > __ctx needs to be aligned to 128 bytes, it only means that it should > not share a 128 byte cacheline with the preceding fields. So if > kmalloc() returns buffers that are aligned to whatever alignment the > platform requires (which will be 64 in most cases), the above > arrangement ensures that, without requiring that CRYPTO_MINALIGN == > ARCH_DMA_MINALIGN. What if they started sharing a cacheline with the subsequent object? I guess you could add some more padding at the end though. I could accept this as a temporary solution, if you volunteer to modify all the affected drivers so we can get rid of this bandaid. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt