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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 1B088C2B9F4 for ; Mon, 14 Jun 2021 15:36:12 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 A2E7B61241 for ; Mon, 14 Jun 2021 15:36:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2E7B61241 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7222983A9E; Mon, 14 Jun 2021 15:36:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8XJ2i4UvmlCe; Mon, 14 Jun 2021 15:36:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 5E5FA83A9F; Mon, 14 Jun 2021 15:36:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 13D1BC000D; Mon, 14 Jun 2021 15:36:10 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6F384C000B for ; Mon, 14 Jun 2021 15:36:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5D783608F1 for ; Mon, 14 Jun 2021 15:36:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G8fY0SB9QHH1 for ; Mon, 14 Jun 2021 15:36:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp3.osuosl.org (Postfix) with ESMTPS id BB873608EE for ; Mon, 14 Jun 2021 15:36:07 +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 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-Disposition: inline In-Reply-To: <6f897830-301f-3eb4-785f-de446476e676@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Dong Aisheng , Dong Aisheng , Catalin Marinas , open list , linux-mm@kvack.org, iommu@lists.linux-foundation.org, Will Deacon , Christoph Hellwig , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 37286C2B9F4 for ; Mon, 14 Jun 2021 16:12:08 +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 06A2D613CC for ; Mon, 14 Jun 2021 16:12:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06A2D613CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pgy6+9/ZMIQDZEWfu2ntMHGITHOT9gFOwXU0k3KiyE4=; b=C3OtSQ7qs4Jrpm tJwOcjc+zPcEia5BgXGyVCB4/wFguiKKJg5FIaP0FSPHIBwmDFfPZt69M4GiK6w0qlBN7qtXtlWV8 8i9Ai708KCFglQl0xjNRy58vtBAhMxy5IOkxYGLWHo2YCLcHgTRQKdE1yDgpJFsHSz284F1l4+lo/ /9tVlyNSwX09gjDyhpkrziAbu2w44GEkoLkHiD1CIpNUeYBgUnopNXMegJnMv6luLTC8o1Q+wsOtg sUtcLAK3TcUxtyIJ742JPg8wXYZ+tQ1qB1+/4ROp3ppu0dhyfzy4R2SPCd6TCNEQqr3KpEICHDho1 LJTNgcR22UDjcGz0+Aag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsp9z-00F0hL-12; Mon, 14 Jun 2021 16:10:00 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsodC-00En5Z-Qi for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 15:36:08 +0000 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-Disposition: inline In-Reply-To: <6f897830-301f-3eb4-785f-de446476e676@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_083607_051590_51A83101 X-CRM114-Status: GOOD ( 15.58 ) 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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.