Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp45929pxh; Thu, 7 Apr 2022 13:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX81KBwmzkKO4+kRV7sndIj5dZrx5ZND0T3v90i9TA7X/fQwjwcJnrRwoWBfePljR8v64/ X-Received: by 2002:a17:902:a501:b0:153:f956:29f0 with SMTP id s1-20020a170902a50100b00153f95629f0mr15744230plq.120.1649363487061; Thu, 07 Apr 2022 13:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649363487; cv=none; d=google.com; s=arc-20160816; b=RTp6HoAi9k3cVvPst8Wwp2veHLxDQ2BvVTnJyRZt7032U8IpUH3LKR4R5hAzX5DtzF kXQBAN8tAKlHxW4N1a8sHwq5y0VPT8zY4McplicOxyjdg9EFiG9Fm471fVA7WgdjKm9B H0GHHWf+hgGRl3GbcgT504StxqHumVmCdUW0HInO0Nd7U9JqgTSWpyuGl1G8pbXo0Lon 3q87bFGR7b4PonJBMd2DQL5+UX14+SsiLZd4I/E7TFp8+auFcUazR29OGZVS0ew2mGkJ oob5wqSnfGllVoLtpEXYrT/aKSlYF/5CG/wIPL8OrVzb9n/1AVXX5Hm2e+cTuZSgPhXN DM3w== 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=9ja3pmy6UI7es9FYyNMD66Fhy/LAk7R+IABdilbNUR4=; b=s1e5917N1Gj9kx6bUPDXBQ8aPipn/91632+Gb9WEpsdSdw/pu31GCOt/nIxgudNZsQ R5nkECMSxJESZEH0sSxyiuAj7xmuuEYWuMAYuAkj/VaASgQ6KpUkH/9Y2w40GUGZLx/J TTE+6pT6vQkfRYVizbwG4f0tt+oz5N7e9+etcOLAW4t/cziKrNjI2/m3kqjwTys6Av8v XCYCYDl4oh9QSQUxsTfocJD1tfCI7zVYf/GBL/0aXr/pBM1vNgmLmHjfX1QKvatU4v+l kKq7IIoACpenuN5FJ7C7NW0R9iBUsfxZJSDyDFb8K4Vofg8mkuD+eLabsNNa7EaP1KB/ TaMg== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lw15-20020a17090b180f00b001c97d373310si2875131pjb.102.2022.04.07.13.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0EB6D385324; Thu, 7 Apr 2022 12:45:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244863AbiDGLnf (ORCPT + 99 others); Thu, 7 Apr 2022 07:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238099AbiDGLnW (ORCPT ); Thu, 7 Apr 2022 07:43:22 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52DEFDEBB7 for ; Thu, 7 Apr 2022 04:41:22 -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 1ncQVX-0006Sw-Mv; Thu, 07 Apr 2022 21:41:01 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 07 Apr 2022 19:41:00 +0800 Date: Thu, 7 Apr 2022 19:40:59 +0800 From: Herbert Xu To: Catalin Marinas Cc: Ard Biesheuvel , Will Deacon , Marc Zyngier , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "David S. Miller" Subject: Re: [PATCH 07/10] crypto: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Message-ID: References: <20220405135758.774016-1-catalin.marinas@arm.com> <20220405135758.774016-8-catalin.marinas@arm.com> 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,URIBL_BLOCKED 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 Thu, Apr 07, 2022 at 12:01:02PM +0100, Catalin Marinas wrote: > > The only issue is whether the compiler gets confused by a pointer to a > structure with a smaller alignment than alignof(struct ...). I don't see > a performance or correctness issue on arm64 here. It would be a problem > if instead of 16 we went down to 8 or 4 due to unaligned accesses but > from 128 to 64 (or even 16), I don't think it matters. The issue is that there's code in the Crypto API which assumes that all pointers returned by kmalloc are aligned to CRYPTO_MINALIGN, if you break that then all that code would need to be modified. However, I think it's better to change the code that assumes CRYPTO_MINALIGN guarantees DMA alignment. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt