From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F725C433F5 for ; Fri, 15 Apr 2022 10:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SgWeFoMdJMtBRgkIMHUcqThMPAQFoc0sePS+UcC7YKo=; b=2zVp0hosEtrckS diOV9JTVUGIMHCfq8dpnAU8UphSaNkXJHbZnn6kdfPvZ0+grpQOKh1itTvFH3UJUlH3z/EfHXIL5Q VTaV7uXi9RJjVCWPCPycfQTJkq8L5Ip0OYmxjP1sgmuLA2ATbNhEi9hQ2aHEEcBU9JkMDigEipnIq hKQ4DBMGELcUqtAJ2sbPLRf17ZMHPY4fM7eOSD+QJBBMhj5Z7rA8f38oslI27KO7SxEa2pNEaRhvC 2u0VuItwfCPFM3+EPM/7Ka9rD9u/6er8dLnNtQEPqStyt+Gj/2HYXVVv4KgaVAsCgZ/7dvpnG0aOt 9xhGqzu98NZc8rgnvFTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfJSs-009hKq-Rg; Fri, 15 Apr 2022 10:46:10 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=fornost.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfJSn-009hK5-M9 for linux-arm-kernel@lists.infradead.org; Fri, 15 Apr 2022 10:46:09 +0000 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 1nfJSV-003GU9-5k; Fri, 15 Apr 2022 20:45:48 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 15 Apr 2022 18:45:47 +0800 Date: Fri, 15 Apr 2022 18:45:47 +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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_034605_757569_E360E897 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 15, 2022 at 12:22:27PM +0200, Ard Biesheuvel wrote: > > Subsequent objects are owned by the driver, and it is the > responsibility of the driver not to modify the fields while it is also > mapped for DMA (and we have had issues in the past where drivers > violated this rule). So as long as ARCH_KMALLOC_ALIGN guarantees > actual DMA minimum alignment for both the start and the end, we > shouldn't need any explicit padding at the end. I don't understand why this is guaranteed. The driver context size is arbitrary so it could end in the middle of a cacheline. The slab allocator could well lay it out so that the next kmalloc object starts right after the end of the context, in which case they would share a cache-line. The next kmalloc object could be (and in fact is likely to be) of the same type. Previously this wasn't possible because kmalloc guaranteed alignment. > I'l do a scan of drivers/crypto to figure out how much we are relying > on this to begin with. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel