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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 00F23C48BDF for ; Tue, 15 Jun 2021 15:35:36 +0000 (UTC) Received: from bombadil.infradead.org (unknown [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 C6764615A0 for ; Tue, 15 Jun 2021 15:35:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6764615A0 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=7JHMEMiWrsHNBn40PNxpWUTkA1JaWG4CtMHXwS//634=; b=l4zgOtQE3jfDJm fsO9lnNYuMGbwSV3W29njc5tv+pmPA/hMIUAjELnhC4f7oAGHjghgPYs8uO5KrvrwXgXZMYwhn+Ih TGGqdVXl0BqKbkZbse8suMjLUfUOYByp7rqzRbjoR01ucmtuMsUhvH4mWMmd/o12E29uiVKj7uowY rmCrz4nEpVwqTvNo2cBLPxqUwIUgkskNy+iKzY5ZyUfnKAhji7YsT36d5ijI1bRvbz79d7mugcUf3 DC2s/+Z2BGE1f7aclH6nsG48e75NkDc1xpY5wS5dSk8mDP0CziUAtMMyH70blZsofARolHrPga0i7 sZVxbbqINdY3CXNZbbVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltAzS-000y8f-7B; Tue, 15 Jun 2021 15:28:34 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt9Kv-000DwX-OI for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 13:42:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=References:Content-Type: Content-Transfer-Encoding:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:To :Subject:Sender:Reply-To:Content-ID:Content-Description; bh=SL1Ft6VWY/RjURdlPpMzqSKXBcYq78k+CzNlalELtNw=; b=JRxBpyv6U6STB7wYywqYdv5N3C SX3pmimt6cMYnKYGmfiq5o9Xxh9KpFN31HZ+SnK70Px9ci6pLnjEDKJu3gatf6UYvMh5+nJ5tobLR AiXEX0p6R+pHj4SMVs6T3g1E4uv7Z5I2hMx3WWYhVRDApRaJlcaPYJH1+lEGJIANq95e0Y6yE0qVA NjDFkLcoPR+wIN0oQTokx2rmaeiTnjH6zQHGR75Tfql7VkbLdRBmkUT0aW0cHv9T4mh7+4rVIY+er bX6mroiNUXnJMxKxXgsU60r6IiltTo5LjX5n19JiIC+JXkUnuDa8poq+02yITla22tAwl8iBd4828 JoKFDhqA==; Received: from mailout2.w1.samsung.com ([210.118.77.12]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt3Mh-007RnQ-JO for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 07:20:16 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20210615071959euoutp0269485a177c96413489f5d9f1fb29f025~IsGHUm-Ku0881608816euoutp02D for ; Tue, 15 Jun 2021 07:19:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20210615071959euoutp0269485a177c96413489f5d9f1fb29f025~IsGHUm-Ku0881608816euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1623741599; bh=SL1Ft6VWY/RjURdlPpMzqSKXBcYq78k+CzNlalELtNw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=B//buWfHqa/n9KDFqYVwPXl+fDXJddaFvzPXrCWmWdAov0cDyD7kBwGkcc4Pmud05 vUZsVZfbjXVcLoxSxIZ3bLSubAHFp6UxgzF/1PaBzGGeYl8cPV/jEQ5VskWbxT6c2+ Qzl40T8lD1mTAPSnkN+Gfa171LPymvqFCFPTy31s= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210615071959eucas1p17d73b40993aca625921fa2df1175e2ff~IsGHFn4ot2709327093eucas1p12; Tue, 15 Jun 2021 07:19:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 90.70.09444.F9458C06; Tue, 15 Jun 2021 08:19:59 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210615071959eucas1p29ec7b2d9fa2f206a99cd3ec757e4a6bf~IsGGtUCjs1417614176eucas1p2W; Tue, 15 Jun 2021 07:19:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210615071959eusmtrp1e135f6e3b85c08046694ef8b87a1a6d5~IsGGsgOEV2144721447eusmtrp1G; Tue, 15 Jun 2021 07:19:59 +0000 (GMT) X-AuditID: cbfec7f4-dd5ff700000024e4-be-60c8549f0815 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 18.10.08696.F9458C06; Tue, 15 Jun 2021 08:19:59 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210615071958eusmtip12e3c533f64d669cab1d9e3f5aab42c52~IsGGF7Mdn2836228362eusmtip11; Tue, 15 Jun 2021 07:19:58 +0000 (GMT) Subject: Re: [PATCH 1/1] dma: coherent: check no-map property for arm64 To: Christoph Hellwig , Robin Murphy Cc: Catalin Marinas , Dong Aisheng , Will Deacon , Dong Aisheng , iommu@lists.linux-foundation.org, open list , linux-mm@kvack.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" From: Marek Szyprowski Message-ID: <7729cff3-27b4-c233-7f53-95f6140d3828@samsung.com> Date: Tue, 15 Jun 2021 09:19:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210614153603.GA1998@lst.de> Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPKsWRmVeSWpSXmKPExsWy7djPc7rzQ04kGDxuUrb4MnUXs8X7ZT2M Fn83T2ezWLn6KJPFgv3WFpseX2O1uLxrDpvFvTX/WS0OfnjCatFyx9SBy2PNvDWMHjtn3WX3 2LSqk81j06dJ7B6bl9R7TL6xnNFj980GNo+N73YweXzeJBfAGcVlk5Kak1mWWqRvl8CV8blj PkvBI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E1aLljqkDl8eaeWsYPXbOusvu sWlVJ5vHpk+T2D02L6n3mHxjOaPH7psNbB4b3+1g8vi8SS6AM0rPpii/tCRVISO/uMRWKdrQ wkjP0NJCz8jEUs/Q2DzWyshUSd/OJiU1J7MstUjfLkEv43PHfJaCR9wVl5q2sTcwHuXsYuTk kBAwkdhy8ClzFyMXh5DAUkaJ249mM0MkZCROTmtghbCFJf5c62KDKHrPKPFkfw9LFyMHh7CA u8TiJQkgNSJA5rLeY6wgNcwCD5gkXm3YzALR8J1JYvqvQ0wgVWwChhJdb0EmcXLwCthJ3DrY DraNRUBVomNlP1iNqECyxM/17VA1ghInZz5hAbE5BbQlTlzeDFbDLGAmMW/zQ2YIW15i+9s5 ULa4xK0n85kmMArNQtI+C0nLLCQts5C0LGBkWcUoklpanJueW2ykV5yYW1yal66XnJ+7iREY t9uO/dyyg3Hlq496hxiZOBgPMUpwMCuJ8B6uP54gxJuSWFmVWpQfX1Sak1p8iNEU6J+JzFKi yfnAxJFXEm9oZmBqaGJmaWBqaWasJM5rcmRNvJBAemJJanZqakFqEUwfEwenVAPTxnsffx5J 7j2rzVBTE6kRUFzbuKjzIbfFwc0XpENZd1hq9npVVpeptNptYN3U9kZd6onmPN/at9Lnprku 6mG7Vz6B/0lJzLIHm3S68/3EkrWWX738TWv53cDf175fXdCyd9/dtVGfY7+qWNWlOxolslzZ f1zQ7eiDZfKqpza133FbJ3Fp7kyTqSfu2pYeclok3GydkBK+Y4ZMsWmLfOWZQqPzfOnTONwE 3255VsGuqLPhoXlAzo4Jz6d/2O53Kv+R50qjZhnjYpu5oQ3yUVMTj87M7v7r+uIg/4stl1ds 4LVs083LFon3qUqST/zEJTbxkyOrLtdjXq2DXIoRbt7TGlv6UqdeOyb9eq5g+F0lluKMREMt 5qLiRAD3b3J/ZAMAAA== X-CMS-MailID: 20210615071959eucas1p29ec7b2d9fa2f206a99cd3ec757e4a6bf X-Msg-Generator: CA X-RootMTR: 20210614153610eucas1p209898b2e8dc013fe6ef072060609c21d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210614153610eucas1p209898b2e8dc013fe6ef072060609c21d References: <20210611131056.3731084-1-aisheng.dong@nxp.com> <20210614083609.GA18701@willie-the-truck> <20210614145105.GC30667@arm.com> <6f897830-301f-3eb4-785f-de446476e676@arm.com> <20210614153603.GA1998@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_082010_668596_0B98BB29 X-CRM114-Status: GOOD ( 18.85 ) 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 Christoph, On 14.06.2021 17:36, Christoph Hellwig wrote: > On Mon, Jun 14, 2021 at 04:34:05PM +0100, Robin Murphy wrote: >>> Looking at the rmem_dma_device_init() -> dma_init_coherent_memory(), it >>> ends up calling memremap(MEMREMAP_WC) which would warn if it intersects >>> with system RAM regardless of the architecture. If the memory region is >>> nomap, it doesn't end up as IORESOURCE_SYSTEM_RAM, so memremap() won't >>> warn. But why is this specific only to arm (or arm64)? >> Didn't some ARMv7 implementations permit unexpected cache hits for the >> non-cacheable address if the same PA has been speculatively fetched via the >> cacheable alias? > If we care about that we need to change these platforms to change the > cache attributes of the kernel direct mapping instead of using vmap. > We already have code to do that for openrisc, someone just needs to > write the glue code for other platforms. ARAIR there is a problem with changing cache attributes of the direct mappings on ARM 32bit. The whole lowmem is mapped with 2M 'section' mappings. Changing cache attributes causes 2 issues. First - one would need to split 2M entry into 4K entries. Second - 2M section mappings for the whole lowmem area are located in the per-process page tables. Changing the cache attributes would require locking all processes and iterating over their page table entries, which is a huge task. 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