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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7A15C433FE for ; Thu, 21 Apr 2022 14:45:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389173AbiDUOsb (ORCPT ); Thu, 21 Apr 2022 10:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356573AbiDUOsa (ORCPT ); Thu, 21 Apr 2022 10:48:30 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0560AE0C5; Thu, 21 Apr 2022 07:45:41 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 48D5068B05; Thu, 21 Apr 2022 16:45:37 +0200 (CEST) Date: Thu, 21 Apr 2022 16:45:36 +0200 From: Christoph Hellwig To: Serge Semin Cc: Christoph Hellwig , Robin Murphy , Serge Semin , Gustavo Pimentel , Vinod Koul , Jingoo Han , Bjorn Helgaas , Frank Li , Manivannan Sadhasivam , Marek Szyprowski , Vladimir Murzin , Alexey Malahov , Pavel Parkhomenko , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping Message-ID: <20220421144536.GA23289@lst.de> References: <20220324014836.19149-1-Sergey.Semin@baikalelectronics.ru> <20220324014836.19149-4-Sergey.Semin@baikalelectronics.ru> <0baff803-b0ea-529f-095a-897398b4f63f@arm.com> <20220417224427.drwy3rchwplthelh@mobilestation> <20220420071217.GA5152@lst.de> <20220420083207.pd3hxbwezrm2ud6x@mobilestation> <20220420084746.GA11606@lst.de> <20220420085538.imgibqcyupvvjpaj@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220420085538.imgibqcyupvvjpaj@mobilestation> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: > On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: > > I can't really comment on the dma-ranges exlcusion for P2P mappings, > > as that predates my involvedment, however: > > My example wasn't specific to the PCIe P2P transfers, but about PCIe > devices reaching some platform devices over the system interconnect > bus. So strike PCIe, but this our definition of Peer to Peer accesses. > What if I get to have a physical address of a platform device and want > have that device being accessed by a PCIe peripheral device? The > dma_map_resource() seemed very much suitable for that. But considering > what you say it isn't. dma_map_resource is the right thing for that. But the physical address of MMIO ranges in the platform device should not have struct pages allocated for it, and thus the other dma_map_* APIs should not work on it to start with. 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 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B6AFC433F5 for ; Thu, 21 Apr 2022 14:45:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C9F7141E6A; Thu, 21 Apr 2022 14:45:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTfNZApgRFqW; Thu, 21 Apr 2022 14:45:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 7F0CD41B83; Thu, 21 Apr 2022 14:45:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5EE85C0033; Thu, 21 Apr 2022 14:45:43 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id C38A5C002C for ; Thu, 21 Apr 2022 14:45:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A1C2241E6A for ; Thu, 21 Apr 2022 14:45:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 86qoWFUNyHBs for ; Thu, 21 Apr 2022 14:45:41 +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 smtp4.osuosl.org (Postfix) with ESMTPS id 5C80A41B83 for ; Thu, 21 Apr 2022 14:45:41 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 48D5068B05; Thu, 21 Apr 2022 16:45:37 +0200 (CEST) Date: Thu, 21 Apr 2022 16:45:36 +0200 From: Christoph Hellwig To: Serge Semin Subject: Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping Message-ID: <20220421144536.GA23289@lst.de> References: <20220324014836.19149-1-Sergey.Semin@baikalelectronics.ru> <20220324014836.19149-4-Sergey.Semin@baikalelectronics.ru> <0baff803-b0ea-529f-095a-897398b4f63f@arm.com> <20220417224427.drwy3rchwplthelh@mobilestation> <20220420071217.GA5152@lst.de> <20220420083207.pd3hxbwezrm2ud6x@mobilestation> <20220420084746.GA11606@lst.de> <20220420085538.imgibqcyupvvjpaj@mobilestation> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220420085538.imgibqcyupvvjpaj@mobilestation> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Rob Herring , Vladimir Murzin , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, Gustavo Pimentel , Manivannan Sadhasivam , Frank Li , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Alexey Malahov , Serge Semin , dmaengine@vger.kernel.org, Vinod Koul , Pavel Parkhomenko , Jingoo Han , Bjorn Helgaas , Robin Murphy , Christoph Hellwig 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 Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: > On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: > > I can't really comment on the dma-ranges exlcusion for P2P mappings, > > as that predates my involvedment, however: > > My example wasn't specific to the PCIe P2P transfers, but about PCIe > devices reaching some platform devices over the system interconnect > bus. So strike PCIe, but this our definition of Peer to Peer accesses. > What if I get to have a physical address of a platform device and want > have that device being accessed by a PCIe peripheral device? The > dma_map_resource() seemed very much suitable for that. But considering > what you say it isn't. dma_map_resource is the right thing for that. But the physical address of MMIO ranges in the platform device should not have struct pages allocated for it, and thus the other dma_map_* APIs should not work on it to start with. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu