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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 98FD3C4708F for ; Mon, 31 May 2021 05:40:19 +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 58EDF61248 for ; Mon, 31 May 2021 05:40:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58EDF61248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R2+gANdEOQEnQxj3n1b+Wix2evcDOFTwYZD3xf61R28=; b=l+GDsetbIaaSBq XtrJrlSGkyXL6dor+eOjmDyvT1Kkv846/EjEynQsNEejPYP9YghS8+XpmL5HY8vioABgQKmXA4i/l ABRN+ocdVt1QkMMVx/G5kswxF2nYh3JJf5E2O8CYvAPkTSsaZoRCMwSvGkzh7JlkeGc2pGGW0ovdp KPj1Qz+Vng2rz0c9PABkZAjQtq6kZznWzIE71PEGBJ/qSEd+S4uN2F8C9xPNY8iVFY+3HTbMvNxln pEcCkdsWVSlCf7Gn+wmfpN/UqbFHZSf+BpF42Rs5CEyBzPHBc9tULc3ilsUBI2fn4yr5oF3Qmajvt 7TMamg7lfEcWW3/pJMHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnadP-00ArY0-AU; Mon, 31 May 2021 05:38:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnadL-00ArXd-PN for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 05:38:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4EDE46127A for ; Mon, 31 May 2021 05:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622439519; bh=TUiCxcMV8/23BgHFV1iyNnU8OeDojGguyKiStvUIwVY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=aAS3EPLDmmpa1FZL30TVLd22uZACRmgfr/Xp3dtKtee0rPx9DBLXGtxaDm+qZtJEA ZExy5530+weHbMzb0Zn9v3I100WxoT/cKEBcat4z2BqtFVSTZ+bk4HKY0W3vJBd3Iq iggOCIlKBmM2ol0iDOcovEaKK0DDh6o0buEe7L3i7i9GoRlEndIi3wgjW25MKluIzc ZL3pwnS8sgDehk4YWYe8ONj2gcUqy5oLtzmxfbyF3vehAU2bGddLM8JJGhr6RSkE3m /I+gx0qWlKosmS509pAzbezBN3PhVAzR5l4JpSBjgtQyHphqgbo6tpAAdHmgLCIW95 JOM0alXhmw33A== Received: by mail-ot1-f48.google.com with SMTP id c31-20020a056830349fb02903a5bfa6138bso3163727otu.7 for ; Sun, 30 May 2021 22:38:39 -0700 (PDT) X-Gm-Message-State: AOAM533oKZ4GJ5UgnLKJKN3GiwnzSN8HR1GRgmd+3Zz00ALMlEk+419u 12P/ix8hXfvnHc1JqGOj6PybeNxnaynNQqawaDU= X-Google-Smtp-Source: ABdhPJzHU3Heb9Fcrq0qL+B6yzdhLBKpbsJwDQ7baIqd9teSnl0hy8U1mtxkZbyeBx9s9fu8cY05M4E7zyk2+pzTZ2c= X-Received: by 2002:a9d:7cd8:: with SMTP id r24mr16171314otn.90.1622439518662; Sun, 30 May 2021 22:38:38 -0700 (PDT) MIME-Version: 1.0 References: <20210527124356.22367-1-will@kernel.org> In-Reply-To: <20210527124356.22367-1-will@kernel.org> From: Ard Biesheuvel Date: Mon, 31 May 2021 07:38:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES) To: Will Deacon Cc: Linux ARM , Android Kernel Team , Catalin Marinas , Mark Rutland , Arnd Bergmann , Vincent Whitchurch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210530_223839_887394_2B38F80C X-CRM114-Status: GOOD ( 26.47 ) 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, 27 May 2021 at 14:44, 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. > > 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 Acked-by: Ard Biesheuvel > --- > 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