Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2854118pxj; Mon, 14 Jun 2021 08:38:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYaLjG4fljDTr8KT4fOEGe4kPKbiFyPdEAg8lIF59jhFg3z5nxiYkD7NZGdjdQcgajxAP+ X-Received: by 2002:aa7:ce82:: with SMTP id y2mr17814897edv.264.1623685085587; Mon, 14 Jun 2021 08:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623685085; cv=none; d=google.com; s=arc-20160816; b=gY972/IsWuvepUxWvZLGFmHgPa8F41+PFc6e0NLYStmODIZdDA/p+IplajMzbEyIZX dWaW3OsNxUcNEts3PaXLZ2OKgMbF3ZWmOxVzwyVRAHo4rQa8eTydgKC49p0qxNKUUc47 u/DUtX8xLj9fztL4rEJ2IVVUNZPNaw/jyvsfTNdmuiKAOiqpjlkzWfP33rshQtnO9IoZ YpvPFcy+57z8SA8y7Ca4YjmE14ai0WsLbIhgaGfKq6/kUhoGl6Qa8mK8goYEXIFtYz6o WrWWtyRUVOVz++p3X4tHH/+mEYrlss9gIRsz35maFGy50N2KcMrTO71FkZuST7EKKadF vpIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nw+h35Owz6ABWMoSytzEbUC2Keuz0iSSAMtb1JouBAs=; b=S4XtKGeCuiWPjYR24CimtCn6hXT97UuW25N1wPDzboRDjzCKek8EzFMN9/KnbrN8hf cSGKIMGzPbbybSmHIF9YtgUO1JunYtWMAC17iNJvZcKe30i0lF7RhfyqcdzYBwdrH/JV tq7BWyEgIvukbHgp62miPyLn0RJz4OcBB0tGbt1FLcs9P/FKlOvPczakd3SNOqZXddzv iG36H8z3MNL9B116vvBuXnYwshTmLFMDiufzKKx1SgfDsnpu2lNMWU62mJCmz2PCNh5t jWhoQN0cM5c1teVNmJfV7ms5vgGtGgXHS/nARXJTqFoQ6VbEQX5GTkMrIXxYbbTYbm2E XlkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz11si11529698edb.37.2021.06.14.08.37.42; Mon, 14 Jun 2021 08:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233600AbhFNPi3 (ORCPT + 99 others); Mon, 14 Jun 2021 11:38:29 -0400 Received: from verein.lst.de ([213.95.11.211]:45022 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233644AbhFNPiJ (ORCPT ); Mon, 14 Jun 2021 11:38:09 -0400 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.