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=-16.2 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 EA5E9C47092 for ; Wed, 2 Jun 2021 13:27:47 +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 B4A5361168 for ; Wed, 2 Jun 2021 13:27:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4A5361168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.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:References:In-Reply-To:MIME-Version: Date:Message-ID:From:Cc:To:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MU2//TqAeWLLHOZLqpOssic6j6SBQEiD0mCLfZx9+1w=; b=H9+UD41XV3q51V usqZIAFXBYH233J8ewKpuS2BgPkWZGn2s1yeA/dgvs9FKH5xtw6dAO+tb5SAWIEO/9A+tkXi/h3s3 D+isyGaR7G6FSgVsRfs5yXYV7JYvKg07tSAucWWm7WhDtrmibqLE1fRjyvWgzrs7AFcp0qBIa5C5g GmsZF3Z7VcT3eBekDBMf2oEks34fE5oADlOQ3cVAmgZCTywglrEij7F1SbxQqR5SHLKzqDMy8GeiD E5vD7LcoWnHJ4PRcbqwopzOZkT+H7zlj6cipiTPKNfNvvV14Yftbe3NE+qsIyPgIdQji1AA1Pti6Z Y6E59WUNOTV8c5CtaG8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loQsb-004Ldm-1h; Wed, 02 Jun 2021 13:25:53 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loQsU-004LbS-VN for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 13:25:50 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20210602132542euoutp019ebf186247e8c9ff4a1a5f0f8faaf0f6~ExstgK9f90156401564euoutp01B for ; Wed, 2 Jun 2021 13:25:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210602132542euoutp019ebf186247e8c9ff4a1a5f0f8faaf0f6~ExstgK9f90156401564euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1622640342; bh=uIqHYeeFC4eyG//mLvst8btxUq8G7Jhpa6WM2R2kShQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=XTXmA1MGDo/zHt44XgvQlDrz9to4RUPnANqBKnbOue7U3QLhEQoyHxl7X4oQswCJh GusthKGNwwXdtlDxCnZcNA2ZI0JbmynrULie9XaifCi5s6mGquIz8IaitjHGNDhMr3 QCaY1I1eReei6kEUhoJ3FW83ZPireLUlNRr3O4Sc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210602132542eucas1p182e079c65066d0125df06d57d922d22e~ExstAbGWc0882008820eucas1p1l; Wed, 2 Jun 2021 13:25:42 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B9.F8.09444.5D687B06; Wed, 2 Jun 2021 14:25:41 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210602132541eucas1p17127696041c26c00d1d2f50bef9cfaf0~ExssfneXJ2461324613eucas1p10; Wed, 2 Jun 2021 13:25:41 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210602132541eusmtrp2bd673cab73515896eb5c6f70e1eec5e6~Exsser0LT0876608766eusmtrp2S; Wed, 2 Jun 2021 13:25:41 +0000 (GMT) X-AuditID: cbfec7f4-dbdff700000024e4-5a-60b786d5ced4 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.49.08696.5D687B06; Wed, 2 Jun 2021 14:25:41 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210602132540eusmtip2204996b850a3bec90f4fc7d058cafa34~Exsr7HPAS0431604316eusmtip2l; Wed, 2 Jun 2021 13:25:40 +0000 (GMT) Subject: Re: [PATCH] arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES) To: Will Deacon , linux-arm-kernel@lists.infradead.org Cc: kernel-team@android.com, Catalin Marinas , Mark Rutland , Ard Biesheuvel , Arnd Bergmann , Vincent Whitchurch , Bartlomiej Zolnierkiewicz From: Marek Szyprowski Message-ID: <4d0c8318-bad8-2be7-e292-fc8f70c198de@samsung.com> Date: Wed, 2 Jun 2021 15:25:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210527124356.22367-1-will@kernel.org> Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDKsWRmVeSWpSXmKPExsWy7djPc7pX27YnGEx9YWLx88t7Rou/k46x W2ycsZ7V4v2yHkaLHdtFLDY9vsZqsfT6RSaL89v8LVrumDpwemzbvY3VY828NYwev39NYvS4 vi7AY9OqTjaPzUvqPfq2rGIMYI/isklJzcksSy3St0vgyujZdpu5YKNURdvDBuYGxoliXYyc HBICJhItbz+ydjFycQgJrGCU6H3QwwzhfGGU2PThP1TmM6NEQ8NNFpiW3vbTjBCJ5YwSF36f ZQJJCAl8ZJRYPjsYxBYWCJbYdvkhM4gtIuAuceH4bFYQm1lgFpPE0elpIDabgKFE19suNhCb V8BOYumpXexdjBwcLAIqEmvWp4KYogLJEr836kJUCEqcnPkE7AROAVOJps//GSEmyktsfzuH GcIWl7j1ZD4TyGkSAj84JDY1z2OFuNlFYt/Ub1C2sMSr41vYIWwZif87YRqaGSUenlvLDuH0 MEpcbprBCFFlLXHn3C82kIuYBTQl1u/Shwg7Sky/+p8JJCwhwCdx460gxBF8EpO2TWeGCPNK dLQJQVSrScw6vg5u7cELl5gnMCrNQvLaLCTvzELyziyEvQsYWVYxiqeWFuempxYb5aWW6xUn 5haX5qXrJefnbmIEJqjT/45/2cG4/NVHvUOMTByMhxglOJiVRHjd87YmCPGmJFZWpRblxxeV 5qQWH2KU5mBREudN2rImXkggPbEkNTs1tSC1CCbLxMEp1cCUqaWieWLf6+41h612Pjwzl/2i 5u3GFxvvymRZVU32cYq+2LRAlUNwxrFTk9as29I+MbHA5Vuv5ItN055lxDr6eDQ/eXzuZqLj vfyk97IhnluStQLe/8u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J/zaZ3 0/NrobaGq//L9gfNMqtMmdpY+lp0p8qtx9N4ZIo4TO8a8i5bEpMWteVH5oO591Yk3SixLRN8 cTH89OKPm7fUR2TMehu9bvFE+zUFWt9ii+99nuk1a8pKrZKAeH1Hxu7IJ93/TINtSmSfxjC/ 37n/Bsud0+E3+kxuCOt9mqYVEVc65Zbjxv69sy55Tl3jcDHVMKyTb4XFW+FVZ03CeV7s8Q/L Td+9NSToXfRqfrt+1e27w5RulHU3LI1sPO7qm2p3+vcTJZbijERDLeai4kQAy1m3plMDAAA= X-CMS-MailID: 20210602132541eucas1p17127696041c26c00d1d2f50bef9cfaf0 X-Msg-Generator: CA X-RootMTR: 20210602132541eucas1p17127696041c26c00d1d2f50bef9cfaf0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210602132541eucas1p17127696041c26c00d1d2f50bef9cfaf0 References: <20210527124356.22367-1-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_062547_403377_40F603B5 X-CRM114-Status: GOOD ( 29.10 ) 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 Hi Will, On 27.05.2021 14:43, 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 > --- This patch landed in todays linux-next as commit 65688d2a05de ("arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES)"). It causes an issue on Raspberry Pi 3b board. System boots to userspace fine, but then it hangs somewhere during the init scripts after loading the modules. I didn't manage to track where it hangs yet though. > 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) Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel