Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp44074lfe; Fri, 15 Apr 2022 18:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfbokh0r4CT5xZDCpsehM9jm6CNKBj1oaCQiajz78oBlKTaskyBB/Oui/jvVOX0dE4AZQb X-Received: by 2002:a17:902:ef48:b0:156:8ff6:e2cc with SMTP id e8-20020a170902ef4800b001568ff6e2ccmr1451346plx.130.1650072997230; Fri, 15 Apr 2022 18:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650072997; cv=none; d=google.com; s=arc-20160816; b=UYRDFgJiVYZjfMysBdjfgiRHmZR1fyX0ET+a65pPTI1e5kyjA2iOWkTHKNDhDrAL2f /ehHsRT1RhA7LMQNfHqT0T5pIPVX///N3um3bYZC7N01cQE71Cil6od069ShAL5Yezxl 09+sZS8Cr9mg2gCXyM3kKBLrWbMPL3QtAFXEM7sBA+K5uW8bjID1z31mUjjWyR7Msu7s w0OnQ5jjY5aLAZCRYeIh/6P2eJq7SX0e8eJ2inUpKNjef/3W9+/xx7MEaCOrM0Gl0X6q oH/HHUhmySF9G0Lj4CL6KHhlrUDpIEP3lx89uZdHoyMbe+Xe9xaq0mMRcvNAGrAzn76O plNw== 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=IdJ6509Soc3cyZFJcpFBAhxrS0eaX/k/H/A9/1C2hzI=; b=B5Af6WAhTx0lDw/i/6dlp6W9YlIIS4fJUvbh5Ktj+9kvzu5eW5aqjH40J3M+3SVQZ3 0VWwwsnbtAutCMUyos/78Wc1BtCbGUzcYB37tlydOVvbPrWCG/uiWxPN1N12uvCQ0Rgd 0gYdUKGfsQrPWsJJ+qW9vkBzNnUCSaPOk9hy01eELtEvF4nHy7NyDn5mL7MfIrhIQQTf 5DkY8OwpOyuxNVJVJ9r56e4qQOFoJAv2MiX1n8mZQn47Sohq/oMflosQTG8+zX6KTG+/ G/s44B0+30M4Y5ToaAs+oQhec7bc3F7R0EaeZb6BIQVTmxc9YmwdQWOTIhfO7eMYRC7O FPmQ== 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 6-20020a630a06000000b003816043ee11si3515246pgk.6.2022.04.15.18.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:36:37 -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 533EB15E228; Fri, 15 Apr 2022 18:02:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351339AbiDOIO5 (ORCPT + 99 others); Fri, 15 Apr 2022 04:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351329AbiDOIOx (ORCPT ); Fri, 15 Apr 2022 04:14:53 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17CE366AC for ; Fri, 15 Apr 2022 01:12:24 -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 1nfH3j-003EAz-G7; Fri, 15 Apr 2022 18:12:04 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 15 Apr 2022 16:12:03 +0800 Date: Fri, 15 Apr 2022 16:12:03 +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 10:05:21AM +0200, Ard Biesheuvel wrote: > > I guess that should be fixable. GIven that this is about padding > rather than alignment, we could do something like > > struct crypto_request { > union { > struct { > ... fields ... > }; > u8 __padding[ARCH_DMA_MINALIGN]; > }; > void __ctx[] __align(CRYPTO_MINALIGN); > }; > > And then hopefully, we can get rid of the padding once we fix drivers > doing non-cache coherent inbound DMA into those structures. Sorry, I don't think this works. kmalloc can still return something that's not ARCH_DMA_MINALIGN-aligned, and therefore __ctx won't be aligned correctly. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt