Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1472926imw; Tue, 5 Jul 2022 10:05:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vGMCC7lSn/LQVa/RDRuFadWP5KKgDRCEYz//HxDybceN6rKQ3YDL5C0TjBHdSAxw1VpKHV X-Received: by 2002:a17:902:b681:b0:16a:f81:6b02 with SMTP id c1-20020a170902b68100b0016a0f816b02mr40733222pls.28.1657040700095; Tue, 05 Jul 2022 10:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657040700; cv=none; d=google.com; s=arc-20160816; b=iHGGraK76TkfDiTOTOHY1WmbMn0ndTtEilY5jCZCDGXLaBJFa9DDrt/x9kCEvDWvcs vbp2BdQ1PV+vnF3in6Lbvp5n21VFtvVRoVIXbv3G75ehCtgszH9lTMFuuY3JM9wAq+lh 2hY8Q6PtMB8dV0pFQbaPhix2R/+5qUKOa6k6pg8WgaSe1Sn7uv2BrFSsp+hpKdvDfGs7 ubKiK++hcxzgqfpboa0o9QYgtrRBUO3T4KiCZ2Oc1ZsVyT+jhjtzcJ7D3RjeLIPLAtN2 oFpiCletl0yRTQsX7GkhEWVNDNE01I5p4n4Q+Rdf1OPGgp7r6hDtiDkjGGfsISgWplZg FSSg== 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=VFHBqUHwwYoA8FWyemsM9JmzLGwAB1VPkIrcaKdDl6s=; b=ps5kOSUUYlrwefAQ8IryGgMggWVKISQNZV+4WTEPVEy/H0pbFja+7TTYZHGvStdCYD BgSKwk5pNIngBWrDt1ad1ciwR+OZHzul98cymf24SYW4kWahvx4sYQe1auBdCEzxUNEj uOqWQdAye1UQWrFqfscC8U7Gg/OLxY/3zo1ftdt92hRYkNT64eyBVdVsHWDZdycMyBHO Xy8Ljaiux/DQAFSBhb4FR0VwxRLKYS5mzSznzxeV48z14433wmAL21na0h6Bn7Pd+8/c 7XA2JZjUPTCw1b4OAVhRojn5ptb23LtttdpUJBKAu9DSD2/rbEM8yApnh1ou3ZT4oN8M xCXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o60-20020a17090a0a4200b001ef839e735asi10054488pjo.72.2022.07.05.10.04.48; Tue, 05 Jul 2022 10:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233140AbiGEQur (ORCPT + 99 others); Tue, 5 Jul 2022 12:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbiGEQup (ORCPT ); Tue, 5 Jul 2022 12:50:45 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E11BB1DA7E; Tue, 5 Jul 2022 09:50:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id C89A168AA6; Tue, 5 Jul 2022 18:50:39 +0200 (CEST) Date: Tue, 5 Jul 2022 18:50:39 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: Christoph Hellwig , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Dan Williams , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Bjorn Helgaas , Greg Kroah-Hartman Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220705165039.GB14566@lst.de> References: <20220615161233.17527-21-logang@deltatee.com> <20220629064854.GD17576@lst.de> <99242789-66a6-bbd2-b56a-e47891f4522e@deltatee.com> <20220629175906.GU23621@ziepe.ca> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> <20220705161240.GB13721@lst.de> <20220705164315.GB14484@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [note for the newcomers, this is about allowing mmap()ing the PCIe P2P memory from the generic PCI P2P code through sysfs, and more importantly how to revoke it on device removal] On Tue, Jul 05, 2022 at 10:44:49AM -0600, Logan Gunthorpe wrote: > We might be able to. I'm not sure. I'll have to figure out how to find > that inode from the p2pdma code. I haven't found an obvious interface to > do that. I think the right way to approach this would be a new sysfs API that internally calls unmap_mapping_range internally instead of exposing the inode. I suspect that might actually be the right thing to do for iomem_inode as well.