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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 15462C2B9F4 for ; Mon, 14 Jun 2021 15:36:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9ADA36120E for ; Mon, 14 Jun 2021 15:36:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9ADA36120E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 217846B006E; Mon, 14 Jun 2021 11:36:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C7A46B0070; Mon, 14 Jun 2021 11:36:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 068716B0071; Mon, 14 Jun 2021 11:36:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id C701A6B006E for ; Mon, 14 Jun 2021 11:36:07 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 687E1181AC544 for ; Mon, 14 Jun 2021 15:36:07 +0000 (UTC) X-FDA: 78252730374.28.73AABE0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf26.hostedemail.com (Postfix) with ESMTP id F3E3541449E4 for ; Mon, 14 Jun 2021 15:36:01 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id E0F6C68AFE; Mon, 14 Jun 2021 17:36:03 +0200 (CEST) Date: Mon, 14 Jun 2021 17:36:03 +0200 From: Christoph Hellwig To: 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" , Christoph Hellwig , Marek Szyprowski Subject: Re: [PATCH 1/1] dma: coherent: check no-map property for arm64 Message-ID: <20210614153603.GA1998@lst.de> References: <20210611131056.3731084-1-aisheng.dong@nxp.com> <20210614083609.GA18701@willie-the-truck> <20210614145105.GC30667@arm.com> <6f897830-301f-3eb4-785f-de446476e676@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f897830-301f-3eb4-785f-de446476e676@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=none; spf=none (imf26.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Stat-Signature: wq8f99984uq6kp733u6uh1yt7b8nm9uw X-Rspamd-Queue-Id: F3E3541449E4 X-Rspamd-Server: rspam06 X-HE-Tag: 1623684961-950185 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.