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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0BA9C47089 for ; Thu, 27 May 2021 13:29:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B164C6128B for ; Thu, 27 May 2021 13:29:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B164C6128B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=OjJ/lz1Cw9WCEwpGvODX5kgOujQMDBPiOZq1pkQjZKM=; b=Wyvz209wsaHzBo XK+1nIbm4oorQfUWIZWpbaT2M5uvLiENab+E1mfnoRM4gKyViJu5mZ8EFaffwDB6USMjg6gmrBfal mJhbcuR0tsk11MRJgottc53J438qjRkBPPF7KuzfIlZlDd0TZ9G0z2ihAZ3jfT2w6tLbQSu8g8IlQ cZosGySn7qbL3Oky0/X0KQDc4LWPU9/83YKxKBzgTnIAAWqnUGaQ4ukFKyQ9O2qi+34U8mo/jEnxq htbq5lrursrVd5+6ZPePznSY5sYeb9MhvHoBScRef8t17CJxFYlOfn2kTs2vaKRQ0Ik0kSJ4590QM tREq7O3Px2Wx/6yDerYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmG27-006Fff-LU; Thu, 27 May 2021 13:26:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmFur-006BnB-9n for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 13:19:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 64BA21476; Thu, 27 May 2021 06:19:10 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.39.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D4A13F73D; Thu, 27 May 2021 06:19:08 -0700 (PDT) Date: Thu, 27 May 2021 14:19:00 +0100 From: Mark Rutland To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kernel-team@android.com, Catalin Marinas , Ard Biesheuvel , Arnd Bergmann , Vincent Whitchurch Subject: Re: [PATCH] arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES) Message-ID: <20210527131900.GA37050@C02TD0UTHF1T.local> References: <20210527124356.22367-1-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210527124356.22367-1-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_061913_473475_38063FCE X-CRM114-Status: GOOD ( 25.23 ) 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 Thu, May 27, 2021 at 01:43:56PM +0100, Will Deacon wrote: > Back in 97303480753e ("arm64: Increase the max granular size"), > ARCH_DMA_MINALIGN was effectively increased to 128 bytes thanks to an > increase in L1_CACHE_BYTES due to an unsubstantiated performance claim > on the now obsolete ThunderX-1. Although this was reverted in > d93277b9839b, ARCH_DMA_MINALIGN was kept at 128 bytes by ebc7e21e0fa2 > ("arm64: Increase ARCH_DMA_MINALIGN to 128"). > > During discussion of the original patch, it was reported that the change > also prevented a warning during boot on (again, now obsolete) Qualcomm > server hardware where the cache writeback granule was larger than 64 > bytes. The reason for this warning was because non-coherent DMA could > lead to data corruption due to unexpected writeback from the CPU where a > cacheline is shared with other allocations. > > Since then, systems have appeared with larger cachelines still, and so > commit 8f5c9037a55b ("arm64/mm: Correct the cache line size warning with > non coherent device") reworked the warning so that it only appears on > systems where non-coherent DMA is actually required and taints the > kernel with TAINT_CPU_OUT_OF_SPEC. We are not aware of any systems, even > including the aforementioned obsolete machines, which have a CWG larger > than 64 bytes and require non-coherent DMA. > > More recently, it has been reported that a ARCH_DMA_MINALIGN of 128 > bytes wastes considerable memory (~6% immediately after boot on one > system). > > Reduce ARCH_DMA_MINALIGN to 64 bytes and allow the warning/taint to > indicate if there are machines that unknowingly rely on this. The rationale above makes sense to me, so: Acked-by: Mark Rutland Mark. > > Cc: Catalin Marinas > Cc: Mark Rutland > Cc: Ard Biesheuvel > Cc: Arnd Bergmann > Cc: Vincent Whitchurch > Link: https://lore.kernel.org/linux-arm-kernel/1442944788-17254-1-git-send-email-rric@kernel.org/ > Link: https://lore.kernel.org/linux-arm-kernel/CAOZdJXUiRMAguDV+HEJqPg57MyBNqEcTyaH+ya=U93NHb-pdJA@mail.gmail.com/ > Link: https://lore.kernel.org/linux-arm-kernel/20190614131141.4428-1-msys.mizuma@gmail.com/ > Link: https://lore.kernel.org/r/20210517074332.28280-1-vincent.whitchurch@axis.com > Signed-off-by: Will Deacon > --- > arch/arm64/include/asm/cache.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h > index a074459f8f2f..a9c0716e7440 100644 > --- a/arch/arm64/include/asm/cache.h > +++ b/arch/arm64/include/asm/cache.h > @@ -47,7 +47,7 @@ > * cache before the transfer is done, causing old data to be seen by > * the CPU. > */ > -#define ARCH_DMA_MINALIGN (128) > +#define ARCH_DMA_MINALIGN L1_CACHE_BYTES > > #ifdef CONFIG_KASAN_SW_TAGS > #define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT) > -- > 2.31.1.818.g46aad6cb9e-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel